AttachObjectToPlayer Problem - I really need help! :(
#1

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!
Reply


Messages In This Thread
AttachObjectToPlayer Problem - I really need help! :( - by stieben - 05.02.2009, 17:31
Re: How To Make This Work For All Players? - by pspleo - 05.02.2009, 17:38
Re: How To Make This Work For All Players? - by stieben - 05.02.2009, 18:07
Re: How To Make This Work For All Players? - by stieben - 06.02.2009, 14:40
Re: How To Make This Work For All Players? - by stieben - 06.02.2009, 15:16

Forum Jump:


Users browsing this thread: 1 Guest(s)