/suspend is crashing the server.
#1

This /suspend is causing samp-server.exe to crash... Anyone know why? =) Thanks...

pawn Код:
dcmd_suspend(playerid, params[])
    {
    new pName[MAX_PLAYER_NAME], string[256];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string,sizeof(string),"EQRP/Players/%s.ini",pName);
    new id, reason[64], reason2[64], Banned[MAX_PLAYER_NAME],Banner[MAX_PLAYER_NAME];
    if(dini_Int(string,"AdminLVL") == 0) return 1;
    if (sscanf(params, "uz", id, reason)) SendClientMessage(playerid, COLOR_DARKRED, "Usage: \"/suspend <playerid/partname> <reason (optional)>\"");
    else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_DARKRED, "Player not found");
    else
    {
      GetPlayerName(playerid,Banner,sizeof(Banner));
      GetPlayerName(id,Banned,sizeof(Banned));
        format(reason, sizeof (reason), "You have been banned%s%s.", reason[0] ? (" for: ") : (""), reason);
        format(reason2, sizeof (reason2), "Admin %s banned %s %s%s.",Banner,Banned, reason[0] ? (" for: ") : (""));
        SendClientMessageToAll(COLOR_DARKRED,reason2);
        SendClientMessage(id, COLOR_DARKRED, reason);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Player banned");
        BanEx(id,reason);
    }
    return 1;
    }
Reply
#2

Propably its the sscanf

Код:
sscanf(params, "uz", id, reason)
I think u and z are both no valid formats, try "is" for integer and string, this should work
Reply
#3

Edit: delete.
Reply
#4

It wasn't the problem :P But i fixed it myself thx anyway...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)