AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved Empty (https://forums.alliedmods.net/showthread.php?t=332241)

Culverton smith 05-01-2021 16:40

Empty
 
Hello. How do I set a if for a return, that returns nothing? I do not mean 0. I mean empty. like:
Code:

get_user_info(id, name, "name", 32);
For example, if the player name is empty here, how can I set if?

like
Code:

if(player name is empty)
{
      // do player
}


JocAnis 05-01-2021 18:30

Re: Empty
 
Check if string is empty by:
Code:

if( !string[ 0 ] )

OR

if( string[ 0 ] == EOS )


Culverton smith 05-02-2021 03:08

Re: Empty
 
Quote:

Originally Posted by JocAnis (Post 2745623)
Check if string is empty by:
Code:

if( !string[ 0 ] )

OR

if( string[ 0 ] == EOS )


Works. Thank you


All times are GMT -4. The time now is 22:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.