SA-MP Forums Archive
AttachObjectToVehicle BUG? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AttachObjectToVehicle BUG? (/showthread.php?tid=197005)



"AttachObjectToVehicle" bug? - [DOG]irinel1996 - 07.12.2010

Hi, if I put this into my gamemode I receive the message but the object doesn't appear... do you know anything about this bug?
Код:
   if(strcmp("/blueneon", cmdtext, true) == 0)
	{
		new neon = CreateObject(18648,0,0,0,0,0,0,100.0);
		new neon1 = CreateObject(18648,0,0,0,0,0,0,100.0);
		AttachObjectToVehicle(neon, GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
		AttachObjectToVehicle(neon1, GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
		SendClientMessage(playerid, COLOR_WHITE, "Neones Instalados!");
		return 1;
	}



Re: AttachObjectToVehicle BUG? - Rafa - 07.12.2010

this question noone knows and i post 2 topics with this questions but noone answer it and i think that code didnt work :S


Re: AttachObjectToVehicle BUG? - Rac3r - 08.12.2010

Could be the rotation. For example, the default block object from single player (with lights), if you rotate the object, the lights won't light up.
Try without a roation.

Also, what if the player types:
/neonazul /neonazul /neonazul /neonazul /neonazul /neonazul /neonazul /neonazul /neonazul /neonazul /neonazul
You should think more about protecting the other players and server limits.
Код:
new neon[MAX_PLAYERS], neon2[MAX_PLAYERS];
Код:
if(strcmp("/neonazul", cmdtext, true) == 0)
{
	if(neon[playerid])DestroyObject(neon[playerid]), neon[playerid] = 0;
	if(neon2[playerid])DestroyObject(neon2[playerid]), neon2[playerid] = 0;
	neon[playerid] = CreateObject(18648,0,0,0,0,0,0,100.0);
	neon2[playerid] = CreateObject(18648,0,0,0,0,0,0,100.0);
	AttachObjectToVehicle(neon[playerid], GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	AttachObjectToVehicle(neon2[playerid], GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	SendClientMessage(playerid, COLOR_WHITE, "Neones Instalados!");
	return 1;
}