/kick command help plz.
#1

with sscanf+zcmd /kick id reason
Reply
#2

pawn Код:
CMD:kick(playerid, params[])
{
    if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid, 0xFF0000FF, "Only Administrators can use this command."); //Replace PlayerInfo with your own enum/variables
    new id, reason[60];
    if(sscanf(params, "uS(No Reason)[60]", id, reason)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX: /kick [Player ID] [Optional: Reason]");
    if(strlen(reason) > 60) return SendClientMessage(playerid, 0xFF0000FF, "Your reason must be less than 60 characters long.");
    new string[150];
    format(string,sizeof(string),"Administrator %s Has Kicked %s | Reason: %s", Name(playerid), Name(id), reason);
    SendClientMessageToAll(0xFF0000FF, string);
    Kick(id);
    return 1;
}

stock Name(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
}
Reply
#3

You'll never learn if everyone does it for you
Reply
#4

And kick is a very basic command, if you can't do a /kick, better check wiki samp and some tutorials.
Reply
#5

C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(590) : error 017: undefined symbol "PlayerInfo"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(590) : warning 215: expression has no effect
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(590) : error 001: expected token: ";", but found "]"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(590) : error 029: invalid expression, assumed zero
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(590) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

//Replace PlayerInfo with your own enum/variables
Reply
#7

how
can u re command it
Reply
#8

plz help me
Reply
#9

Just do this...

pawn Код:
CMD:kick(playerid, params[])
{
    new pID,
    aName[MAX_PLAYER_NAME], // Name of the admin that kicked player
    pName[MAX_PLAYER_NAME], // Name of the kicked player
    reason[64],
    kickstring[256];
    if(sscanf(params, "us[64]", pID, reason) return SCM(playerid, COL_WHITE, "    USAGE:/kick [playerid/name] [reason]");
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, COL_RED, "    You are not allowed to do that!");
    }
    else
    {
        format(kickstring, sizeof(kickstring), "AdmCmd:%s has kicked %s for : %s", aName, pName, reason);
        SendClientMessageToAll(COL_RED, kickstring);
        Kick(pID);
    }
    return 1;
}
Reply
#10

C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(596) : error 001: expected token: ")", but found "return"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(596) : error 017: undefined symbol "SCM"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(604 -- 605) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)