server restarted.
#1

Server got restarted when I kick someone...

PHP код:
CMD:kick(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`.");
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetidstring[128];
    if(!
aDuty[playerid]) return SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}You must be ADMIN ON DUTY to kick someone.");
    if(
sscanf(params"us[128]"targetidparams)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /kick [playerid] [reason]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}INVAILD PLAYER ID / NAME.");
    if(
PlayerInfo[playerid][pAdmin] < PlayerInfo[targetid][pAdmin]) return SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}Player has a higher admin level than you. [CAN'T KICKED]!");
    
GetPlayerName(playerid,pName,sizeof(pName));
    
GetPlayerName(targetid,tName,sizeof(tName));
    
Kick(targetid);
    
format(stringsizeof(string), "{FB00FF}[KICKED]: PLAYER %s(%d) has been KICKED by Admin %s(%d), REASON: %s."tName,targetidpName,playeridparams);
    
SendClientMessageToAll(-1string);
    return 
1;

Reply
#2

Try this

PHP код:
CMD:kick(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 1
        return 
SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`."); 
    
    new 
        
pName[MAX_PLAYER_NAME],
        
tName[MAX_PLAYER_NAME],
        
targetid
        
string[128], 
        
reason[80]
    ; 
    
    if(!
aDuty[playerid]) 
        return 
SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}You must be ADMIN ON DUTY to kick someone."); 
    if(
sscanf(params"us[80]"targetidreason)) 
        return 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /kick [playerid] [reason]"); 
    if(!
IsPlayerConnected(targetid)) 
        return 
SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}INVAILD PLAYER ID / NAME."); 
    if(
PlayerInfo[playerid][pAdmin] < PlayerInfo[targetid][pAdmin]) 
        return 
SendClientMessage(playeridCOLOR_GREY"{FF0000}Error: {FFFFFF}Player has a higher admin level than you. [CAN'T KICKED]!"); 
    
    
GetPlayerName(playerid,pName,sizeof(pName)); 
    
GetPlayerName(targetid,tName,sizeof(tName)); 
    
Kick(targetid); 
    
format(stringsizeof(string), "{FB00FF}[KICKED]: PLAYER %s(%d) has been KICKED by Admin %s(%d), REASON: %s."tName,targetidpName,playeridreason); 
    
SendClientMessageToAll(-1string); 
    return 
1

Reply
#3

now The player got KICKED but The message is don't showen why?
Reply
#4

This is bug of SA-MP. You need put the timer. If you don't know tell me and i explain
Reply
#5

Put this timer at your command Kick.

PHP код:
SetTimerEx("Kicking",5200,false,"i",targetid); 
PHP код:
forward Kicking(playerid);
public 
Kicking(playerid)
{
    
Kick(playerid);

Reply
#6

Thank you guys Now it's worked <3 I used your timer @RedRex Ty too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)