Server crashing when flooding in a cmd
#2

Should be
if(sscanf(params, "s[5]", tmp))
but you don't need sscanf for 1 option your 'params' is same as tmp

pawn Код:
COMMAND:name(playerid, params[])
{
    if(PlayerInfo[playerid][admin] || PlayerInfo[playerid][premium] || PlayerInfo[playerid][playerteam]==HITMAN || PlayerInfo[playerid][playerteam]==FBI || PlayerInfo[playerid][playerleve]>= 10)
    {
        if(isnull(params)) SCP(playerid, "[on/off]");
        else if(strcmp(params,"on",true)==0)
        {
            PlayerTemp[playerid][hname]=0;
            GameTextForPlayer(playerid,"~g~ShowName ON",1000,1);
            PlayerLoop(i) ShowPlayerNameTagForPlayer(i,playerid,1);
        }
        else if(strcmp(params,"off",true)==0)
        {
            PlayerTemp[playerid][hname]=1;
            GameTextForPlayer(playerid,"~r~ShowName OFF",1000,1);
            PlayerLoop(i) if(!PlayerInfo[i][power]) ShowPlayerNameTagForPlayer(i,playerid,0);
        }
        else SCP(playerid, "[on/off]");
    }
    else SendClientError(playerid, CANT_USE_CMD);
    return 1;
}
Reply


Messages In This Thread
Server crashing when flooding in a cmd - by CopKing123 - 12.05.2015, 19:16
Re: Server crashing when flooding in a cmd - by Jefff - 12.05.2015, 19:26
Re: Server crashing when flooding in a cmd - by CopKing123 - 12.05.2015, 19:29
Re: Server crashing when flooding in a cmd - by Threshold - 13.05.2015, 04:21

Forum Jump:


Users browsing this thread: 1 Guest(s)