Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   with (getplayer(acc) (https://forums.graalonline.com/forums/showthread.php?t=19336)

mhermher 12-21-2001 05:12 PM

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

nyghtGT 12-21-2001 05:27 PM

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 ....

TDO2000 12-21-2001 05:34 PM

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...

nyghtGT 12-21-2001 05:40 PM

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 ...

Cybnext_Design 12-22-2001 01:37 AM

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.


All times are GMT +2. The time now is 01:05 PM.

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