help with bools..
#1

Hi, I have problem with bools, everybody knows whom they are intended

this is a script:

pawn Код:
#define     IsAnywhere(%0)      \
                ( InDrag [ %0 ], InStunt [ %0 ] )
               
#define     IsAnywhere2(%0)      \
                ( InDm [ %0 ], inpstunt [ %0 ]  )

#define     IsAnywhere3(%0)      \
                ( infura [ %0 ], infura2 [ %0 ]  )

#define     IsAnywhere4(%0)      \
                ( inairplane [ %0 ] )
               

               
//----------------------ZONU-BOOLAI---------------------------------------------
new bool: inpstunt[MAX_PLAYERS];
new bool:infura[MAX_PLAYERS];
new bool:infura2[MAX_PLAYERS];
new bool:inairplane[MAX_PLAYERS];
new bool:InDm[MAX_PLAYERS];
new bool:InStunt[MAX_PLAYERS];
and when y type /stunt ( or other cmd ) then set my pos in the zone and so on, and in the command is inserted
pawn Код:
InDm[playerid] == true;
but its a big bug. this is /player command:


pawn Код:
dcmd_player(playerid, params[])
{
    #pragma unused params
    if ( !IsAnywhere ( playerid ) || !IsAnywhere2 (playerid) || !IsAnywhere3 (playerid)  || !IsAnywhere4 (playerid) ) return GameTextForPlayer(playerid,"Jus niekur nesate prisijunges.", 4000, 4);
        return GameTextForPlayer(playerid,"~g~you are not logged in anywhere", 4000, 4);
    if(IsPlayerInAnyVehicle(playerid))
    {
        RemovePlayerFromVehicle(playerid);
        SetPlayerVirtualWorld(playerid, 0);
        InDrag[playerid] = false;
        InDm[playerid] = false;
        InStunt[playerid] = false;
        inpstunt[playerid] = false;
        infura[playerid] = false;
        infura2[playerid] = false;
        inairplane[playerid] = false;
        TextDrawHideForPlayer(playerid, stunttd);
        TextDrawHideForPlayer(playerid, DMtd);
        DisablePlayerRaceCheckpoint(playerid);
        sInfo[playerid][pSTUNT] = 0;
        sInfo[playerid][fura] = 0;
        sInfo[playerid][fura2] = 0;
        sInfo[playerid][airplane] = 0;
        DisablePlayerCheckpoint(playerid);
        SpawnPlayer(playerid);
    }
    else
    {
        SetPlayerVirtualWorld(playerid, 0);
        sInfo[playerid][pSTUNT] = 0;
        sInfo[playerid][fura] = 0;
        sInfo[playerid][fura2] = 0;
        sInfo[playerid][airplane] = 0;
        SetPlayerVirtualWorld(playerid, 0);
        InDrag[playerid] = false;
        InDm[playerid] = false;
        InStunt[playerid] = false;
        inpstunt[playerid] = false;
        infura[playerid] = false;
        infura2[playerid] = false;
        inairplane[playerid] = false;
        TextDrawHideForPlayer(playerid, stunttd);
        TextDrawHideForPlayer(playerid, DMtd);
        DisablePlayerRaceCheckpoint(playerid);
        DisablePlayerCheckpoint(playerid);
        SpawnPlayer(playerid);
    }
    return 1;
}
and in this command and when I wrote, I wrote that I am not logged in anywhere.

and I did check with cmd:

pawn Код:
if(strcmp(cmdtext,"/checking",true)==0)
    {
        if ( !IsAnywhere ( playerid ) || !IsAnywhere2 (playerid) || !IsAnywhere3 (playerid)  || !IsAnywhere4 (playerid) )
        {
            SendClientMessage(playerid, COLOR_RED," you are not in the zone");
        }
        else if ( IsAnywhere ( playerid ) || IsAnywhere2 (playerid) || IsAnywhere3 (playerid)  || IsAnywhere4 (playerid) )
        {
            SendClientMessage(playerid, COLOR_GREEN," you are in the zone.");
        }
        return 1;
    }
and when i in the zone t.y. ( InStunt[playerid] == true; ) and send command /checking, server wrote that i am not in the zone, where is a bug? help
Reply
#2

someone... help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)