SA-MP Forums Archive
Using operators? - 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: Using operators? (/showthread.php?tid=401682)



Using operators? - Arnoo - 23.12.2012

Hello , i've been trying to create an object and place it on the ground.
But since I use the player position it spawns in the middle of my ped.
I've tried to us an operator thing but I dont know how to use it.

I made an account specially for this since I diddnt find it on ******.
Sorry if I should have looked better.
Here is my current script.

Код:
	if(!strcmp(cmdtext, "/cbr"))
	{
		new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid, x, y, z);
        CreateObject(1425, x, y, z,   0.00, 0.00, 0.00);
        y -= 10;
       	SendClientMessage(playerid, COLOR_LIGHTRED, "Object created.");
	}
Thank you for reading this.


Re: Using operators? - Dolby - 23.12.2012

pawn Код:
if(!strcmp(cmdtext, "/cbr",false))
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateObject(1425, x, y-10.0, z,   0.00, 0.00, 0.00);
    SendClientMessage(playerid, COLOR_LIGHTRED, "Object created.");
}
Try this


Re: Using operators? - Randy More - 23.12.2012

The only ways to adjust/set a position of an existent object is when creating it, using SetObjectPos function or MoveObject function, however, the coordinates is to be changed/set within one of those functions just like the example above.


Re: Using operators? - Arnoo - 23.12.2012

God I feel retarted now.
Well atleast you helped me!
Thank you very mush!