English Solved Why is 1 not recognized as true in ArmA?

  • Auteur de la discussion Auteur de la discussion Scared Donut
  • Date de début Date de début
15/8/22
3
0
100
I am trying to work on a cop saving position but for whatever reason ArmA doesn't know that 1 = true. yet when I look at the civi code it doesn't have if ... isEquals 1

4:22:51 Error if: Type Number, expected Bool
4:22:51 File mpmissions\__CUR_MP.Tanoa\core\fn_initCop.sqf..., line 29

I double checked the database and the response from the DB and it is correct. Do I need to define that 1 = true and 0 = false somewhere for west side?

Thanks for your time and help!

Posté par scareddonut via discord.
 
Thank you 🙂

I've managed to get ahead with the project but I am stuck on one last issue.

When pressing sync in game or when waiting 5 minutes for the server to sync automatically the cop_position and cop_alive change to 0.

I think I've narrowed it down to fn_updateRequest.sqf.

For whatever reason the vars are not sent over to the server from client.


I changed the code to that and on west side I added the two new fields

.../MySQL/fn_updateRequest.sqf
Code:
//_position = if (_side isEqualTo civilian) then {[_position] call DB_fnc_mresArray} else {[]};

_position = [_position] call DB_fnc_mresArray;

Code:
case west: {_query = format ["UPDATE players SET name='%1', cash='%2', bankacc='%3', cop_gear='%4', cop_licenses='%5', cop_stats='%6', playtime='%7', cop_alive='%8', cop_position='%9' WHERE pid='%10'",_name,_cash,_bank,_gear,_licenses,_stats,_playtime_update,[_alive] call DB_fnc_bool,_position,_uid];};

and on client side
/core/session/fn_updateRequest.sqf
Code:
    case west: {
       // _packet pushBack life_is_arrested;
        _packet pushBack _alive;
        _packet pushBack _position;
    };

So when a player disconnects the data is sent over correctly and it does update cop_alive and cop_position but when its manually saved/automatically saved by the server it changes to 0 and [].

I was wondering if you could point me in the right direction as I am lost here.

Thank you for you time and help! ❤️

Posté par @scareddonut via discord.