sscanf + zcmd not passing
#1

pawn Код:
COMMAND:kick(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 1 && !IsPlayerAdmin(playerid)) return SendError(playerid, CANT_USE_CMD);
    new iPlayer, iReason[158];
    if(sscanf(params, "us[157]", iPlayer, iReason)) return SCP(playerid, "< PlayerID / PartOfName > < Reason >");

    if(IsPlayerConnected(iPlayer)) {
        AdminLog(PlayerInfo[playerid][pID], PlayerInfo[iPlayer][pID], iReason, "[KICK]");
        ServerKick(iPlayer, iReason, ReturnPlayerName(playerid));
    } else return SendError(playerid, PLAYER_NOT_FOUND);
    return 1;
}
When I type "/kick 0 testing" it shows the return function instead of executing the command.
Thanks
Reply
#2

try
Quote:

if(sscanf(params, "u s[157]", iPlayer, iReason)) return SCP(playerid, "< PlayerID / PartOfName > < Reason >");

You know that the max input is 128? - player name and - function name
Reply
#3

Quote:
Originally Posted by Runn3R
Посмотреть сообщение
try


You know that the max input is 128? - player name and - function name
Now I do

Still not working, although it works like this:

pawn Код:
if(sscanf(params, "us", iPlayer, iReason)) return SCP(playerid, "< PlayerID / PartOfName > < Reason >");
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)