Ajail
#5

pawn Код:
CMD:ajail(playerid, params[])
{
    if(IsPlayerAdmin(playerid) || pInfo[playerid][pAdmin] >= 1)
    {
        new time,reason[64], string[200], adminname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], target;
        GetPlayerName(target, pname, sizeof(pname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        if(sscanf(params,"dds",target,time,reason))
        return SendClientMessage(playerid, -1,"Usage:/ajail [playerid][time][reason]");
        if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Note: That ID is invalid");
        if(time <= 0) return SendClientMessage(playerid, -1,"The jail time must be over 0!");
        format(string, 200, "* %s has jailed %s for %d minutes. Reason:%s", adminname, pname, time, reason);
        SCMTA(-1, string);
    pInfo[target][pJailed] = 1;
    SetPlayerPos(target,0.0,0.0,0.0);
    SetPlayerVirtualWorld(target, 999999);
    ClearWeapons(playerid);
        TogglePlayerControllable(playerid, 1);
    }
    else
    {
        SendClientMessage(playerid, -1, "You're not authorized to do this command");
        return 1;
    }
    return 1;
}
You'll need this stock

pawn Код:
stock ClearWeapons(playerid)
{
    ResetPlayerWeapons(playerid);
    foreach(Player, i)
    {
        pInfo[playerid][pWeapons][i] = 0;
        pInfo[playerid][pAmmo][i] = 0;
        pInfo[playerid][pEquipped][i] = false;
    }
    return 1;
}
Add these to your pInfo enum.

pawn Код:
pWeapons[13],
pAmmo[13],
pJailed,
bool:pEquipped[13],
It's not tested.


On your login make sure it checks if the player is jailed. Then it'll send them back to jail.
Reply


Messages In This Thread
Ajail - by lramos15 - 03.08.2013, 02:20
Re: Ajail - by PrinceKumar - 03.08.2013, 02:37
Re: Ajail - by lramos15 - 04.08.2013, 01:31
Re: Ajail - by lramos15 - 05.08.2013, 12:09
Re: Ajail - by George_Fratelli - 05.08.2013, 14:49

Forum Jump:


Users browsing this thread: 2 Guest(s)