[Help]: Kick command!
#1

hello!

I have one problem...

I scripted a kick command, but I get one error:

pawn Код:
C:\Users\tadej\Desktop\SAMP\gamemodes\FMJ2.0.pwn(427) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
On this line:

pawn Код:
if(sscanf(params, "us[70]", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /kick [playerid] [reason]");
Thanks for your help
Reply
#2

Hmm, let me guess you defined 'reason' and a variable not a string
Well if am correct replace this:
pawn Код:
new reason;
With this:
pawn Код:
new reason[71];
Reply
#3

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Hmm, let me guess you defined 'reason' and a variable not a string
Well if am correct replace this:
pawn Код:
new reason;
With this:
pawn Код:
new reason[71];
I have defined
pawn Код:
new reason[70];
Reply
#4

Here is my command:

pawn Код:
CMD:kick(playerid, params)
{
    new targetid;
    new reason[70];
    new string[200];
    if(gPlayerInfo[playerid][pAdminLevel] < gCommands[KICK])return SCM(playerid, COLOR_RED, "[ERROR]: You can't use this command!");
    if(sscanf(params, "us[70]", targetid, reason))return SCM(playerid, COLOR_GREY, "[USAGE]: /kick [playerid] [reason]");
    if(IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
    if(gPlayerInfo[playerid][pAdminLevel] == gPlayerInfo[targetid][pAdminLevel]) return SCM(playerid, COLOR_YELLOW, "[WARNING]: You can't Kick an Admin with a same Level then you!");
    if(gPlayerInfo[playerid][pAdminLevel] < gPlayerInfo[targetid][pAdminLevel]) return SCM(playerid, COLOR_YELLOW, "[WARNING]: You can't Kick an Higher Admin then you!");
    format(string, sizeof(string), "[Kick]: %s has Kicked %s from the Server!||Reason: %s", GetName(playerid), GetName(targetid), reason);
    SCMToAll(COLOR_YELLOW, string);
    Kick(targetid);
    return 1;
}
Reply
#5

Anyone know, how to fix that?
Reply
#6

pawn Код:
CMD:kick(playerid, params)
should be

pawn Код:
CMD:kick(playerid, params[])
so this:

pawn Код:
CMD:kick(playerid, params[])
{
    new targetid;
    new reason[70];
    new string[200];
    if(gPlayerInfo[playerid][pAdminLevel] < gCommands[KICK]) return SCM(playerid, COLOR_RED, "[ERROR]: You can't use this command!");
    if(sscanf(params, "us[70]", targetid, reason)) return SCM(playerid, COLOR_GREY, "[USAGE]: /kick [playerid] [reason]");
    if(IsPlayerConnected(targetid))return SCM(playerid, COLOR_RED, "[ERROR]: This player is not connected!");
    if(gPlayerInfo[playerid][pAdminLevel] == gPlayerInfo[targetid][pAdminLevel]) return SCM(playerid, COLOR_YELLOW, "[WARNING]: You can't Kick an Admin with a same Level then you!");
    if(gPlayerInfo[playerid][pAdminLevel] < gPlayerInfo[targetid][pAdminLevel]) return SCM(playerid, COLOR_YELLOW, "[WARNING]: You can't Kick an Higher Admin then you!");
    format(string, sizeof(string), "[Kick]: %s has Kicked %s from the Server!||Reason: %s", GetName(playerid), GetName(targetid), reason);
    SCMToAll(COLOR_YELLOW, string);
    Kick(targetid);
    return 1;
}
Reply
#7

Oh :/ Thanks
Reply
#8

np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)