hasHouseKeys(playerid, house) {
new rent = GetPVarInt(playerid, "Rent");
return Houses[house][EHouseOwnerSQLID] == GetPVarInt(playerid, "CharID") || rent == Houses[house][EHouseSQLID];
}
new msg[128];
if(Houses[house][EHouseLocked] == 1) {
format(msg, sizeof(msg), "* %s reaches over to %s pocket as he/she takes out a key, moving it to the door lock afterwards to unlock the door.", GetPlayerNameEx(playerid, ENameType_RPName), getPossiveAdjective(playerid));
ProxMessage(15.0, playerid, msg, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid, "~w~House ~g~Unlocked", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
Houses[house][EHouseLocked] = 0;
} else {
format(msg, sizeof(msg), "* %s reaches over to %s pocket as he/she takes out a key, moving it to the door lock afterwards to lock the door.", GetPlayerNameEx(playerid, ENameType_RPName), getPossiveAdjective(playerid));
ProxMessage(15.0, playerid, msg, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid, "~w~House ~r~Locked", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
Houses[house][EHouseLocked] = 1;
}
saveHouseInfo(house);
return 1;
if(!hasHouseKeys(playerid, house) && GetPVarInt(playerid, "Faction") != 2 && GetPVarInt(playerid, "Faction") != 1) {
SendClientMessage(playerid, X11_TOMATO_2, "This is not your house!");
return 1;
}
YCMD:givehousekeys(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_WHITE, "Gives house keys");
return 1;
}
new HaveRented[playerid];
if(YourVariableOfCheckingthatisistheplayerhouse[playerid] == 1 || if(HaveRented[playerid] == 1) // if one of the situations is true it'll return to more code
OnPlayerDisconnect(playerid)
Well we can't create the whole code, but atleast we can give you a Example,
First create a variable like this PHP код:
PHP код:
PHP код:
So now this will gonna be a Temporary Rent system |