23.08.2014, 08:54
(
Последний раз редактировалось Snail; 23.08.2014 в 09:37.
)
Hi everyone
I am having some problems with my /kick command
What happens is when I type /kick 0 It kicks the player but without a reason
The next problem is when I type a ID in when the player isn't connected it shows I kicked someone but without a name and a reason.
Here is the code:
I changed the sscanf params to "ud" but still doesn't work.
Thank you
I am having some problems with my /kick command
What happens is when I type /kick 0 It kicks the player but without a reason
The next problem is when I type a ID in when the player isn't connected it shows I kicked someone but without a name and a reason.
Here is the code:
pawn Код:
CMD:kick(playerid,params[])
{
new nub, str[128], reason[128], an[MAX_PLAYER_NAME], nub1[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_RED, "ERROR: You must be an RCON to use this command!");
if(!IsPlayerConnected(nub)) return SCM(playerid, COLOR_RED, "ERROR: That player isn't connected!");
if(sscanf(params,"is", nub)) return SCM(playerid, COLOR_RED, "USAGE: /kick <playerid> <reason>");
GPN(playerid, an, MAX_PLAYER_NAME);
GPN(nub, nub1, MAX_PLAYER_NAME);
FT(str, sizeof(str), "[KICK]:%s has kicked %s! Reason: %s", an, nub1, reason);
SCMTA(COLOR_RED, str);
Kick(nub);
return 1;
}
Thank you