server crashes after cmd
#1

hi, my server crashes after this command
pawn Code:
CMD:sms( playerid, params[ ] )
    {
        if( zInfo[ playerid ][ mutelaikas ] > 0 ) return ErorMSG( playerid, "Jūs esate uћtildytas" );
        if( !zInfo[ playerid ][ turitel ] ) return ErorMSG( playerid, "Jūs neturite telefono" );
        if( zInfo[ playerid ][ telstat ] == 0 ) return ErorMSG( playerid, "Jūsų telefonas yra iљjungtas" );
        if( zInfo[ playerid ][ psaskaita ] < 1 ) return ErorMSG( playerid, "Jums neuћtenka sąskaitos" );

        new id,
            tekstas,
            _str[ 128 ],
            vardas[ MAX_PLAYER_NAME ],
            vardas2[ MAX_PLAYER_NAME ];

        if( sscanf( params, "us[128]", id, tekstas ) ) return ErorMSG( playerid, "Siūsti sms ћinute: {FF0000}/sms [Vardas_Pavarde] [Tekstas]" );
        GetPlayerName( playerid, vardas, MAX_PLAYER_NAME );
        GetPlayerName( id, vardas2, MAX_PLAYER_NAME );
        if( !IsPlayerConnected( id ) ) return ErorMSG( playerid, "Tokio ћaidėjo nėra" );
        if( zInfo[ id ][ telstat ] == 0 ) return ErorMSG( playerid, "Ћaidėjo telefonas iљjungtas" );
        if( id == playerid ) return ErorMSG( playerid, "Sau ћinutės siūsti negalite" );
        else
        {
            format( _str, sizeof ( _str ), "{00FF00}SMS {FF0000}%s {FFFFFF}: %s", vardas2, params );
            SendClientMessage( playerid, -1, _str );
            zInfo[ playerid ][ issiustos ] += 1;
            zInfo[ playerid ][ psaskaita ] -= 1;
            format( _str, sizeof ( _str ), "{00FF00}SMS {FF0000}%s {FFFFFF}: %s", vardas, params );
            SendClientMessage( id, -1, _str );
            PlayerPlaySound( id, 1057, 0.0, 0.0, 0.0 );
            zInfo[ id ][ gautos ] += 1;
        }
        return true;
    }
Reply
#2

Load crashdetect plugin: https://github.com/Zeex/samp-plugin-...ases/tag/v4.13
Use debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

Re-compile your scripts, start the server and execute that command. After a server crash, post the server log.
Reply
#3

here it is:
Quote:

[21:17:17] [debug] Server crashed while executing gm.amx
[21:17:17] [debug] AMX backtrace:
[21:17:17] [debug] #0 ?? in public cmd_sms ()
[21:17:17] [debug] #1 ?? in public OnPlayerCommandText ()
[21:17:17] [debug] System backtrace:
[21:17:17] [debug] #0 001d6f41 in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[21:17:17] [debug] #1 001cd41f in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[21:17:17] [debug] #2 001cb963 in _ZN11crashdetect15SystemExceptionEPv () from plugins/crashdetect.so
[21:17:17] [debug] #3 001d63c1 in ?? () from plugins/crashdetect.so
[21:17:17] [debug] #4 007c3600 in ?? ()
[21:17:17] [debug] #5 00163776 in ?? () from plugins/streamer.so
[21:17:17] [debug] #6 001dba33 in amx_Exec () from plugins/crashdetect.so
[21:17:17] [debug] #7 001cc622 in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[21:17:17] [debug] #8 001d4699 in ?? () from plugins/crashdetect.so
[21:17:17] [debug] #9 080dc202 in ?? () from ./s7033
[21:17:17] [debug] #10 001dba33 in amx_Exec () from plugins/crashdetect.so
[21:17:17] [debug] #11 001cc622 in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[21:17:17] [debug] #12 001d4699 in ?? () from plugins/crashdetect.so
[21:17:17] [debug] #13 080a3cb2 in ?? () from ./s7033
[21:17:17] [debug] #14 080af4e1 in ?? () from ./s7033
[21:17:17] [debug] #15 08071ac8 in ?? () from ./s7033
[21:17:17] [debug] #16 08071bc2 in ?? () from ./s7033
[21:17:17] [debug] #17 0807ba20 in ?? () from ./s7033
[21:17:17] [debug] #18 080acbfd in ?? () from ./s7033
[21:17:17] [debug] #19 080acda2 in ?? () from ./s7033
[21:17:17] [debug] #20 080a81ae in ?? () from ./s7033
[21:17:17] [debug] #21 0095cc96 in __libc_start_main () from /lib/libc.so.6
[21:17:17] [debug] #22 0804b4a1 in ?? () from ./s7033

Reply
#4

Remove the command outside of public OnPlayerCommandText, if that's where it's located
Reply
#5

so where to put it then? BTW it's located in OnPlayerCommandPerformed
Reply
#6

Did you compile with debug info (-d3)?

Quote:
Originally Posted by ancezas
View Post
BTW it's located in OnPlayerCommandPerformed
How it's located in OnPlayerCommandPerformed callback? It's already a callback.
Reply
#7

yes i completed with -d3 my all cmd's are located in OnPlayerCommandPerformed callback
Reply
#8

Quote:
Originally Posted by ancezas
View Post
yes i completed with -d3 my all cmd's are located in OnPlayerCommandPerformed callback
It's not possible to use "CMD:name(playerid, params[])" in OnPlayerCommandPerformed as it wouldn't be implemented. The only ways is using strcmp but you clearly don't use it. Would you mind to post OnPlayerCommandPerformed callback so we can see what you've done?
Reply
#9

Put the command out of OnPlayerCommand

and it should work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)