/oprison doesn't work
#8

Quote:
Originally Posted by KevinExec
Посмотреть сообщение
Don't get ya. Just tell me what to do.
If this is a command for sending an offline-player to jail, you will need to enter the information and then save the file by dini_close, just as ATGOggy stated in his reply.

Код:
IRP:oprison(playerid, var[])
{
    new user[32], string[128], file[32], time;
       if(!Logged(playerid)) return NoLogin(playerid);
    if(Player[playerid][pAdmin] < 3) return NoAuth(playerid);
    if(sscanf(var, "s[32]is[128]", user, time, var)) return SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /oprison [playername] [time] [reason]");
    if(RPIDFN(user) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "Player is connected to the server, use /prison instead.");
    format(file, sizeof(file), "Accounts/%s.ini", user);
    if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GRAD2, "Player name not found.");
    if(Player[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GRAD2, "Player has a higher admin level than you.");
    format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid), var);
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid) , var);
    // Prisoning
    dini_IntSet(file, "pJail", 1);
    // Prisonreason
    dini_Set(file, "pJailReason", var);
    dini_Set(file, "pJailBy", GetName(playerid));
    dini_IntSet(file, "pJailTime", time);
    dini_Close(file);
    return 1;
}
Also, you will need to update Player[][pPrison], Player[][pPrisonTime] and Player[][pPrisonReason] correctly when the player logs on.

Although, the biggest problem here is that the PrisonTimer does not update the player position, neither does your /oprison. You'll therefore have to check if player is jailed on player connect or player login and use
Код:
SetPlayerPos(playerid, x, y, z);
Reply


Messages In This Thread
/oprison doesn't work - by iKevin - 17.03.2016, 17:08
Re: /oprison doesn't work - by introzen - 17.03.2016, 17:14
Re: /oprison doesn't work - by ATGOggy - 17.03.2016, 17:19
Re: /oprison doesn't work - by iKevin - 17.03.2016, 17:22
Re: /oprison doesn't work - by ATGOggy - 17.03.2016, 17:25
Re: /oprison doesn't work - by introzen - 17.03.2016, 17:27
Re: /oprison doesn't work - by iKevin - 17.03.2016, 17:37
Re: /oprison doesn't work - by introzen - 17.03.2016, 17:51
Re: /oprison doesn't work - by iKevin - 17.03.2016, 17:56
Re: /oprison doesn't work - by introzen - 17.03.2016, 17:58

Forum Jump:


Users browsing this thread: 1 Guest(s)