my cmd doesnt work
#1

here is my cmd:
pawn Код:
CMD:test(playerid, params[])
{
    new id;
    new reason[128];
    new kick[128];
    new kickmsgtoadmin[128];
    new name[MAX_PLAYER_NAME];
    if(PInfo[playerid][Padmin] > 0)
    {
        if(sscanf(params,"uc",id,reason)) return SendClientMessage(playerid, -1, "UAGE: /kick <id> <reason>");
        GetPlayerName(id,name,sizeof(name));
        format(kick, sizeof(kick), "you have been kicked by %s for reason: %c", name, reason);
        SendClientMessage(id, ORANGE, kick);
        format(kickmsgtoadmin, sizeof(kickmsgtoadmin), "you have kicked %s for reason: %c", name, reason);
        SendClientMessage(playerid, -1, kickmsgtoadmin);
        Kick(id);
    } return true;
}
it just shows SERVER:unkown cmd
Reply
#2

Weird... it works for me : o

http://puu.sh/B9Cy

http://puu.sh/B9Cw
Reply
#3

Is there a sort of return 0; somewhere near the command that could prevent the command from being processed?
Reply
#4

there is no return 0; btw how do i make that u can make the reason longer?
Reply
#5

pawn Код:
new reason[128];
To;
pawn Код:
new reason[Reason length in here.];
Reply
#6

yeh i know that lol but like what i put in the sscanf line a 'd' or 'i' etc

p.s cmd still doesnt work
Reply
#7

Why you're using %c ?

You can use %s for playername and %d for playerid.
Reply
#8

i know that lol

ok btw i removed the if(PInfo[playerid][Padmin] > 0) and it seemed to work.... but i need that as i only want admins to use it

and with %c it only ables me to do 1 letter in reason D;
Reply
#9

pawn Код:
if(PInfo[playerid][Padmin] == 0) return SendClientMessage(playerid,0xFF0000FF,"This command is allowed only for admins.");
Place it before executing the command.
Reply
#10

thanks thats sorted out the admin bit, what about the one letter reason?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)