Need help im lost at this hour with a simple problem i bet
#1

I am trying to mamke a barrier or roadblock of a object but when two cops spawn the same roadblock number then one deletes one it saysfor the other player when he tries to get rid of it that he has none place but he dose.
Here is the code for one of the road blocks i want it so they both can spawn roadblock 2 or waht eva number and then each delete there reaod block as needed. Thanks in advanced for the help jsut really stuck on why its not working!
Код:
if(strcmp(cmdtext, "/rb2", true)==0)
	{
	  if(RoadBlock1[playerid] == 1) return SendClientMessage(playerid, COLOR_RED,"  You alredy added one roadblock. You can't add any more!");
	 	{
			if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || IsACop(playerid))
			{
				new Float:X, Float:Y, Float:Z, Float:A;
  			GetPlayerPos(playerid, X, Y, Z);
  			GetPlayerFacingAngle(playerid, A);
  			roadblock2 = CreateObject(978, X+4, Y, Z, 0.0, 0.0, A);
  			SetPlayerPos(playerid, X, Y, Z+2);
  			RoadBlock1[playerid] += 1;
  			SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Deployed");
  			return 1;
				}
			}
		}
	if(strcmp(cmdtext, "/rbo2", true)==0)
	{
		if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || IsACop(playerid))
		{
   		if (RoadBlock1[playerid] == 0) return SendClientMessage(playerid, COLOR_RED,"  You didn't add a roadblock!");
  		DestroyObject(roadblock2);
  		RoadBlock1[playerid] -= 1;
  		SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Removed");
  		return 1;
		}
	}
Reply


Messages In This Thread
Need help im lost at this hour with a simple problem i bet - by gablery - 17.08.2009, 06:52
Re: Need help im lost at this hour with a simple problem i bet - by gablery - 17.08.2009, 17:54
Re: Need help im lost at this hour with a simple problem i bet - by wilcock33 - 17.08.2009, 19:13
Re: Need help im lost at this hour with a simple problem i bet - by gablery - 18.08.2009, 07:11
Re: Need help im lost at this hour with a simple problem i bet - by wilcock33 - 18.08.2009, 21:55

Forum Jump:


Users browsing this thread: 1 Guest(s)