if(Gates[gate][EGateHouseSQLID] != 0 && !aoverride) { new house = houseIDFromSQLID(Gates[gate][EGateHouseSQLID]); if(house != -1) { if(getHouseOwner(house) != 0 && !hasHouseKeys(playerid, house)) { SendClientMessage(playerid, X11_TOMATO_2, "You don't have access to that gate"); return 1; } } }
enum EGateInfo { EGateCmd[32], EGateModelID, Float:EGateX, Float:EGateY, Float:EGateZ, Float:EGateRotX, Float:EGateRotY, Float:EGateRotZ, FactionType:EGateFactionType, EGateJob, EGateState, //0 if closed, 1 if opened, 2 if disabled, 3 if forced opened Float:EOpenPosX, Float:EOpenPosY, Float:EOpenPosZ, EGateObjectID, EGateRoleText[64], Float:EGateFindDistance, Float:EGateMoveSpeed, Float:EGateOpenRotX, Float:EGateOpenRotY, Float:EGateOpenRotZ, EGateInterior, EGateVW, EGateFaction, EGateLastMoveTime, //unix timestamp of last move time EGateHouseSQLID, //SQLID of the house its associated with EGateBizSQLID, //SQLID of business
{"hgate6",971, -1048.2001953125, -1313.9990234375, 131.19999694824, 0.00, 0.00, 0.00,EFactionType_None, -1, 0, 0.0, 0.0, -9.5, 0, "* %s uses %s remote to %s the house gate.",15.0,7.0 , 0.0, 0.0, 0.0,0,0,0,0,1910,-1},
(getHouseOwner(house) != 0
You don't have access to that gate |
Код:
(getHouseOwner(house) != 0 Would be better if you show the functions. getHouseOwner and hasHousekeys. |
hasHouseKeys(playerid, house) { new rent = GetPVarInt(playerid, "Rent"); return Houses[house][EHouseOwnerSQLID] == GetPVarInt(playerid, "CharID") || rent == Houses[house][EHouseSQLID]; } getHouseOwner(house) { return Houses[house][EHouseOwnerSQLID]; }
There is no "else" I see, You said that if the Player is not the owner or Doesn't have the house key, send him the message of But What if he has got the keys or he is the house owner? You haven't created a case for it.
|
if(Gates[gate][EGateJob] != -1 && !aoverride) { if(job != Gates[gate][EGateJob]) { SendClientMessage(playerid, X11_TOMATO_2, "You don't have access to that gate"); return 1; } } if(Gates[gate][EGateFactionType] != EFactionType_None && !aoverride) { if(Gates[gate][EGateFactionType] != getPlayerFactionType(playerid)) { SendClientMessage(playerid, X11_TOMATO_2, "You don't have access to that gate"); return 1; } } if(Gates[gate][EGateFaction] != 0 && !aoverride) { new faction = GetPVarInt(playerid, "Faction"); if(faction != Gates[gate][EGateFaction]) { SendClientMessage(playerid, X11_TOMATO_2, "You don't have access to that gate"); return 1; } }
There is no "else" I see, You said that if the Player is not the owner or Doesn't have the house key, send him the message of But What if he has got the keys or he is the house owner? You haven't created a case for it.
|
btw is it possible to add 2 SQL ids? like create a second enum and add the sql id of the second house to access that gate aswell?
![]() |