Using variables in SetPlayerPos
#1

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.
Reply
#2

Are resultX, Y and Z defined as floats?
Reply
#3

You mean like creating the strings like this?:

Код:
new Float:resultX[50], Float:resultY[50], Float:resultZ[50];
Reply
#4

Yes, check in rp scripts how their spawn after login works. Same feature.
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)