Roadblock
#7

I made you a little system that could help you. Here it is:

pawn Код:
#define MAX_ROADBLOCKS 20

enum Roadblocks
{
    rCreated,
    rOwner,
    rObject
}
new rInfo[MAX_ROADBLOCKS][Roadblocks];

CMD:rb(playerid, params[])
{
    if(GetPlayerTeam(playerid) != TEAM_SWAT) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    for(new i = 0;i < sizeof(rInfo); i++)
    {
        if(rInfo[i][rCreated] == 0)
        {
            rInfo[i][rCreated] = 1;
            rInfo[i][rOwner] = playerid;
            rInfo[i][rObject] = CreateObject(978, X, Y, Z, 0.0, 0.0, A);
        }
    }
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "S.W.A.T Roadblock Placed!");
    return 1;
}

CMD:rrball(playerid, params[])
{
    if(GetPlayerTeam(playerid) != TEAM_SWAT) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
    for(new i = 0; i < sizeof(rInfo); i++)
    {
        if(rInfo[i][rCreated] == 1)
        {
            if(rInfo[i][rOwner] == playerid)
            {
                DestroyObject(rInfo[i][rObject]);
            }
        }
    }
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Roadblocks removed!");
    return 1;
}
It's untested, but it should work.
Reply


Messages In This Thread
Roadblock - by NathNathii - 13.04.2013, 18:13
Re: Roadblock - by Denying - 13.04.2013, 18:37
Re: Roadblock - by NathNathii - 13.04.2013, 18:40
Re: Roadblock - by NathNathii - 13.04.2013, 18:57
Re: Roadblock - by Basssiiie - 13.04.2013, 19:13
Re: Roadblock - by NathNathii - 13.04.2013, 19:19
Re: Roadblock - by JJB562 - 13.04.2013, 20:50
Re: Roadblock - by NathNathii - 13.04.2013, 20:54
Re: Roadblock - by JJB562 - 13.04.2013, 20:57
Re: Roadblock - by NathNathii - 13.04.2013, 20:59

Forum Jump:


Users browsing this thread: 1 Guest(s)