[Help] ZCMD Kick Command
#1

I don't really know what's wrong with the code, it seems to be fine for me.
Anyways it doesn't accept more than 1 character as the reason, and it kicks me if I enter any ID.


Edit: Resolved.
Reply
#2

It dosen't accept more than one character because it isn't an array, just replace new reason; with new reason[32]; and it should work.
Reply
#3

You're the man, it even fixed that random ID kicking. Rep++ if I could
Reply
#4

PHP код:
CMD:kick(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
            new 
kickedreason[50];
            if(
sscanf(params"us[50]"kickedreason)) return SendClientMessage(playerid0x00FF00AA"USAGE: /kick [ID] [Reason]");
            if(
kicked == INVALID_PLAYER_ID) return SendClientMessage(playerid0x00FF00AA"Invalid ID");
            new 
message[128];
            
format(messagesizeof(message), "AdmCMD: %s was kicked by %s, reason: %s"ReturnPlayerName(kicked), ReturnPlayerName(playerid), reason);
            
SendClientMessageToAll(0x00FF00AAmessage);
            
Kick(kicked);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)