RoadBlock not create
#3

He's not kidding.

pawn Код:
// At the top of your script:
#define MAX_ROADBLOCKS  20
new RoadBlock[MAX_PLAYERS][MAX_ROADBLOCKS];

// Command
CMD:roadblock(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
        if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can`t place a Roadblock when you are in a vehicle!");
        for(new i = 0; i < MAX_ROADBLOCKS; i++)
        {
            if(IsValidObject(RoadBlock[playerid][i])) continue;
            new Float:X, Float:Y, Float:Z, Float:A;
            GetPlayerPos(playerid, X, Y, Z);
            GetPlayerFacingAngle(playerid, A);
            RoadBlock[playerid][i] = CreateObject(979, X + (2.0 * floatsin(-A, degrees)), Y + (2.0 * floatcos(-A, degrees)), Z, 0.0, 0.0, A);
            GameTextForPlayer(playerid, "~w~Roadblock ~r~Placed", 5000, 5);
            return 1;
        }
        SendClientMessage(playerid, COLOR_GREY, "Roadblock limit reached. Please remove some Roadblocks first!");
    }
    return 1;
}
Although, if you use this, you'll need to alter any commands related to roadblocks. Especially your roadblock removal command.
Reply


Messages In This Thread
RoadBlock not create - by Sn4ke2 - 05.07.2015, 12:20
Re: RoadBlock not create - by Misiur - 05.07.2015, 12:28
Re: RoadBlock not create - by Threshold - 05.07.2015, 13:23

Forum Jump:


Users browsing this thread: 2 Guest(s)