08.04.2011, 11:14
Hello, i got a problem with my /kick cmd. When i do /kick ID. It just shows up the text again.
This is my command.
I cant figure it out.
So, Whats wrong with it?
Thanks,Alex
This is my command.
pawn Код:
new string[256];
new cmd[128];
new tmp[128];
new giveplayerid;
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "/kick id or name");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
if(PlayerInfo[playerid][pAdminLevel] >= 2)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
Kick (giveplayerid);
}
}
}
return 1;
}
So, Whats wrong with it?
Thanks,Alex