SA-MP Forums Archive
Need help im lost at this hour with a simple problem i bet - 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: Need help im lost at this hour with a simple problem i bet (/showthread.php?tid=91865)



Need help im lost at this hour with a simple problem i bet - gablery - 17.08.2009

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;
		}
	}



Re: Need help im lost at this hour with a simple problem i bet - gablery - 17.08.2009

can no one help me with this?


Re: Need help im lost at this hour with a simple problem i bet - wilcock33 - 17.08.2009

i can!

i think you should use a object streamer



Re: Need help im lost at this hour with a simple problem i bet - gablery - 18.08.2009

Ill look ito that thanks much


Re: Need help im lost at this hour with a simple problem i bet - wilcock33 - 18.08.2009

dont mention it