Stach/heap collision
#1

Hello, my /kick command produces this weird "thing", I guess crashdetecet printed that out, anyway here's more of the server log:
pawn Код:
[15:23:12] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[15:23:12] [debug]  Stack pointer (STK) is 0x10837C, heap pointer (HEA) is 0x108340
[15:23:13] [debug] #752 0001f920 in public cmd_kick () from server.amx
[15:23:13] [debug] #753 native CallLocalFunction () [00471ef0] from samp-server.exe
[15:23:13] [debug] #754 00002124 in public OnPlayerCommandText () from server.amx
And there's a 751line long "amx backtrace", but I believe it won't help.

And here's the kick command
pawn Код:
CMD:kick(playerid,params[])
{
    new id,reason[101],string[140];
    if(pInfo[playerid][AdminLevel] == 0 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,RED,"Tu turi būti administratorius kad galėtum naudoti љią komnandą!");
    if(sscanf(params,"us[101]",id,reason)) return SendClientMessage(playerid,RED,"Naudojimas /kick [ЋaidėjoID/DalisVardo] [Prieћastis]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,RED,"Tokio ћaidėjo nėra!");
    if(pInfo[id][AdminLevel] > 0 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,RED,"Administratoriaus iљmesti negalima!");
    if(id == playerid) return SendClientMessage(playerid,RED,"Saves iљmesti negalite!");
    format(string,sizeof(string),"[KICK]Administratorius %s iљmetė %s. Prieћastis:%s",
        pInfo[playerid][Username],pInfo[id][Username],reason);
    SendClientMessageToAll(GREEN,string);
    return 1;
}
I was running the server on my own PC and I have a LOT of memory... I don't understand how this happened.
Reply
#2

Solved: I changed "SendClientMessageToAll" into a loop and that solved it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)