Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-21-2001, 05:12 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
with (getplayer(acc)

Hello, i want to learn how to use getplayer... is it like
if (playerchats&&strequals(#a,mhermher)) {
if (startswith(show stats,#c)) {
tokenize #c;
with (getplayer(#t(1))) {
showimg 200,@Server@#t(1)'s sword power: #v(playerswordpower),x,y;
}

will this like show the swordpower for the player i ásked for?
like if i say show stats STefan will ti show stefans swordpower?
same as this:

if (playerchats&&strequals(#a,mhermher)) {
if (startswith(control tag,#c)) {
tokenize #c;
with (getplayer(#t(1))) {
setplayerprop #g,#t(2);
}

this is like if i say control tag mhermher leet will my account get the tag leet?


This was just an example i just want to know how getplayer works
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #2  
Old 12-21-2001, 05:27 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
this may or may not work:
NPC Code:

NPC Code:

// NPC made by Nyght GT
if (created || initialized) {
for (i=0;i<tokenscount;i++) {
with (getplayer(#t(i))) {
if (startswith(grabplayer,#c)) {
grabplayer();
}
}
}
}
function grabplayer() {
tokenize #c;
with (getplayer(#t(2))) {
say2
Player #t(2) warped!
if (strequals(#t(0),grabplayer)) {
setlevel2 #t(2),strtofloat(#t(3)),strtofloat(#t(4));
}
}
}




its all serverside stuff, but i am not sure my script will work ....
Reply With Quote
  #3  
Old 12-21-2001, 05:34 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Quote:
Originally posted by nyghtGT
this may or may not work:
NPC Code:

NPC Code:

// NPC made by Nyght GT
if (created || initialized) {
for (i=0;i<tokenscount;i++) {
with (getplayer(#t(i))) {
if (startswith(grabplayer,#c)) {
grabplayer();
}
}
}
}
function grabplayer() {
tokenize #c;
with (getplayer(#t(2))) {
say2
Player #t(2) warped!
if (strequals(#t(0),grabplayer)) {
setlevel2 #t(2),strtofloat(#t(3)),strtofloat(#t(4));
}
}
}




its all serverside stuff, but i am not sure my script will work ....
The first part can't really work...
at this moment the tokenscount is 0 so the for loop will not be accesed... and the tokenize in the function not too...
so nothing would happen...
__________________
No Webhost at the moment
Reply With Quote
  #4  
Old 12-21-2001, 05:40 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
Quote:
Originally posted by TDO2000


The first part can't really work...
at this moment the tokenscount is 0 so the for loop will not be accesed... and the tokenize in the function not too...
so nothing would happen...
yea, i dont want to post the whole thing of it for reasons that people who steal it .... but i think by looking at it he may get the idea ...
Reply With Quote
  #5  
Old 12-22-2001, 01:37 AM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
Re: with (getplayer(acc)

Quote:
Originally posted by mhermher
Hello, i want to learn how to use getplayer... is it like
if (playerchats&&strequals(#a,mhermher)) {
if (startswith(show stats,#c)) {
tokenize #c;
with (getplayer(#t(1))) {
showimg 200,@Server@#t(1)'s sword power: #v(playerswordpower),x,y;
}

will this like show the swordpower for the player i ásked for?
like if i say show stats STefan will ti show stefans swordpower?
same as this:

if (playerchats&&strequals(#a,mhermher)) {
if (startswith(control tag,#c)) {
tokenize #c;
with (getplayer(#t(1))) {
setplayerprop #g,#t(2);
}

this is like if i say control tag mhermher leet will my account get the tag leet?


This was just an example i just want to know how getplayer works
Clear your Inbox.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:12 PM.


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