/oprison help
#8

pawn Код:
CMD:oprison(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");

    new playerb[128], time, reason[120];
    if(sscanf(params, "s[128]is[120]", playerb, time, reason)) SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /oprison [playername] [time] [reason]");
    else if(RPIDFN(playerb) != INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_GREY, "Player is connected to the server, use /prison instead.");
    else{
        new file[35];
        format(file, sizeof(file), "users/%s.ini", playerb);
        if(!dini_Exists(file)) SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
        else if(dUserINT(playerb).("Admin") > PlayerInfo[playerid][pAdmin]) SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you.");
        else{
            new string[128];
            format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", playerb, RPN(playerid), reason);
            SendClientMessageToAll(COLOR_LIGHTRED, string);
            // Prisoning
            new File:Jail;
            Jail = fopen(file,io_append);
            dUserSetINT(playerb).("pPrison",1);
            // Prisonreason
            dUserSetINT(playerb).("pPrisonReason", reason);
            dUserSetINT(playerb).("pPrisonBy", RPNU(playerid));
            dUserSetINT(playerb).("pPrisonTime", time);
            fclose(Jail);
        }
    }
    return 1;
}
What about this?
Reply


Messages In This Thread
/oprison help - by lulo356 - 25.03.2014, 21:12
Re: /oprison help - by Jefff - 26.03.2014, 02:49
Re: /oprison help - by lulo356 - 26.03.2014, 08:19
Re: /oprison help - by Hanuman - 26.03.2014, 08:32
Re: /oprison help - by lulo356 - 26.03.2014, 08:44
Re: /oprison help - by Hanuman - 26.03.2014, 09:18
Re: /oprison help - by lulo356 - 26.03.2014, 09:24
Re: /oprison help - by Hanuman - 26.03.2014, 09:26
Re: /oprison help - by lulo356 - 26.03.2014, 09:39
Re: /oprison help - by Hanuman - 26.03.2014, 09:50

Forum Jump:


Users browsing this thread: 1 Guest(s)