sscanf - specify a string if empty
#1

Alright, recently I have been doing a certain command, I want if the player didn't type anything in the 'doorname' it gives the name None.. how to do that in sscanf.

pawn Код:
if(sscanf(params,"s[32]s[32]", type, doorname))
etc..

like if the doorname is empty set the doorname = "None";

Thanks in advance.
Reply
#2

Drop the if you don't need that in this case try it like this.

pawn Код:
sscanf(params,"s[32]s[32]", type, doorname);
if(isnull(type)) return SendClientMessage(playerid, -1, "You must specify a type");
if(isnull(doorname)) doorname = "none";
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)