SA-MP Forums Archive
Attaching Player Object - 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: Attaching Player Object (/showthread.php?tid=298746)



Attaching Player Object - Joshb93 - 22.11.2011

Ok, i have this at top of script

Code:
new PlayerObjects[MAX_PLAYERS};
This as a command

Code:
command(stealcrate, playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 4.0, 2790.82, -2423.52, 13.63) || IsPlayerInRangeOfPoint(playerid, 4.0, 2790.82, -2408.43, 13.63))
	{
	    new Float:posx, Float:posy, Float:posz;
	    new string[128];
	    new object = PlayerObjects[playerid];
	    GetPlayerPos(playerid, posx, posy, posz);
	    object = CreateObject(1271, posx, posy+0.6, posz+0.5, 0.0, 0.0, 0.0, 100);
	    AttachObjectToPlayer(object, playerid, posx, posy+0.6, posz+0.5, 0.0, 0.0, 0.0);
	    format(string, sizeof(string), "You have picked up a crate of ammo, please put the crate in your trunk (/dropcrate).");
	    SCM(playerid, COLOR_WHITE, string);
	    return 1;
	}
	else
	{
	    SCM(playerid, COLOR_GREY, "You are not near the crates!");
	    return 1;
	}
}
but when you type the command, it says the crate has been created, but, nothing shows up? Any help?


Re: Attaching Player Object - Joshb93 - 22.11.2011

Anyone? Please...