That's because you have to retrieve the value using get_xvar_num(var_index)
And to get the var_index you should use this native get_xvar_id with the name of the variable in the 1st param to return a unquie address of the variable.
also declare the variable with 1 cell and use bitsum values to check the player whether has a bazooka or not.
Example :
PHP Code:
// Core plugin
public iBits_HAS_ANTI_BAZOOKA // using all chars capital's for readability to determine the variable is on long scoop
// External plugin
new VarIndexHasAntiBazooka;
public plugin_native()
{
VarIndexHasAntiBazooka = get_xvar_id("iBits_HAS_ANTI_BAZOOKA")
}
MyFunction(id)
{
if( get_xvar_num(VarIndexHasAntiBazooka) & (1<<id&31))
//code...
// TO update the public variable value from the external plugin you have to use set_xvar_num(VarIndexHasAntiBazooka, 0); native that mean the public variable is now holding the value of 0.
Note :
XVars only support cells (integers, floats, bools, etc.).
Arrays (including strings, since strings are arrays of characters) cannot be used with XVars, in the other hand
Make sure your public variable name is unique and its not repeated that will make confusion if it did.
Again if you have read the documentation or even searched you won't need to make a useless thread.
__________________