Help in roadblock - 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)
+--- Thread: Help in roadblock (
/showthread.php?tid=579519)
Help in roadblock -
Dawood - 27.06.2015
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
Respuesta: Help in roadblock -
[DOG]irinel1996 - 27.06.2015
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.
Re: Help in roadblock -
Dawood - 27.06.2015
Well i Need to Remove That RoadBlockDeployed ?
Respuesta: Help in roadblock -
[DOG]irinel1996 - 27.06.2015
In short words... yes.