server crash
#1

Код:
[14:19:24] RCON (In-Game): Player [Eclipse27] sent command: changemode xMA7
[14:19:36] Houses: 70
[14:19:36] Event Loaded
[14:19:36] Bussines: 8
[14:19:36] SBiz: 27
[14:19:36] Stuff Loaded
[14:19:36] Charity Loaded
[14:19:36] Turf: 24
[14:19:36] Papers: 10
[14:19:36] Dynamic Factions: 14
[14:19:36] Cars: 28
[14:19:36] Stock Loaded
[14:19:36] 1361 - Objects.
[14:19:36] 65 - Pickups.
[14:19:36] OnGameModeInit Loaded
[14:19:36] Script loaded - SA-MP RPG v1.4
[14:19:36] Number of vehicle models: 74
[14:19:40] Eclipse27 has logged in with IP 5.15.51.80.
[14:19:40] [death] Eclipse27 died 255
[14:21:04] [debug] Server crashed while executing xMA7.amx
[14:21:04] [debug] AMX backtrace:
[14:21:04] [debug] #0 native SendClientMessageToAll () [080d9da0] from samp03svr
[14:21:04] [debug] #1 001ffb10 in public cmd_dmwinner (0x00000000, 0x00a10244) from xMA7.amx
[14:21:04] [debug] #2 native CallLocalFunction () [080dfac0] from samp03svr
[14:21:04] [debug] #3 00008f30 in public OnPlayerCommandText (0x00000000, 0x00a1020c) from xMA7.amx
[14:21:04] [debug] Native backtrace:
[14:21:04] [debug] #0 b65b809b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[14:21:04] [debug] #1 b65b32d2 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[14:21:04] [debug] #2 b65b3ebc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[14:21:04] [debug] #3 b65b4366 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[14:21:04] [debug] #4 b65b7cec in ?? () from plugins/crashdetect.so
[14:21:04] [debug] #5 b77d7600 in ?? ()
[14:21:04] [debug] #6 b7559a66 in ?? () from /lib/libc.so.6
[14:21:04] [debug] #7 b752423f in _IO_vfprintf () from /lib/libc.so.6
[14:21:04] [debug] #8 b75436cc in vsprintf () from /lib/libc.so.6
[14:21:04] [debug] #9 080add67 in ?? () from ./samp03svr
[14:21:04] [debug] #10 080d9e51 in ?? () from ./samp03svr
[14:21:04] [debug] #11 080950e4 in ?? () from ./samp03svr
[14:21:04] [debug] #12 b65b0b9c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[14:21:04] [debug] #13 b65b6d38 in ?? () from plugins/crashdetect.so
[14:21:04] [debug] #14 b65bd1f8 in amx_Exec () from plugins/crashdetect.so
[14:21:04] [debug] #15 b65b3218 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[14:21:04] [debug] #16 b65b6aa9 in ?? () from plugins/crashdetect.so
[14:21:04] [debug] #17 080dfd62 in ?? () from ./samp03svr
[14:21:04] [debug] #18 080950e4 in ?? () from ./samp03svr
[14:21:04] [debug] #19 b65b0b9c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[14:21:04] [debug] #20 b65b6d38 in ?? () from plugins/crashdetect.so
[14:21:04] [debug] #21 b65bd1f8 in amx_Exec () from plugins/crashdetect.so
[14:21:04] [debug] #22 b65b3218 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[14:21:04] [debug] #23 b65b6aa9 in ?? () from plugins/crashdetect.so
[14:21:04] [debug] #24 080a5632 in ?? () from ./samp03svr
[14:21:04] [debug] #25 080b1751 in ?? () from ./samp03svr
[14:21:04] [debug] #26 08071d38 in ?? () from ./samp03svr
[14:21:04] [debug] #27 08071e32 in ?? () from ./samp03svr
[14:21:04] [debug] #28 0807bc50 in ?? () from ./samp03svr
[14:21:04] [debug] #29 080aed3d in ?? () from ./samp03svr
[14:21:04] [debug] #30 080aef02 in ?? () from ./samp03svr
[14:21:04] [debug] #31 080aa13a in ?? () from ./samp03svr
[14:21:04] [debug] #32 b74f6d36 in __libc_start_main () from /lib/libc.so.6
[14:21:04] [debug] #33 0804b4e1 in ?? () from ./samp03svr
PHP код:
CMD:joindm(playerid,params[]) 

    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playerid,COLOR_LIGHTRED"Logheazate mai intai"); 
    if(
IsPlayerConnected(playerid)) 
    { 
        if(
EventInfo[eStatus] != 1) return SendClientMessage(playerid,-1,"Nu este nici un event pornit"); 
        if(
EventInfo[eStatus] == 1
        { 
            if(
PlayerInfo[playerid][pJailed] > 0
            { 
                
SendClientMessage(playerid,-1,"Nu poti participa la event cat timp esti in puscarie."); 
                return 
0
            } 
            new 
Random random(sizeof(RandomSpawns)),str[120];  
            
SetPlayerPos(playeridRandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);  
            
SetPlayerFacingAngle(playeridRandomSpawns[Random][3]);   
            
TogglePlayerControllable(playerid,0); 
            
PlayerInfo[playerid][pEvent] = 1
            
GivePlayerWeaponEx(playerid,30,100); 
            
SetPlayerInterior(playerid,1); 
            
SetPlayerHealthEx(playerid,100); 
            
format(str,sizeof(str),"UPDATE `users` SET `partevent` ='1' WHERE `name` ='%s'",GetName(playerid)); 
            
mysql_query(SQL,str); 
        } 
         
    } 
    return 
1

when i used this cmd the server crashed
Reply
#2

anyone ?
Reply
#3

bump
Reply
#4

someone ?
Reply
#5

shows the command "dmwinner"
Reply
#6

PHP код:
CMD:dmwinner(playerid,params[])  
{  
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playerid,COLOR_LIGHTRED"Logheazate mai intai");  
    if(
IsPlayerConnected(playerid))  
    {      
        new 
winnerstring[120],string2[120];  
        if(
PlayerInfo[playerid][pAdmin] >= 3)  
        {  
            if(
sscanf(params"u",winner)) return SendClientMessage(playerid0xFFFFFFFF"{B8DBFF}Syntax: /dmwinner <winner> ");  
            if(
EventInfo[eStatus] !=) return SendClientMessage(playerid,-1,"Eventul nu este in desfasurare");  
            if(
PlayerInfo[winner][pEvent] != 1) return SendClientMessage(playerid,-1,"Playerul nu a participat in event");  
            if(
IsPlayerConnected(winner))  
            {  
                if(
winner != INVALID_PLAYER_ID)  
                {  
                    
SendClientMessageToAll(COLOR_GREEN,"%s a castigat eventul DM si a primit premiul de %s",GetName(winner),EventInfo[ePrize]);  
                    
GivePlayerCash(winnerEventInfo[ePrize]);  
                    
EventInfo[ePrize] = 0;  
                    
EventInfo[eStatus] =0;  
                    
format(string,sizeof(string),"UPDATE `event` SET `prize` ='0'");  
                    
mysql_query(SQL,string);  
                    
format(string2,sizeof(string2),"UPDATE `event` SET `status` ='0'");      
                    
mysql_query(SQL,string2);  
                }  
            }  
            else  
            {  
                
SendClientMessage(playerid,COLOR_GRAD6,"Playernul nu este connectat");  
            }  
              
        }  
    }  
    return 
1;  

Reply
#7

The wiki clearly states that your problem is the specifiers:
Quote:

Avoid using format specifiers in your messages without formatting the string that is sent. It will result in crashes otherwise.

Format the text first and then send it. It also should have given you a warning for wrong arguments.
Reply
#8

so could you tell me where exactly did i do wrong ?
Reply
#9

On this line (in /dmwinner):
pawn Код:
SendClientMessageToAll(COLOR_GREEN,"%s a castigat eventul DM si a primit premiul de %s",GetName(winner),EventInfo[ePrize]);
You need to format it and send it:
pawn Код:
new str_msg[128];
format(str_msg, sizeof str_msg, "%s a castigat eventul DM si a primit premiul de %s", GetName(winner), EventInfo[ePrize]);
SendClientMessageToAll(COLOR_GREEN, str_msg);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)