SA-MP Forums Archive
Bit_Get problem - 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)
+--- Thread: Bit_Get problem (/showthread.php?tid=519455)



Bit_Get problem - Battlezone - 14.06.2014

Im using y_bit:

pawn Код:
if(Bit_Get(IsPlayerCapturing[playerid][0], TEST) == true)
{
       //my code here
}
But I get those errors at the if(Bit_Get(IsPlayerCapturing[playerid][0], TEST) == true) line

Код:
C:\Users\SEIF\Desktop\samp03z_svr_R1_win32\gamemodes\WarZ.pwn(2640) : error 001: expected token: ")", but found "["
C:\Users\SEIF\Desktop\samp03z_svr_R1_win32\gamemodes\WarZ.pwn(2640) : warning 221: label name "_" shadows tag name
C:\Users\SEIF\Desktop\samp03z_svr_R1_win32\gamemodes\WarZ.pwn(2640) : warning 215: expression has no effect
C:\Users\SEIF\Desktop\samp03z_svr_R1_win32\gamemodes\WarZ.pwn(2640) : error 001: expected token: ";", but found ")"
C:\Users\SEIF\Desktop\samp03z_svr_R1_win32\gamemodes\WarZ.pwn(2640) : error 029: invalid expression, assumed zero
C:\Users\SEIF\Desktop\samp03z_svr_R1_win32\gamemodes\WarZ.pwn(2640) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Remark: TEST = 0

EDIT: I have tried if(Bit_Get(IsPlayerCapturing[playerid], TEST) == true) , it compiles fine but it doesnt work


Re: Bit_Get problem - Jessyy - 14.06.2014

plz show me how "IsPlayerCapturing" is declared


Re: Bit_Get problem - Battlezone - 14.06.2014

pawn Код:
new BitArray:IsPlayerCapturing[MAX_PLAYERS]<36>;



Re: Bit_Get problem - Jessyy - 14.06.2014

Wrong (btw read more about y_bit):
Код:
if(Bit_Get(IsPlayerCapturing[playerid][0], TEST) == true)
The corect form:
Код:
// new BitArray:IsPlayerCapturing[MAX_PLAYERS]<36>;

// var_a - the player id you are interested ( 0 <= var_a < MAX_PLAYERS )
// var_b - what slot (position, or how you want to call it) you are interested ( 0 <= var_b < 36 )
if(Bit_Get(IsPlayerCapturing[var_a], var_b) == true) {
...
}



Re: Bit_Get problem - Battlezone - 14.06.2014

i have already tried if(Bit_Get(IsPlayerCapturing[playerid], TEST) == true) but it doesnt work