Help /kick Problem
#1

this is Kick Command (zcmd+sscanf2)

PHP код:
COMMAND:kick(playerid,params[])
{
    new 
playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
    new 
tmp[256], Indexstr[49], reason[32];
    
tmp strtok(params,Index), playerid2 strval(tmp);
    
GetPlayerName(playerid2,on,sizeof(on));
    
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(
Account[playerid][Level] < 2) return SendClientMessage(playerid,Yellow,"You need to be level 2 to use this command!");
    if (
sscanf(params"us"playerid2,reason)) return SendClientMessage(playeridYellow"Usage: /kick id reason");
    if(!
IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
    
format(str,sizeof(str),"Admin %s has kicked %s [Reason: %s]",PlayerName,on,reason);
    
SendClientMessageToAll(Blue,str);
    
Kick(playerid2);
    return 
1;

My Problem is whene i kick someone , for an example i kick id 2 for Lag , the reason shown is : La , so we can't see all the word,also for spawnkill , Reason :Sp (we can't see spawnkill) THANX FOR HELPING
Reply
#2

PHP код:
COMMAND:kick(playerid,params[])
{
    new 
playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
    new 
tmp[256], Indexstring[128], reason[32];
    
tmp strtok(params,Index), playerid2 strval(tmp);
    
GetPlayerName(playerid2,on,sizeof(on));
    
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(
Account[playerid][Level] < 2) return SendClientMessage(playerid,Yellow,"You need to be level 2 to use this command!");
    if (
sscanf(params"us[64]"playerid2,reason)) return SendClientMessage(playeridYellow"Usage: /kick id reason");
    if(!
IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
    
format(stringsizeof(string),"Admin %s has kicked %s [Reason: %s]",PlayerNameonreason);
    
SendClientMessageToAll(Bluestring);
    
Kick(playerid2);
    return 
1;

try this
Reply
#3

Perfect Working for me thanx a lot man .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)