Sscanf help
#1

Hello guys i have researched about sscanf and i am wondering what kind of symbol i need to put in the sscanf to check if the player has put the only the wrong params for exsample

USAGE: /veh

and thats it i only need it for text
Reply
#2

its "d" i belive.


pawn Код:
if(sscanf(params,"d",vname))
Reply
#3

No i mean i made a dialog and i want it to show the text only not correct for anything else except the params itself
Reply
#4

pawn Код:
CMD:veh( playerid, params[ ] )
{
    if( isnull( params ) ) return SendClientMessage( playerid, -1, "Usage: /veh <some text..>" );
    // do your code here and use "params" to show the text the player typed
    return 1;
}
You don't even need sscanf for that, but in case you want to know how.. it'd be:
pawn Код:
CMD:veh( playerid, params[ ] )
{
    new
        text[64] // change the size depending on the max lenght you want.
    ;
    if( sscanf( params, "s[64]", text ) ) return SendClientMessage( playerid, -1, "Usage: /veh <some text..>" );
    // do your code here and use "text" to show the text the player typed
    return 1;
}
Reply
#5

if u want to player not to type any params and show the dialog, then
pawn Код:
// the cmd name, in zcmd, CMD:veh(playerid, params[])
if(isnull(params))
{
    // code
}
else return SendClientMessage(playerid, -1, "Usage: /veh");
// returning and bracket stuff
fking anti spam. the person above me teached me about "isnull"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)