Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-30-2001, 04:30 AM
Metal-Slug Metal-Slug is offline
!_!
Metal-Slug's Avatar
Join Date: Jun 2001
Posts: 2,421
Metal-Slug is on a distinguished road
hehehehe

im trying to make it so that if i say die <account> without the <>'s it will kill that account, i have no idea how to start this, i was just wondering if someone could tell me how or post it
Reply With Quote
  #2  
Old 09-30-2001, 04:36 AM
oscarjf1 oscarjf1 is offline
Registered User
Join Date: Aug 2001
Location: I live in the US
Posts: 107
oscarjf1 is on a distinguished road
Send a message via AIM to oscarjf1
umm

i think it would be along the lines of
NPC Code:

tokenize #c;
if (strequals(#t(0),die)) {
with (getplayer(#t(1))) {playerhearts-=20;
}
}



That SHOULD work...i dont know if it will.
__________________
I speek on behalf of my staff.
~laterz

Lagoonia Staff
-Tiki God Of Power
Reply With Quote
  #3  
Old 09-30-2001, 04:37 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

First of all, you need to make an NPC that saves the account name to a server.string.

Then, you need to make a system NPC that kills the player if the server.string is equal to their account name.

And that's that.

[edit]P.S. - for Non-P2P[/edit]
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #4  
Old 09-30-2001, 06:52 AM
Metal-Slug Metal-Slug is offline
!_!
Metal-Slug's Avatar
Join Date: Jun 2001
Posts: 2,421
Metal-Slug is on a distinguished road
how i make it work?
Reply With Quote
  #5  
Old 09-30-2001, 06:55 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
thats hilarious, just dont give that to people you dont trust!!!
Reply With Quote
  #6  
Old 10-01-2001, 08:51 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
you can do that with non-p2p it just would be laggier
Reply With Quote
  #7  
Old 10-01-2001, 09:03 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Re: hehehehe

Quote:
Originally posted by Metal-Slug
im trying to make it so that if i say die <account> without the <>'s it will kill that account, i have no idea how to start this, i was just wondering if someone could tell me how or post it
uhh youw would have to have it were the player who was being killed would have an NPC and the person who wants him dead having a NPC and here is what it would be:

NPC Code:

Killer:
if (created) {
toweapons Kill Other Player;
}
if (playerchats && startswith(die)) {
if (hasweapon(Kill Other PLayer)) {
tokenize #c;
setstring server.kill,#t(1);
}
}

Victim:
if (strequals(#a,#s,server.kill)) {
playerhearts=0;
setstring server.kill, ;
}


That would work ... (i think)

Last edited by nyghtGT; 10-01-2001 at 09:05 AM..
Reply With Quote
  #8  
Old 10-01-2001, 09:07 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Re: Re: hehehehe

Quote:
Originally posted by nyghtGT

That would work ... (i think)
yes that would work
Reply With Quote
  #9  
Old 10-01-2001, 09:13 AM
ArmadeusWarlock ArmadeusWarlock is offline
Registered User
Join Date: Jun 2001
Posts: 373
ArmadeusWarlock is on a distinguished road
Aha, very well that would work. And what about those with a space in their acct? like, for example:
Account:Stefan Dude
Stefan and dude are two different words, and with tokens, you only did token 1, which is the 2nd word. its best to use #e. Here is an example:

NPC Code:

//Killer
if(created){
toweapons Killer;
}
if(isweapon&&playerchats&&startswith(kill player)){
setstring server.tobekilled,#e(12,-1,#c);
}
//Victim
if(strequals(#a,strtofloat(server.tobekilled))){
playerhearts-=20;
setstring server.tobekilled,;
}



I dont have graal on this comp so Im not ENTIRELY sure that would work, with the strequal part, i am having a brain cramp and cant remember how to do that :o, but you get the idea.
Reply With Quote
  #10  
Old 10-01-2001, 09:15 AM
ArmadeusWarlock ArmadeusWarlock is offline
Registered User
Join Date: Jun 2001
Posts: 373
ArmadeusWarlock is on a distinguished road
Like when I warp people to survivor island, you have to put " " around those with more than 1 word in there account, but im not sure if that works with toekns =O
Oh well, Im confused enough =(
Reply With Quote
  #11  
Old 10-01-2001, 09:16 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Quote:
Originally posted by ArmadeusWarlock
Aha, very well that would work. And what about those with a space in their acct? like, for example:
Account:Stefan Dude
Stefan and dude are two different words, and with tokens, you only did token 1, which is the 2nd word. its best to use #e. Here is an example:

NPC Code:

//Killer
if(created){
toweapons Killer;
}
if(isweapon&&playerchats&&startswith(kill player)){
setstring server.tobekilled,#e(12,-1,#c);
}
//Victim
if(strequals(#a,strtofloat(server.tobekilled))){
playerhearts-=20;
setstring server.tobekilled,;
}



I dont have graal on this comp so Im not ENTIRELY sure that would work, with the strequal part, i am having a brain cramp and cant remember how to do that :o, but you get the idea.
if the numbers are right in the #e() then it would work
Reply With Quote
  #12  
Old 10-01-2001, 07:26 PM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Quote:
Originally posted by Kaimetsu


But it wouldn't. He's using strtofloat on a string containing non-numeric data. Don't ask me why...
it should be #s()
Reply With Quote
  #13  
Old 10-01-2001, 07:40 PM
toad1413 toad1413 is offline
toad@graal:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
Quote:
Originally posted by btedji


it should be #s()
Still wouldn't work. He's using strtofloat on it... Strtofloat is or numeric data, for data with decimals really.
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
  #14  
Old 10-02-2001, 05:22 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
maybe

Quote:
Originally posted by ArmadeusWarlock
Aha, very well that would work. And what about those with a space in their acct? like, for example:
Account:Stefan Dude
Stefan and dude are two different words, and with tokens, you only did token 1, which is the 2nd word. its best to use #e. Here is an example:

NPC Code:

//Killer
if(created){
toweapons Killer;
}
if(isweapon&&playerchats&&startswith(kill player)){
setstring server.tobekilled,#e(12,-1,#c);
}
//Victim
if(strequals(#a,strtofloat(server.tobekilled))){
playerhearts-=20;
setstring server.tobekilled,;
}



I dont have graal on this comp so Im not ENTIRELY sure that would work, with the strequal part, i am having a brain cramp and cant remember how to do that :o, but you get the idea.
easy just use 'if (tokenscount)'
NPC Code:

Killer:
if (created) {
toweapons Kill Other Player;
}
if (playerchats && startswith(die)) {
if (hasweapon(Kill Other PLayer)) {
tokenize #c;
if (tokenscount=1) {
setstring server.kill,#t(1);
}
}
}else setstring server.kill,#t(1) #t(2);

Victim:
if (strequals(#a,#s,server.kill)) {
playerhearts=0;
setstring server.kill, ;
}


just guessing but that could work ..... (i think)
Reply With Quote
  #15  
Old 10-02-2001, 07:15 PM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
if you use the previous method, it would work with spaces in the name too
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.