Problem "!=".
#1

My pLeader = 8, and show message "Not Hitman!". Why?
Код HTML:
if(pInfo[playerid][pMember] != 8 || pInfo[playerid][pLeader] != 8) return SendClientMessage(playerid, COLOR_DARKGRAY, "Not Hitman!");
Reply
#2

pInfo[playerid][pMember] must be 8 too.
Reply
#3

But use "||" not "&&".
Reply
#4

|| Means OR. So either the one, either the other.
Reply
#5

I never understood the reasoning behind the logic of pMember <-> pLeader. Clearly, "leader" is a property of faction, not a property of player, and if a player is the leader then he implicitly or explicitly ought to be a member as well. Let's say you have 10 factions and 20,000 registered players. Now 10 players will have an actual value saved in their account and 19,990 players will have 0 saved in their account. I hope you realize how silly that is.
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
I never understood the reasoning behind the logic of pMember <-> pLeader. Clearly, "leader" is a property of faction, not a property of player, and if a player is the leader then he implicitly or explicitly ought to be a member as well. Let's say you have 10 factions and 20,000 registered players. Now 10 players will have an actual value saved in their account and 19,990 players will have 0 saved in their account. I hope you realize how silly that is.
And what would be better to do?
Reply
#7

Quote:
Originally Posted by norton2
Посмотреть сообщение
And what would be better to do?
A lot of ways , for, I personally check if the player rank is 10 (Highest faction rank) and if it is, then he can do all faction leader commands. Another way would be(If you are using SQLite or MySQL) to save somewhere the unique player SQL ID and then check if the player's unique SQL ID is equal to the faction he is member in's leader SQL ID and the third way I can think of is to save the leader's name again in faction information and use strcmp to compare if the saved leader's name matches the player who executed the command.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)