Quote:
Originally Posted by iCurse
None are working..
|
I don't think you understand the difference between the command & the function, you need to completely separate both, what you did above is mixing both of them into one code which clearly doesn't/won't work.
Код:
CMD:kick(playerid, params[])
{
if(pInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, GREY, "You are not authorized to use that command.");
new
targetid,
Reason[128],
str[128]
;
if(sscanf(params, "us[128]", targetid, Reason))
return SendClientMessage(playerid, GREY, "USAGE: /kick [Playerid] [Reason]");
if(!IsPlayerConnected(targetid))
return SendClientMessage(playerid, GREY, "Player is not connected.");
new
pname[MAX_PLAYER_NAME],
tname[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(targetid, tname, sizeof(tname));
format(str, sizeof(str), "You have been kicked by %s REASON: %s.", tname, Reason);
SendClientMessage(targetid, RED, str);
format(str, sizeof(str), "You have kicked %s REASON: %s.", pname, Reason);
SendClientMessage(playerid, RED, str);
SetTimerEx("KickPlayer", 1000, false, "i", targetid);
return 1;
}
forward KickPlayer(targetid);
public KickPlayer(targetid)
{
return Kick(targetid);
}
That's how it should look, if you have more commands below the kick command, then scroll to the bottom of your game mode and place the KickPlayer function.
"CMD: something(playerid, params[])" <- is a command.
"public something()" <- is a function.