Bit_Get problem
#1

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
Reply
#2

plz show me how "IsPlayerCapturing" is declared
Reply
#3

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

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) {
...
}
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)