Need help in syntax
#5

Quote:
Originally Posted by Jokers98s
View Post
If i want to check possible matches.. more than one.

if(!strcmp(GetPlayerClanRank(playerid), "Owner","Leader", true)) is it correct ?
Nope you just use the strcmp again with the "Leader" instead of "Owner".

And by the way this is bad coding practice, You should avoid comparing strings whenever possible for more optimization.

So, Instead of comparing the ranks names, Assign an integer to each rank (Use #define) to define the integer name.
Example:
PHP Code:
//OnTop
#define CLAN_OWNER 6
#define CLAN_LEADER 5
//Now when comparing/assigning the rank you simply use the define name
//Such as
Rank[playerid] = CLAN_OWNER//Assigning (Could be different variable but just for clarifying)
if(Rank[playerid] == CLAN_OWNER//Comparing
{
//Do something

Just think of the define as the define name will be replaced with whatever near it on compilation. so it is legit.
Reply


Messages In This Thread
Need help in syntax - by Jokers98s - 19.01.2018, 07:46
Re: Need help in syntax - by FailerZ - 19.01.2018, 07:51
Re: Need help in syntax - by Jokers98s - 19.01.2018, 08:15
Re: Need help in syntax - by Jokers98s - 19.01.2018, 08:19
Re: Need help in syntax - by FailerZ - 19.01.2018, 08:40
Re: Need help in syntax - by Jokers98s - 19.01.2018, 11:18

Forum Jump:


Users browsing this thread: 1 Guest(s)