Help in roadblock
#1

Hi, Guys

Can Anyone of u Please Help me On This roadblock
i have this cnd of roadblock of swat when i type /rb its just create 1 rb max i cannot create much rb how much i want it should be like this if i create 1 rb then i should able to create more like 20 30 roadblock
there is the code

Код:
CMD:rb(playerid, params[])
{
    if(GetTeam{playerid} == CLASS_SWAT)
    {
		if(RoadBlockDeployed[playerid] == 0)
		{
	    new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid, x, y, z);
		new Float:angle;
		GetPlayerFacingAngle(playerid, angle);
	    RoadBlockDeployed[playerid] = 1;
	    SendClientMessage(playerid,YELLOW, "Roadblock Placed /dallrb  for removing it!");
	    PlayerRB[playerid] = CreateObject(978, x, y, z, 0, 0, angle);
		SetPlayerPos(playerid, x, y, z+1);
	}
		else
	{
	    SendClientMessage(playerid,RED, "You can only place 1 roadblock at a time!");
	}
		return 1;
	}
	SendClientMessage(playerid,RED,"This Command only For SWAT OFFICERS");
	return 1;
}
//  /dallrb
Reply
#2

RoadBlockDeployed is the problem, you have to remove it but keep in mind that PlayerRB stores just one value (only an object ID) so if you create two or three you'll be able to remove just the last one created. So... yes, you must find another way to do that.

Use an array.
Reply
#3

Well i Need to Remove That RoadBlockDeployed ?
Reply
#4

In short words... yes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)