My Kick Script Bug
#1

Sorry im newbie
When I Just Make /kick Then It Will Kick The person are using id 0
Here Is the Code
COMMAND:kick(playerid,params[])
{
new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, str[49];
tmp = strtok(params,Index), id = strval(tmp);
GetPlayerName(id,on,sizeof(on));
GetPlayerName(playerid,n,sizeof(n));
if(AccInfo[playerid][Admin] < 3) return SendClientMessage(playerid,LIGHT_RED,"You need to be level 3 to use this command!");
if(!strlen(params)) return SendClientMessage(playerid,GREY,"USAGE: /kick <ID> ");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREY,"Invalid ID");
format(str,sizeof(str),"%s has kicked %s",n,on);
SendClientMessageToAll(LIGHT_BLUE,str);
Kick(id);
return 1;
}
Reply
#2

Use sscanf. strok, and alike methods are super outdated.
See:
https://sampforum.blast.hk/showthread.php?tid=120356
Reply
#3

Ok I Will Try It
Reply
#4

Ok Thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)