SA-MP Forums Archive
using variables as playerid? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: using variables as playerid? (/showthread.php?tid=533006)



using variables as playerid? - PMH - 21.08.2014

for examply i have variable at top of script:

new retard;


now can i use the value of that variable in this:

SetPlayerArmour(retard, 100); instead of SetPlayerArmour(playerid, 100);


Re: using variables as playerid? - [XST]O_x - 21.08.2014

pawn Код:
new retard;
public OnPlayerSpawn(playerid)
{
    retard = playerid;
    SetPlayerArmour(retard, 100);
    return 1;
}



Re: using variables as playerid? - PMH - 21.08.2014

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
pawn Код:
new retard;
public OnPlayerSpawn(playerid)
{
    retard = playerid;
    SetPlayerArmour(retard, 100);
    return 1;
}
will check it, if it works then i'll +rep ya :P


Re: using variables as playerid? - Rabea - 21.08.2014

You can use
Код:
Public OnPlayerSpawn(playerid)
{
    SetPlayerArmor(playerid, 100)
    return 1;
}
What is retard for lol?


Re: using variables as playerid? - [XST]O_x - 22.08.2014

Quote:
Originally Posted by PMH
Посмотреть сообщение
will check it, if it works then i'll +rep ya :P
It works. I guarantee. It's the most useless piece of code ever written, however.


Re: using variables as playerid? - PMH - 25.08.2014

i put retard as variable just for fun, but this is still not working for me. don't know if this is the exact problem in my script or something else


Re: using variables as playerid? - Stanford - 25.08.2014

You might have "retard" as a global variable defined in your script. search for "new retard" in your script.


Re: using variables as playerid? - IceCube! - 25.08.2014

Why would you want to do that, unless your forwarding information past a function which isn't capable of holding that information.