05.03.2016, 09:50
Hey wait, u forgot to add some thing very important to your code.
[Pawn]COMMAND:kick(playerid,params[])
{
if(pInfo[playerid][Adminlevel] >= 2)
{
new id;
new reason;
if(sscanf(params,"u",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /kick [playerid] [reason]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This id isnt online!");
if(pInfo[playerid][Adminlevel] < pInfo[id][Adminlevel]) return SendClientMessage(playerid,COLOR_RED,"You can't kick a higher admin level than you");
Kick(id);
SendClientMessage(playerid, 0x33AA33AA, "[ADMIN] You have succesfully kicked the player!");
} else return SendClientMessage(playerid, COLOR_RED, "You must be atleast admin level 2 in order to use this command !");
return 1;
}[\pawn]
[B]what's wrong?
Good question.
Firwt of all, n
New reason; must be new reason[string limit];
Ex: new reason[100];
Second:
It must be
Why did i add "s" ?
Because u made reaso, and you forgot to make a varible for him, like you did with the "u" because the u is id,tho it will make the id .[b]
[Pawn]COMMAND:kick(playerid,params[])
{
if(pInfo[playerid][Adminlevel] >= 2)
{
new id;
new reason;
if(sscanf(params,"u",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /kick [playerid] [reason]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This id isnt online!");
if(pInfo[playerid][Adminlevel] < pInfo[id][Adminlevel]) return SendClientMessage(playerid,COLOR_RED,"You can't kick a higher admin level than you");
Kick(id);
SendClientMessage(playerid, 0x33AA33AA, "[ADMIN] You have succesfully kicked the player!");
} else return SendClientMessage(playerid, COLOR_RED, "You must be atleast admin level 2 in order to use this command !");
return 1;
}[\pawn]
[B]what's wrong?
Good question.
Firwt of all, n
New reason; must be new reason[string limit];
Ex: new reason[100];
Second:
pawn Code:
if(sscanf(params,"u",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /kick [playerid] [reason]");
pawn Code:
if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /kick [playerid] [reason]");
Because u made reaso, and you forgot to make a varible for him, like you did with the "u" because the u is id,tho it will make the id .[b]

