sscanf problem
#2

Change

Код:
if(sscanf(params,"us[60]", id, reason)) SendClientMessage(playerid, -1, "USAGE: /ban [playerid] [reason]");
To

Код:
if(sscanf(params,"us[60]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /ban [playerid] [reason]");
And your problem is fixed. It's because you weren't returning a value so it would continue through the command whether you entered a value or not and since the default value is 0 it kicked you

You should be doing that for all of these as well
Код:
  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Only administrators can use this command!");
    if(sscanf(params,"us[128]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /kick [playerid] [reason]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "That player isn't online!");
Reply


Messages In This Thread
sscanf problem - by Josh_Main - 11.12.2014, 04:14
Re: sscanf problem - by Divergent - 11.12.2014, 04:17
Re: sscanf problem - by Josh_Main - 11.12.2014, 04:36

Forum Jump:


Users browsing this thread: 1 Guest(s)