Little help.
#1

I'd like to know if is possible that a condition can be checked if the string is empty.
Reply
#2

You can download sscanf2 and use that...I have no idea without it because I only work with sscanf...

if(sscanf(params, "s", msg)) //Checks if a string has been entered


https://sampwiki.blast.hk/wiki/Fast_Commands#sscanf
Reply
#3

Indeed i want to do without sscanf. It's only a line to check it why sscanf for 1 function?

I was thinkig about

pawn Код:
new hi[] = ""; // String empty

if(!hi == '\0') // if hi isn't a NULL string? This should work?
Reply
#4

ahh here we are

https://sampwiki.blast.hk/wiki/Strtok
Reply
#5

If you use zcmd you can use the "isnull" function. Or else you could use strlen.
Reply
#6

pawn Код:
if(!strlen(string[]))
{
    // code to execute
}
not tested, since i always use sscanf
Reply
#7

if(strlen(hi) == 0) return 1;

EDIT: actually 0 would be 1 wouldnt it?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)