SA-MP Forums Archive
AttachObjectToPlayer Problem - I really need help! :( - 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: AttachObjectToPlayer Problem - I really need help! :( (/showthread.php?tid=64589)



AttachObjectToPlayer Problem - I really need help! :( - stieben - 05.02.2009

Hello, I have this code right here:

Код:
if (strcmp(cmdtext, "/attachobjecttovehicle", true, 10) == 0)
  {
  if(IsPlayerInAnyVehicle(playerid))
  {
  new Float:pX, Float:pY, Float:pZ;
  GetPlayerPos(playerid, Float:pX, Float:pY, Float:pZ);
  new AttachableObject = CreateObject(18450, Float:pX, Float:pY, Float:pZ, 0, 0, 0);
  AttachObjectToPlayer(AttachableObject, playerid, 0.0, 0.0, -0.87, 0.0, 0.0, 90.0);
  SendClientMessage(playerid, COLOR_YELLOW, "Object Successfully Attached!");
  }
  else
  {
  SendClientMessage(playerid, COLOR_RED, "You Need To Be In A Vehicle Before Attaching An Object!");
	}
	return 1;
	}
But it works only for 1 person. So now my question: How can I make this work for all players? So if anyone types /attachobjecttovehicle (yes, it's gonna be a shorter command lol) and then another person types that in, it will work for both.

Sorry for my bad english.

Thank you!


Re: How To Make This Work For All Players? - pspleo - 05.02.2009

CreatePlayerObject instead of CreateObject


Re: How To Make This Work For All Players? - stieben - 05.02.2009

ty


Re: How To Make This Work For All Players? - stieben - 06.02.2009

it doesn't work

If I use CreatePlayerObject(blabla) then the object won't even attach and it has a different position. Also I want to make it in CreatePlayerDynamicObject(blabla) so it kinda makes me confused


Re: How To Make This Work For All Players? - stieben - 06.02.2009

please I really need this