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
#2

can no one help me with this?
Reply
#3

i can!

i think you should use a object streamer
Reply
#4

Ill look ito that thanks much
Reply
#5

dont mention it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)