Deep bug in zcmd? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Deep bug in zcmd? (
/showthread.php?tid=188574)
Deep bug in zcmd? -
GaGlets(R) - 08.11.2010
I have a nice problem with zcmd and `if`
For most of commands i use check
pawn Код:
if(PlayerInfo[playerid][pMember] != 1 || PlayerInfo[playerid][pLeader] != 1) return SendClientMessage(playerid, COLOR_GRAD1, "* You are not a cop.");
So there is big problem. I set for my character `pMember` to 1. Ofcourse `pLeader` i leave alone and it is 0.
When doing command it wont pass check if i have `pMember` - `1`
pawn Код:
if(PlayerInfo[playerid][pMember] != 1 || PlayerInfo[playerid][pLeader] != 1) return SendClientMessage(playerid, COLOR_GRAD1, "* You are not a cop.");
//the code wont be used if `pMember` is 1 and `pLeader` is 0
if `pLeader` is 1 and `pMembe`r is 0 it works. Also it works if bouth of them are setted to 1.
So whats the problem?
pMember check works in other script parts like onpolayerspawn callback etc.
Re: Deep bug in zcmd? -
Slice - 08.11.2010
The if-statements there will return false only when both pLeader and pMember is set to 0.
This should work:
pawn Код:
if(!PlayerInfo[playerid][pMember] && !PlayerInfo[playerid][pLeader]) return SendClientMessage(playerid, COLOR_GRAD1, "* You are not a cop.");
Re: Deep bug in zcmd? -
GaGlets(R) - 08.11.2010
Quote:
Originally Posted by g_aSlice
pawn Код:
if(!PlayerInfo[playerid][pMember] && !PlayerInfo[playerid][pLeader]) return SendClientMessage(playerid, COLOR_GRAD1, "* You are not a cop.");
|
Thanks for reply but I need to check if it is `1` because I am using more than `1` if you understood what i mean.
pMember - 1 should be cops
pMember - 3 should be something else - like a team.
So i think your version wont suit there.
Re: Deep bug in zcmd? -
GaGlets(R) - 08.11.2010
G..... It was too smart for me. trololololō
So ****** your version is like, `if not, member 1 and leader 0 then send message` so in this cas i would need to add more and more checks for player like `if member 0 and !leader > 1` is there any simplier way so i dont need to waste "memory"
ghouash.. memory lol..
it would wrok if i do like this?
pawn Код:
if(Member == 1 || Leader == 1) {}
else return message.
Everybody knows that i`m too lazy.
-------------------
Omg the pawno becomes harder and harder for me ;S It was so easy with 0.2
Re: Deep bug in zcmd? -
GaGlets(R) - 09.11.2010
never mind works :P
Ahm.. if you know goadfather then you know what i am talking about - about something similar
pMember and pLeader are valued variables in enum used with PlayerInfo[MAX_PLAYERS][enumname]