SA-MP Forums Archive
House Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: House Help (/showthread.php?tid=406060)



House Help - AphexCCFC - 08.01.2013

Hello. I have this:

pawn Код:
CMD:housewithdraw(playerid, params[])
{
    new id = Player[playerid][Houseid];
    new i = GetClosetHouseID(playerid);
    if(id == 999) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You don't have a house.");
    new string[128],money;
    if(!IsPlayerInRangeOfPoint(playerid,30.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not inside your house.");
    if(sscanf(params, "i",money)) return SendClientMessage(playerid, COLOR_TWGRAY, "Usage{FFFFFF}: /housewithdraw [Cash Amount]");
    if(money > House[id][Money]) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: Your safe doesn't contain enough money for this.");
    if(money < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: You have entered an invalid amount.");
    House[id][Money] -= money;
    PlayerInfo[playerid][pCash] += money;
    format(string, sizeof(string), "* %s withdraws some cash from their house safe.", GetName(playerid));
    ProxDetector(30, playerid, string, COLOR_PURPLE);
    CheckHouse(id);
    return 1;
}
If I own a house and go to another house then type /housewithdraw and /housedeposit it works without recognising me as owner.