I have a problem with my server :)
#1

The problem is:
When I register the server open after I login ... And after I sent the text message that they are welcome and after waiting 3-4 seconds and restarts the server .. Do you know what does?
Code the player logs in:
PHP код:
public OnPlayerLogin(playerid,password[])
{
    new 
tmp2[256];
    new 
string2[64];
    new 
string[128];
    new 
playersip[24];
    new 
playername2[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayername2sizeof(playername2));
    
GetPlayerIp(playeridplayersipsizeof(playersip));
    
format(string2sizeof(string2), "users/%s.ini"playername2);
    new 
FileUserFile fopen(string2io_read);
    if ( 
UserFile )
    {
        new 
PassData[256];
        new 
keytmp[256], valtmp[256];
        
freadUserFile PassData sizeofPassData ) );
        
keytmp ini_GetKeyPassData );
        if( 
strcmpkeytmp "Key" true ) == )
        {
            
valtmp ini_GetValuePassData );
            
strmid(PlayerInfo[playerid][pKey], valtmp0strlen(valtmp)-1255);
        }
        if(
strcmp(PlayerInfo[playerid][pKey],passwordtrue ) == )
        {
              new 
key256 ] , val256 ];
            new 
Data256 ];
            while ( 
freadUserFile Data sizeofData ) ) )
            {
                
key ini_GetKeyData );
                if( 
strcmpkey "Level" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pLevel] = strvalval ); }
                if( 
strcmpkey "AdminLevel" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pAdmin] = strvalval ); }
                if( 
strcmpkey "HelperLevel" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pHelper] = strvalval ); }
                if( 
strcmpkey "Sex" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pSex] = strvalval ); }
                if( 
strcmpkey "Origin" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pOrigin] = strvalval ); }
                if( 
strcmpkey "Age" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pAge] = strvalval ); }
                if( 
strcmpkey "Model" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pModel] = strvalval ); }
                if( 
strcmpkey "Team" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pTeam] = strvalval ); }
                if( 
strcmpkey "Cash" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pCash] = strvalval ); }
                if( 
strcmpkey "SpawnLoc" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pSpawnLoc] = strvalval ); }
                if( 
strcmpkey "FMember" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pFMember] = strvalval ); }
                if( 
strcmpkey "Int" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pInt] = strvalval ); }
                if( 
strcmpkey "Local" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pLocal] = strvalval ); }
                if( 
strcmpkey "Member" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pMember] = strvalval ); }
                if( 
strcmpkey "Leader" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pLeader] = strvalval ); }
                if( 
strcmpkey "Rank" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pRank] = strvalval ); }
                if( 
strcmpkey "Char" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pChar] = strvalval ); }
                if( 
strcmpkey "Jailed" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pJailed] = strvalval ); }
                if( 
strcmpkey "JailTime" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pJailTime] = strvalval ); }
                if( 
strcmpkey "Tut" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pTut] = strvalval ); }
                if( 
strcmpkey "Origin" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pOrigin] = strvalval ); }
                if( 
strcmpkey "Muted" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pMuted] = strvalval ); }
                if( 
strcmpkey "Warns" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pWarns] = strvalval ); }
                if( 
strcmpkey "Bani" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pBani] = strvalval ); }
                if( 
strcmpkey "Acont" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pAcont] = strvalval ); }
                if( 
strcmpkey "MuteTime" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pMuteTime] = strvalval ); }
                if( 
strcmpkey "VirWorld" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pVirWorld] = strvalval ); }
                if( 
strcmpkey "WantedPoints" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pWantedPoints] = strvalval ); }
                if( 
strcmpkey "WantedDeaths" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pWantedDeaths] = strvalval ); }
                if( 
strcmpkey "PayCheck" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pPayCheck] = strvalval ); }
                if( 
strcmpkey "Locked" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pLocked] = strvalval ); }
                if( 
strcmpkey "AD" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pAD] = strvalval ); }
                if( 
strcmpkey "Mats" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pMats] = strvalval ); }
                if( 
strcmpkey "Drugs" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pDrugs] = strvalval ); }
                if( 
strcmpkey "Exp" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pExp] = strvalval ); }
                if( 
strcmpkey "AWarns" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pAWarns] = strvalval ); }
                if( 
strcmpkey "LeaderWarns" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pLeaderWarns] = strvalval ); }
                if( 
strcmpkey "FACWarns" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pFACWarns] = strvalval ); }
                if( 
strcmpkey "Carkey" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pPcarkey] = strvalval ); }
                if( 
strcmpkey "Carkey2" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pPcarkey2] = strvalval ); }
                if( 
strcmpkey "Carkey3" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pPcarkey3] = strvalval ); }
                if( 
strcmpkey "CarSkill" true ) == ) { val ini_GetValueData ); PlayerInfo[playerid][pCarSkill] = strvalval ); }
               }
               
fclose(UserFile);
        }
        else   
        {
            new 
loginstring[128];
            new 
loginname[64];
            
gPlayerLogTries[playerid] += 1;
            
GetPlayerName(playerid,loginname,sizeof(loginname));
            
format(loginstring,sizeof(loginstring),"{FFFFFF}Parola {F81414}gresita\n{FFFFFF}Te rugam sa introduci parola corecta\n{FFFFFF}Ai introdus gresit {FA0021}%d/4 {F81414}Kick {FFFFFF}!",gPlayerLogTries[playerid],loginname);
            
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"{0080FF}Login",loginstring,"Login","Exit");
            
fclose(UserFile);
            
format(loginstring256"{FFAF00}[{FFFFFF}Login{FFAF00}]{FFFFFF}: {6EF83C}%s {FFFFFF}IP{6EF83C}[{FFFFFF}%s{6EF83C}] {FFFFFF}a gresit parola la logare"loginnameplayersip);
            
ABroadCast(COLOR_YELLOW2,loginstring,1);
            if(
gPlayerLogTries[playerid] >= 1)
            {
                
format(stringsizeof(string), "{FFAF00}[{FFFFFF}Login{FFAF00}]{FFFFFF}: Daca gresesti parola de 4 ori consecutiv primesti kick. Ai gresit de {FA0021}%d/4 {FFFFFF}ori !",gPlayerLogTries[playerid]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
            }
            if(
gPlayerLogTries[playerid] == 4)
            {
                
Kick(playerid);
            }
            return 
1;
        }
        
ResetPlayerMoney(playerid);
        
ConsumingMoney[playerid] = 1;
        
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
        
CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
        if(
PlayerInfo[playerid][pLevel] == -999//autoban
        
{
            
Ban(playerid);
        }
        
SendClientMessage(playeridCOLOR_RED"=====================================================");
        
format(string2sizeof(string2), "{0049FF}[{F3FF02}ExtremHosting{0049FF}]{FFFFFF}: Bine ai venit {FFFF80}%s",playername2);
        
SendClientMessage(playeridCOLOR_WHITE,string2);
        
printf("%s has logged in.",playername2);
        
SpawnPlayer(playerid);
        if (
PlayerInfo[playerid][pAdmin] > 0)
        {
            
format(string2sizeof(string2), "{0049FF}[{F3FF02}ExtremHosting{0049FF}]{FFFFFF}: Teai connectat ca admin level {FFFF80}%d ",PlayerInfo[playerid][pAdmin]);
            
SendClientMessage(playeridCOLOR_WHITE,string2);
        }
        
SendClientMessage(playeridCOLOR_RED"=====================================================");
        if(
gTeam[playerid] == 0)
        {
            
gTeam[playerid] = 3;
        }
        else
        {
            
gTeam[playerid] = PlayerInfo[playerid][pTeam];
        }
        if(
WantedLevel[playerid] >= 1)
        {
            new 
wanted WantedLevel[playerid];
            new 
sendername[MAX_PLAYER_NAME];
            
GetPlayerName(playeridsendernamesizeof(sendername));
            if(
wanted 0)
            {
                
format(string,sizeof(string), "{0049FF}[{F3FF02}ExtremHosting{0049FF}]{FFFFFF}: Cand ai iesit sau ai luat crash aveai Wanted Level {6EF83C}%d{FFFFFF}, asa ca l`ai primit inapoi !"wanted);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                
format(string,sizeof(string), "{0049FF}[{F3FF02}ExtremHosting{0049FF}]{FFFFFF}: {6EF83C}%s {FFFFFF}a revenit pe server si are Wanted Level {6EF83C}%d {FFFFFF}!"sendernamewanted);
                
SendTeamMessage(20x00ACB2AAstring);
            }
        }
        if(
PlayerInfo[playerid][pLocked] == 1// Auto-kick
        
{
            
SendClientMessage(playeridCOLOR_LIGHTRED"{0049FF}[{F3FF02}ExtremHosting{0049FF}]{FFFFFF}: Nu ai primit unban !");
              
Kick(playerid);
        }
        if(
PlayerInfo[playerid][pSpawnLoc] == 0)
        {
            
PlayerInfo[playerid][pSpawnLoc] = 1;
        }
        
gPlayerLogged[playerid] = 1;
        
SetPlayerSpawn(playerid);
        
format(tmp2sizeof(tmp2), "~w~Welcome ~n~~y~   %s"playername2);
          
//DateProp(playerid);
        
GameTextForPlayer(playeridtmp250001);
        
SendClientMessage(playeridCOLOR_YELLOWmotd);
    }
    return 
1;

Reply


Messages In This Thread
I have a problem with my server :) - by radiobizza - 03.09.2013, 12:19
Re: I have a problem with my server :) - by JeaSon - 03.09.2013, 12:21
Re: I have a problem with my server :) - by Konstantinos - 03.09.2013, 12:25
Re: I have a problem with my server :) - by radiobizza - 03.09.2013, 12:28
Re: I have a problem with my server :) - by radiobizza - 03.09.2013, 12:42
Re: I have a problem with my server :) - by Konstantinos - 03.09.2013, 12:43
Re: I have a problem with my server :) - by radiobizza - 03.09.2013, 12:47

Forum Jump:


Users browsing this thread: 2 Guest(s)