offline prison errors
#1

When i use
PHP код:
/prisonaccount  /logwarn  /ojail 
Mean the offline prison system , When i use this cmd on a offline player. the account deletes auto . And also those cmd takes the loop of
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
successSendClientMessageEx
How to fix this problem

When i use cmds this line shows on the Rcon
PHP код:
[DEBUGCSFBanned
There is the cmds from the script :
PHP код:
CMD:prisonaccount(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 3)
    {
        new 
string[128], name[MAX_PLAYER_NAME], minutesreason[64];
        if(
sscanf(params"s[24]ds[64]"nameminutesreason)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /prisonaccount [playername] [time (minutes)] [reason]");
        new 
giveplayerid ReturnUser(name);
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
            {
                
SendClientMessageEx(playeridCOLOR_WHITE"You can't perform this action on an equal or higher level administrator.");
                return 
1;
            }
            
SetPlayerArmedWeapon(giveplayerid0);
            if(
GetPVarInt(giveplayerid"IsInArena") >= 0)
            {
                
LeavePaintballArena(giveplayeridGetPVarInt(giveplayerid"IsInArena"));
            }
            
GameTextForPlayer(giveplayerid"~w~Welcome to ~n~~r~You Fucked Up Land"50003);
            new 
yearmonth,day;
            
ResetPlayerWeaponsEx(giveplayerid);
            
getdate(yearmonthday);
            
format(stringsizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s(%d-%d-%d)"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reasonmonthdayyear);
            
Log("logs/admin.log"string);
            
SendClientMessage(playeridCOLOR_WHITE"The player is online and has been prisoned!");
            
format(stringsizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
            
SendClientMessageToAllEx(COLOR_LIGHTREDstring);
            
WantedPoints[giveplayerid] = 0;
            
PlayerInfo[giveplayerid][pWantedLevel] = 0;
            
SetPlayerWantedLevel(giveplayerid0);
            
PlayerInfo[giveplayerid][pJailed] = 4;
            
PlayerInfo[giveplayerid][pJailTime] = minutes*60;
            
format(PlayerInfo[giveplayerid][pPrisonReason], 128"[OOC][PRISON] %s"reason);
            
format(PlayerInfo[giveplayerid][pPrisonedBy], MAX_PLAYER_NAME"%s"GetPlayerNameEx(playerid));
            
PhoneOnline[giveplayerid] = 1;
            
TogglePlayerControllable(giveplayerid0);
            
GameTextForPlayer(giveplayerid"Objects loading..."40005);
            
SetPVarInt(giveplayerid"LoadingObjects"1);
            
SetTimerEx("SafeLoadObjects"40000"d"giveplayerid);
            
SetPlayerInterior(giveplayerid1);
            
PlayerInfo[giveplayerid][pInt] = 1;
            new 
rand random(sizeof(OOCPrisonSpawns));
            
Streamer_UpdateEx(giveplayeridOOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
            
SetPlayerPos(giveplayeridOOCPrisonSpawns[rand][0], OOCPrisonSpawns[rand][1], OOCPrisonSpawns[rand][2]);
            
SetPlayerSkin(giveplayerid50);
            
SetPlayerColor(giveplayeridTEAM_APRISON_COLOR);
        }
        else if(
doesAccountExist(name))
        {
            
OnPlayerOfflineLogin(name);
            if( 
PlayerInfo[MAX_PLAYERS][pPermaBanned] == 3)
            {
                
SendClientMessageExplayeridCOLOR_WHITE"That player is Permanently banned." );
                return 
1;
            }
            else
            {
                
PlayerInfo[MAX_PLAYERS][pJailTime] = minutes*60;
                
PlayerInfo[MAX_PLAYERS][pJailed] = 1000;
                
format(PlayerInfo[MAX_PLAYERS][pPrisonReason], 64"[OOC][PRISONACC] %s"reason);
                
format(PlayerInfo[MAX_PLAYERS][pPrisonedBy], 24"%s"GetPlayerNameEx(playerid));
                
OnPlayerOfflineSave(name);
                new 
yearmonth,day;
                
getdate(yearmonthday);
                
format(stringsizeof(string), "AdmCmd: %s was offline prisoned by %s, reason: %s (%d-%d-%d)"nameGetPlayerNameEx(playerid), reasonmonth,day,year);
                
Log("logs/admin.log"string);
                
format(string128"AdmCmd: %s was offline prisoned by %s, reason: %s"nameGetPlayerNameEx(playerid), reason);
                
ABroadCast(COLOR_LIGHTRED,string,2);
            }
        }
        else
        {
            
SendClientMessageExplayeridCOLOR_WHITE"That account doesn't exist." );
        }
    }
    return 
1;
}
CMD:logwarn(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 3)
    {
        
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command!");
        return 
1;
    }
    new 
string[158], name[MAX_PLAYER_NAME];
    if(
sscanf(params"s[24]"name)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /logwarn [name]");
    new 
giveplayerid ReturnUser(name);
    if(
giveplayerid != INVALID_PLAYER_ID)
    {
        
SendClientMessageEx(playeridCOLOR_GRAD2"That player is online, use /jail for online players.");
        return 
1;
    }
    if(
doesAccountExist(name))
    {
        
OnPlayerOfflineLogin(name);
        if( 
PlayerInfo[MAX_PLAYERS][pPermaBanned] == )
        {
            
SendClientMessageExplayeridCOLOR_WHITE"That player is already permabanned!" );
            return 
1;
        }
        
/*if( PlayerInfo[MAX_PLAYERS][pBanned] > 0 )
        {
            SendClientMessageEx( playerid, COLOR_WHITE, "That player is already banned!" );
            return 1;
        }*/
        
if( PlayerInfo[MAX_PLAYERS][pAdmin] >= )
        {
            
SendClientMessageExplayeridCOLOR_WHITE"You can not log warn admin accounts!" );
            return 
1;
        }
        
PlayerInfo[MAX_PLAYERS][pLWarns] += 1;
        if(
PlayerInfo[MAX_PLAYERS][pLWarns] == 1)
        {
            new 
yearmonth,day;
            
getdate(yearmonthday);
            
format(stringsizeof(string), "AdmCmd: %s (IP:%s) was offline prisoned by %s (1st Offence), reason: Logging to avoid (%d-%d-%d)"namePlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid),month,day,year);
            
Log("logs/admin.log"string);
            
format(stringsizeof(string), "AdmCmd: %s was offline prisoned by %s (1st Offence), reason: Logging to avoid"nameGetPlayerNameEx(playerid));
            
ABroadCast(COLOR_LIGHTRED,string,2);
            
PlayerInfo[MAX_PLAYERS][pJailTime] = 30*60;
            
PlayerInfo[MAX_PLAYERS][pJailed] = 1000;
            
format(PlayerInfo[MAX_PLAYERS][pPrisonReason], 64"[OOC][PRISONACC] Logging to Avoid");
            
format(PlayerInfo[MAX_PLAYERS][pPrisonedBy], 24"%s"GetPlayerNameEx(playerid));
            
OnPlayerOfflineSave(name);
            return 
1;
        }
        else if(
PlayerInfo[MAX_PLAYERS][pLWarns] == 2)
        {
            new 
yearmonth,day;
            
getdate(yearmonthday);
            
format(stringsizeof(string), "AdmCmd: %s (IP:%s) was offline prisoned by %s (2nd Offence), reason: Logging to avoid (%d-%d-%d)"namePlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid),month,day,year);
            
Log("logs/admin.log"string);
            
format(stringsizeof(string), "AdmCmd: %s was offline prisoned by %s (2nd Offence), reason: Logging to avoid"nameGetPlayerNameEx(playerid));
            
ABroadCast(COLOR_LIGHTRED,string,2);
            
PlayerInfo[MAX_PLAYERS][pJailTime] = 60*60;
            
PlayerInfo[MAX_PLAYERS][pJailed] = 1000;
            
format(PlayerInfo[MAX_PLAYERS][pPrisonReason], 64"[OOC][PRISONACC] Logging to Avoid");
            
format(PlayerInfo[MAX_PLAYERS][pPrisonedBy], 24"%s"GetPlayerNameEx(playerid));
            
OnPlayerOfflineSave(name);
            return 
1;
        }
        else if(
PlayerInfo[MAX_PLAYERS][pLWarns] == 3)
        {
            new 
yearmonth,day;
            
getdate(yearmonthday);
            
format(stringsizeof(string), "AdmCmd: %s (IP:%s) was offline prisoned & fined by %s (3rd Offence), reason: Logging to avoid (%d-%d-%d)"namePlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid),month,day,year);
            
Log("logs/admin.log"string);
            
format(stringsizeof(string), "AdmCmd: %s was offline prisoned & fined by %s (3rd Offence), reason: Logging to avoid"nameGetPlayerNameEx(playerid));
            
ABroadCast(COLOR_LIGHTRED,string,2);
            
PlayerInfo[MAX_PLAYERS][pJailTime] = 90*60;
            
PlayerInfo[MAX_PLAYERS][pJailed] = 1000;
            
PlayerInfo[MAX_PLAYERS][pCash] -= 50000;
            
format(PlayerInfo[MAX_PLAYERS][pPrisonReason], 64"[OOC][PRISONACC] Logging to Avoid");
            
format(PlayerInfo[MAX_PLAYERS][pPrisonedBy], 24"%s"GetPlayerNameEx(playerid));
            
OnPlayerOfflineSave(name);
            return 
1;
        }
        else if(
PlayerInfo[MAX_PLAYERS][pLWarns] >= 3)
        {
            new 
yearmonth,day;
            
getdate(yearmonthday);
            
format(stringsizeof(string), "AdmCmd: %s (IP:%s) was offline prisoned & fined by %s (%dth Offence), reason: Logging to avoid (%d-%d-%d)"namePlayerInfo[MAX_PLAYERS][pIP], GetPlayerNameEx(playerid), PlayerInfo[MAX_PLAYERS][pLWarns], month,day,year);
            
Log("logs/admin.log"string);
            
format(stringsizeof(string), "AdmCmd: %s was offline prisoned & fined by %s (%dth Offence), reason: Logging to avoid"nameGetPlayerNameEx(playerid), PlayerInfo[MAX_PLAYERS][pLWarns]);
            
ABroadCast(COLOR_LIGHTRED,string,2);
            
PlayerInfo[MAX_PLAYERS][pJailTime] = 120*60;
            
PlayerInfo[MAX_PLAYERS][pJailed] = 1000;
            
PlayerInfo[MAX_PLAYERS][pCash] -= 150000;
            
format(PlayerInfo[MAX_PLAYERS][pPrisonReason], 64"[OOC][PRISONACC] Logging to Avoid");
            
format(PlayerInfo[MAX_PLAYERS][pPrisonedBy], 24"%s"GetPlayerNameEx(playerid));
            
OnPlayerOfflineSave(name);
            return 
1;
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)