need help with strcmp
#1

ok I have this code here
it is under ondialogresponse
I entered the print code and it seems to work properly
pawn Код:
print(inputtext);//remove
if(strcmp(inputtext,"",true,0)==0)
{
   return SendClientMessage(playerid, RED, "You can't name the map nothing");
}
it does not seem to be working so I went to samp wiki to check the syntax and I notice something it said
Quote:
Important Note: This function also returns 0 if either string is empty.


so how would I check if a string is valid
Reply
#2

if(isnull(inputtext)) >> Used to check if its' null
or for checking another string:
if(!strcmp(inputtext, "string inside"))
Reply
#3

better try https://sampwiki.blast.hk/wiki/Strlen
Reply
#4

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
if(isnull(inputtext)) >> Used to check if its' null
or for checking another string:
if(!strcmp(inputtext, "string inside"))
Thanks
pawn Код:
if(isnull(inputtext))
is just what I needed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)