29.09.2018, 19:19
Quote:
// --- Pay Attention fixed if(Roadblocks[playerid][sCreated] == 1)
|
please dont post if you dont know whats the real matter okay.
PHP код:
CMD:rrb(playerid, params[])
{
if(gTeam[playerid] != TEAM_COP && Player[playerid][AccountLevel] < 5) return SCM(playerid, COLOR_LIGHTRED, "* You must be a law enforcement officer to remove a roadblock.");
if (Player[playerid][AccountLevel] < 5) return 0;
if(Player[playerid][Jailed] == 1) return SCM(playerid, COLOR_LIGHTRED, "* You can't use this command while jailed.");
SendNearbyMessage(playerid, 30.0, COLOR_BBLUE, "* %s has picked up a roadblock object.", ReturnName(playerid, 0));
new string[100];
format(string,sizeof(string),"* [DISPATCHER]: %s has picked up a roadblock.", ReturnName(playerid, 0));
SendMessageToCops(string);
new countrb=0;
for(new i = 0; i < sizeof(Roadblocks); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
{
if(Roadblocks[i][sCreated] == 1)
{
Roadblocks[i][sCreated] = 0;
Roadblocks[i][sX] = 0.0;
Roadblocks[i][sY] = 0.0;
Roadblocks[i][sZ] = 0.0;
DestroyDynamicObject(Roadblocks[i][sObject]);
countrb++;
}
}
}
if(countrb>0)
{
SCM(playerid, COLOR_LIGHTRED, "* You are not near a roadblock.");
}
return 1;
}