Sscanf help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sscanf help (
/showthread.php?tid=476892)
Sscanf help -
DarkLored - 21.11.2013
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
Re: Sscanf help -
DobbysGamertag - 21.11.2013
its "d" i belive.
pawn Код:
if(sscanf(params,"d",vname))
Re: Sscanf help -
DarkLored - 21.11.2013
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
Re: Sscanf help -
Konstantinos - 21.11.2013
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;
}
Re: Sscanf help -
newbie scripter - 21.11.2013
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"