Problem with sscanf or what?
#1

I got a problem that when i use any command that i must write the full usage of the command
Example
pawn Код:
dcmd_adkill(playerid,params[])
{
    new string[128];
    new ID;
    new cmdreason[100];
    if(sscanf(params,"us[100]",ID,cmdreason))
    {
        SendClientMessage(playerid,COLOR_ERROR,"**USAGE: /adkill (Player Name/ID) (Reason)");
        SendClientMessage(playerid,COLOR_LIME,"It will Kill the player");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot kill them.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(IsKidnapped[playerid] != 0)
    {
        SendClientMessage(playerid,COLOR_ERROR,"**You are Kidnaped you can't use this command");
        return 1;
    }
    format(string,sizeof(string),"%s has killed %s(%d) for reason: %s.",PlayerName(playerid),PlayerName(ID),ID,cmdreason);
    SendClientMessageToAll(COLOR_ADMIN,string);
   
    format(string,sizeof(string),"[ADMIN-COMMAND] %s(%d) has used /adkill on %s(%d)",PlayerName(playerid),playerid,PlayerName(ID),ID);
    SendClientMessageToAllAdmins(string);
    SetPlayerHealth(ID,0);
    return 1;
}
It tells me **USAGE: /adkill (Player Name/ID) (Reason)
Reply
#2

Код:
if(sscanf(params,"rs[100]",ID,cmdreason))
Reply
#3

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Код:
if(sscanf(params,"rs[100]",ID,cmdreason))
Same Problem.
Reply
#4

Wait, so you want to /adkill without writing the reason?
Reply
#5

Код:
if(sscanf(params,"us[100]",ID,cmdreason)) return SendClientMessage(playerid,COLOR_ERROR,"**USAGE: /adkill (Player Name/ID) (Reason)");
Reply
#6

Not that command , all commands were working but i stopped scripting for a while then tried to test it and found that all commands don't work , this command is just an example of many.
Reply
#7

pawn Код:
if(sscanf(params,"us",ID,cmdreason))
Reply
#8

Quote:
Originally Posted by Brandon_More
Посмотреть сообщение
pawn Код:
if(sscanf(params,"us",ID,cmdreason))
Quote:
Originally Posted by Problems
Посмотреть сообщение
Not that command , all commands were working but i stopped scripting for a while then tried to test it and found that all commands don't work , this command is just an example of many.
^^^^
Reply
#9

Anyone?
Reply
#10

Bump!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)