26.07.2011, 12:33
It is correct when use sscanf to detect ifisplayerconnected ?
I know that sscanf detects automatically if a player is connect by using "ban_target == INVALID_PLAYER_ID"
Look at this command:
I know that sscanf detects automatically if a player is connect by using "ban_target == INVALID_PLAYER_ID"
Look at this command:
Код:
COMMAND:ban(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[jBan]: You need to be logged in as an RCON administrator to perform this!"); if(j_sscanf(params, "usi", ban_target, ban_reason, ban_time)) return SendClientMessage(playerid, COLOR_RED, "[jBan]: Correct usage -> /ban <player> <reason> <time (minutes)>"); //>>> if(!IsPlayerConnected(ban_target)) return SendClientMessage(playerid, COLOR_RED, "[jBan]: Player was not found!"); if(ban_time < 0) SendClientMessage(playerid, COLOR_RED, "[jBan]: Please input a valid ban time!"); jBan(ban_target, playerid, ban_reason, ban_time); return 1; }