Using variables in 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Using variables in SetPlayerPos (
/showthread.php?tid=70548)
Using variables in SetPlayerPos -
Bolletje - 25.03.2009
Hey,
I started 2 days ago with PAWN and I have a question about the SetPlayerPos-command.
I'm making a !gotoloc-script which reads locations from some .ini-files. But if I want to import them into the SetPlayerPos-command using variables, then I got errors like "error 035: argument type mismatch (argument 2)".
Here is an example of the command I use in my !gotoloc-script:
Код:
SetPlayerPos(playerid,resultX,resultY,resultZ);
Can I use variables in the SetPlayerPos-command and if that's possible, how?
It will be nice if someone could tell me the answer, thank you.
Re: Using variables in SetPlayerPos -
Rks25 - 25.03.2009
Are resultX, Y and Z defined as floats?
Re: Using variables in SetPlayerPos -
Bolletje - 25.03.2009
You mean like creating the strings like this?:
Код:
new Float:resultX[50], Float:resultY[50], Float:resultZ[50];
Re: Using variables in SetPlayerPos -
Rks25 - 25.03.2009
Yes, check in rp scripts how their spawn after login works. Same feature.
Re: Using variables in SetPlayerPos -
Bolletje - 25.03.2009
Ok thank you. The script returns now the right co-ordinates from the .ini's. When I use the variables in SetPlayerPos, you will be spawned on another location. I don't know the solution for that at the moment, but I'll take a look tomorrow and if I've found the solution, I'll post it in here.