GetObjectPOs ProBlem
#1

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
CMDbj(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!
Reply
#2

The 3 last parameters are passed by reference to store to variables the coordinates. Take a look at: https://sampwiki.blast.hk/wiki/GetObjectPos

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

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
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=353988
Reply
#5

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)
PHP Code:
new Float:xFloat:yFloat:z;
GetObjectPos(objectidxy,z)
If( 
== ... &&/|| y=...)
{
    
//Blabla

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

Thanks Alot Man
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=278463
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)