10.09.2017, 14:07
PHP код:
hasHouseKeys(playerid, house) {
new rent = GetPVarInt(playerid, "Rent");
return Houses[house][EHouseOwnerSQLID] == GetPVarInt(playerid, "CharID") || rent == Houses[house][EHouseSQLID];
}
PHP код:
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;
PHP код:
if(!hasHouseKeys(playerid, house) && GetPVarInt(playerid, "Faction") != 2 && GetPVarInt(playerid, "Faction") != 1) {
SendClientMessage(playerid, X11_TOMATO_2, "This is not your house!");
return 1;
}
PHP код:
YCMD:givehousekeys(playerid, params[], help) {
if(help) {
SendClientMessage(playerid, X11_WHITE, "Gives house keys");
return 1;
}