Command closes samp-server.exe
#1

I don't really know what is the problem, but when i try to use this command samp-server.exe closes itself.

pawn Код:
CMD:invite(playerid, params[])
{
    new id;
    if(PI[playerid][Lider] == 0) return SCM(playerid, RED, " (greska) {FFFFFF}Nemate ovlastenje za koristenje ove komande !");
    if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Koristite: /invite [ID Igraca / Deo Imena]");
    if(!IsPlayerConnected(id)) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Taj igrac nije u igri !");
    if(id == playerid) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Ne mozete ovu komandu koristiti na sebi !");
    if(PI[id][Clan] != 0 || PI[id][Lider] != 0) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Taj igrac se vec nalazi u nekoj organizaciji !");
   
    if(PI[playerid][Lider] == 1)
    {
        SCMF(playerid, YELLOW, " (info) {FFFFFF}Uspesno se ubacili igraca %s u Policijsku Jedinicu !");
        SCMF(id, YELLOW, " (info) {FFFFFF}Lider %s vas je primio u Policiju Grada Los Santosa !");
       
        PI[id][Clan] = 1;
        PI[id][Rank] = 1;
       
        SetPlayerSkin(id, PD_RANK1);
        PI[id][Skin] = GetPlayerSkin(id);
        SpawnPlayer(id);
        return 1;
    }
   
    format(gQuery, sizeof(gQuery), "UPDATE `Igraci` SET `Clan` = '%d', `Skin` = '%d', `Rank` = '%d' WHERE `Ime` = '%s'", PI[id][Clan], PI[id][Skin], PI[id][Rank], ImeIgraca(id));
    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "i", THREAD_OSTALO);
    return 1;
}
Reply
#2

Download the plugin 'crashdetect' and add it to server.cfg
Then check server.log and paste the crash code here.
Reply
#3

Here you go.

[23:17:15] [debug] Server crashed while executing srv.amx
[23:17:15] [debug] AMX backtrace:
[23:17:15] [debug] #0 native SendClientMessage () [004703a0] from samp-server.exe
[23:17:15] [debug] #1 00008404 in ?? (0x00000000, 0xffff00aa, 0x0009a1dc) from srv.amx
[23:17:15] [debug] #2 0002ea80 in public cmd_invite (0x00000000, 0x0009b7c from srv.amx
[23:17:15] [debug] #3 native CallLocalFunction () [00472ad0] from samp-server.exe
[23:17:15] [debug] #4 0000639c in public OnPlayerCommandText (0x00000000, 0x0009b7a0) from srv.amx
[23:17:15] [debug] Native backtrace:
[23:17:15] [debug] #0 004989ec in ?? () from samp-server.exe
[23:17:15] [debug] #1 5f656c61 in ?? () from samp-server.exe
[23:17:15] [debug] #2 76ee3ca4 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[23:17:15] [debug] #3 76ee3ca4 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[23:17:15] [debug] #4 76ee3cd3 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[23:17:15] [debug] #5 0049787a in ?? () from samp-server.exe
[23:17:15] [debug] #6 0048a598 in ?? () from samp-server.exe
[23:17:15] [debug] #7 00470445 in ?? () from samp-server.exe
[23:17:15] [debug] #8 004010b6 in ?? () from samp-server.exe
[23:17:15] [debug] #9 7271543a in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #10 7271728f in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #11 72709d54 in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #12 7271548a in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #13 00472dde in ?? () from samp-server.exe
[23:17:15] [debug] #14 004010b6 in ?? () from samp-server.exe
[23:17:15] [debug] #15 7271543a in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #16 7271728f in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #17 72709d54 in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #18 7271548a in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #19 0046cfd0 in ?? () from samp-server.exe
[23:17:15] [debug] #20 00452970 in ?? () from samp-server.exe
[23:17:15] [debug] #21 7271548a in ?? () from plugins\crashdetect.DLL
[23:17:15] [debug] #22 0046db90 in ?? () from samp-server.exe
[23:17:15] [debug] #23 00499cd9 in ?? () from samp-server.exe
[23:17:15] [debug] #24 0045b39a in ?? () from samp-server.exe
[23:17:15] [debug] #25 74fa149d in ?? () from C:\Windows\syswow64\KERNELBASE.dll
[23:17:15] [debug] #26 74fa14d0 in ?? () from C:\Windows\syswow64\KERNELBASE.dll
Reply
#4

Try this:

pawn Код:
CMD:invite(playerid, params[])
{
    new id;
    print("1");
    if(PI[playerid][Lider] == 0) return SCM(playerid, RED, " (greska) {FFFFFF}Nemate ovlastenje za koristenje ove komande !");
    print("2");
    if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Koristite: /invite [ID Igraca / Deo Imena]");
    print("3");
    if(!IsPlayerConnected(id)) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Taj igrac nije u igri !");
    print("4");
    if(id == playerid) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Ne mozete ovu komandu koristiti na sebi !");
    print("5");
    if(PI[id][Clan] != 0 || PI[id][Lider] != 0) return SCM(playerid, TOMATO, " (greska) {FFFFFF}Taj igrac se vec nalazi u nekoj organizaciji !");
    print("6");
    if(PI[playerid][Lider] == 1)
    {
        print("7");
        SCMF(playerid, YELLOW, " (info) {FFFFFF}Uspesno se ubacili igraca %s u Policijsku Jedinicu !");
        SCMF(id, YELLOW, " (info) {FFFFFF}Lider %s vas je primio u Policiju Grada Los Santosa !");
        print("8");
       
        PI[id][Clan] = 1;
        PI[id][Rank] = 1;
        print("9");
       
        SetPlayerSkin(id, PD_RANK1);
        print("10");
        PI[id][Skin] = GetPlayerSkin(id);
        print("11");
        SpawnPlayer(id);
        print("12");
        return 1;
    }
   
    format(gQuery, sizeof(gQuery), "UPDATE `Igraci` SET `Clan` = '%d', `Skin` = '%d', `Rank` = '%d' WHERE `Ime` = '%s'", PI[id][Clan], PI[id][Skin], PI[id][Rank], ImeIgraca(id));
    print("13");
    mysql_function_query(konekt, gQuery, true, "OnQueryFinish", "i", THREAD_OSTALO);
    print("14");
    return 1;
}
Then post the numbers that have been printed in server.log.
Reply
#5

[23:38:25] 1
[23:38:25] 2
[23:38:25] 3
[23:38:25] 4
[23:38:25] 5
[23:38:25] 6
[23:38:25] 7
[23:38:25] [debug] Server crashed while executing srv.amx
[23:38:25] [debug] AMX backtrace:
[23:38:25] [debug] #0 native SendClientMessage () [004703a0] from samp-server.exe
[23:38:25] [debug] #1 00008404 in ?? (0x00000000, 0xffff00aa, 0x00099fc from srv.amx
[23:38:25] [debug] #2 0002e910 in public cmd_invite (0x00000000, 0x0009b600) from srv.amx
[23:38:25] [debug] #3 native CallLocalFunction () [00472ad0] from samp-server.exe
[23:38:25] [debug] #4 0000639c in public OnPlayerCommandText (0x00000000, 0x0009b5d from srv.amx
[23:38:25] [debug] Native backtrace:
[23:38:25] [debug] #0 004989ec in ?? () from samp-server.exe
Reply
#6

Show SCMF function.

EDIT: It's this:

pawn Код:
SCMF(playerid, YELLOW, " (info) {FFFFFF}Uspesno se ubacili igraca %s u Policijsku Jedinicu !");
Remove %s.
Reply
#7

pawn Код:
SCMF(playerid, YELLOW, " (info) {FFFFFF}Uspesno se ubacili igraca %s u Policijsku Jedinicu !");
SCMF(id, YELLOW, " (info) {FFFFFF}Lider %s vas je primio u Policiju Grada Los Santosa !");
Why ?
You've forgot to add a string variable like that:
pawn Код:
SCMF(playerid, YELLOW, " (info) {FFFFFF}Uspesno se ubacili igraca %s u Policijsku Jedinicu !", variable);
Reply
#8

Oh, my bad, it works, thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)