PDA

View Full Version : GetObjectPOs ProBlem


Hydery
10/05/2016, 01:47 PM
I Have Problem With my GetPlayerPOs Function
I Made My New obj;
Then I Made My obj = Create Bla Bla Bla In Game Mode
Now I have A problem Here
if(GetObjectPos(obj,1994.05859, -2227.43140, 12.76270))
I Trying To Make The Object Move
Like
CMD:obj(playerid,params[])
{
if(GetObjectPos(obj,1994.05859, -2227.43140, 12.76270))
{
//blala
}
return 1;
}
But It Says Error Agrument 2 Mismatch in if(GetObject(blala) )
HELP!

Konstantinos
10/05/2016, 01:50 PM
The 3 last parameters are passed by reference to store to variables the coordinates. Take a look at: https://wiki.sa-mp.com/wiki/GetObjectPos

And for checking float, you better check if for example x is between 1994.0 and 1995.0 etc.

Hydery
10/05/2016, 01:52 PM
How Can I Make Command To Close/Open Gate In The Same Time Then? I Trying To See If the Pos Is Here He Will Do this

Konstantinos
10/05/2016, 01:56 PM
http://forum.sa-mp.com/showthread.php?t=353988

Dayrion
10/05/2016, 01:57 PM
GetObjectPos is not defined like you did.
You have to create 3 variables x,y,z and uses those variables to store the position of the object.
GetObjectPos(objectID, x(store), y(store), z(store)
new Float:x, Float:y, Float:z;
GetObjectPos(objectid, x, y,z)
If( x == ... &&/|| y=...)
{
//Blabla
}


NB: I'm on my phone, I can't do better :$
Edit: he was more faster than me 😐

Hydery
10/05/2016, 01:59 PM
Thanks Alot Man

oktokt1
10/05/2016, 02:35 PM
http://forum.sa-mp.com/showthread.php?t=278463