SA-MP Forums Archive
Need Help with SetPlayerPos . - 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: Need Help with SetPlayerPos . (/showthread.php?tid=313631)



Need Help with SetPlayerPos . - Rokenzio - 26.01.2012

SetPlayerPos(playerid, PlayerInfo[pLast_x], PlayerInfo[pLasty], PlayerInfo[pLast_z]);

Y u no work ლ(ಠ益ಠლ


Re: Need Help with SetPlayerPos . - Universal - 26.01.2012

Lol. Its should be:
pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][pLast_x], PlayerInfo[playerid][pLasty], PlayerInfo[playerid][pLast_z]);



Re: Need Help with SetPlayerPos . - Rokenzio - 26.01.2012

but it's almost the same with my code.


Re: Need Help with SetPlayerPos . - Universal - 26.01.2012

No its not. You forgot to add the "[playerid]" before the enum variable (or how its called lol).


Re: Need Help with SetPlayerPos . - Rokenzio - 26.01.2012

but (playerid) is already written almost infront of the code, y do i have to repeat it always?


Re: Need Help with SetPlayerPos . - Universal - 26.01.2012

The playerid is one of the functions parameters, playerid is basically the ID of the player who will be affected by the function.


Re: Need Help with SetPlayerPos . - Rokenzio - 26.01.2012

ok, i fikset it, but hou i now my playerid and give my wepons huh?


Re: Need Help with SetPlayerPos . - Universal - 26.01.2012

Theres a wiki full of functions. There also are plenty of tutorials. But:
pawn Код:
GivePlayerWeapon(playerid, weapon, ammo); // playerid - its the ID of who will receive it



Re: Need Help with SetPlayerPos . - MP2 - 26.01.2012

Quote:
Originally Posted by Universal
Посмотреть сообщение
The playerid is one of the functions parameters, playerid is basically the ID of the player who will be affected by the function.
First of all it's not a function, it's an array. Secondly, it's a dimension (?), not a parameter.


Quote:
Originally Posted by Rokenzio
Посмотреть сообщение
but (playerid) is already written almost infront of the code, y do i have to repeat it always?
Because how else is the script meant to know what player to do what to/for? It can't read your mind.

"Computers only do what they are programmed to do."


Re: Need Help with SetPlayerPos . - Universal - 26.01.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
First of all it's not a function, it's an array. Secondly, it's a dimension (?), not a parameter.



Because how else is the script meant to know what player to do what to/for? It can't read your mind.

"Computers only do what they are programmed to do."
Yes, thats almost what I meant just couldnt find the right words to explain that lol.