zcmd kick command
#1

Hey. I am creating a kick command with zcmds. The kick itself seems to be working fine. Just the message it's supposed to send is quite messy and I really don't know how to continue.
pawn Код:
COMMAND:kick(playerid, params[]) //using ZCMD this is how your command will start off looking like.
{
    if(PlayerInfo[playerid][pAdminlevel] >= 1) // player level more (>) 0
    {
        new otherplayerid, reason[128];
        if(sscanf(params, "uz", otherplayerid, reason)) // split input string and check level value 0 to 5
            SendClientMessage(playerid, 0xFFFFFFFF, "/kick [playerid/name] [reason]");
        else if(otherplayerid == INVALID_PLAYER_ID) // Check player connected
            SendClientMessage(playerid, 0xFFFFFFFF, "This player is not connected");
        else
        {
            new string[32];
            format(string, sizeof(string), "Admin %s kicked %s | Reason: %s", GetPlayerNameEx(playerid), GetPlayerNameEx(otherplayerid), reason);
            SendClientMessageToAll(0xFFFFFFFF,string);
            Kick(otherplayerid);
        }
    }
    else
    {
        SendClientMessage(playerid, 0xAAAAAAAA, "You are not admin or the required level.");
    }
    return 1;
}
An other question.. at first I used "s" in the code below instead of "z", can someone explain why I have put "z" there? I just copied it somewhere and didn't really understand why I put it there.
pawn Код:
if(sscanf(params, "uz", otherplayerid, reason))
I am aware what u means.
Reply


Messages In This Thread
zcmd kick command - by Omecken - 23.02.2011, 10:16
Re: zcmd kick command - by XFlawless - 23.02.2011, 10:20
Re: zcmd kick command - by Omecken - 23.02.2011, 10:23
Re: zcmd kick command - by Gh0sT_ - 23.02.2011, 10:29
Re: zcmd kick command - by Omecken - 23.02.2011, 10:38
Re: zcmd kick command - by DevilG - 23.02.2011, 10:53
Re: zcmd kick command - by Omecken - 23.02.2011, 10:55
Re: zcmd kick command - by xir - 23.02.2011, 11:01
Re: zcmd kick command - by HyperZ - 23.02.2011, 12:47

Forum Jump:


Users browsing this thread: 7 Guest(s)