SA-MP Forums Archive
GetObjectPOs ProBlem - 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: GetObjectPOs ProBlem (/showthread.php?tid=606866)



GetObjectPOs ProBlem - Hydery - 10.05.2016

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!


Re: GetObjectPOs ProBlem - Konstantinos - 10.05.2016

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.


Re: GetObjectPOs ProBlem - Hydery - 10.05.2016

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


Re: GetObjectPOs ProBlem - Konstantinos - 10.05.2016

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


Re: GetObjectPOs ProBlem - Dayrion - 10.05.2016

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 😐


Re: GetObjectPOs ProBlem - Hydery - 10.05.2016

Thanks Alot Man


Re: GetObjectPOs ProBlem - oktokt1 - 10.05.2016

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