House Storage?
#1

Okay So i made a house storage system were you can deposit money but the prob is the money gets saved for all the houses not the playerid's house only

Ex: Private deposited 5 $ into his house
C0d3r checked his house wealth and found that he has 5$ in it
i need it to be saved for the player's house only.


Код:
CMD:hdeposit(playerid, params[])
{
        new string[2001], money;
        new houseid;
		if(sscanf(params, "i",money)) return SendClientMessage(playerid, RED, "Usage: /hdeposit [Money]");
		if(GetPlayerCash(playerid) < 1) return SendClientMessage(playerid, RED, "You dont have any cash to deposit into Your house");
		if(GetPVarInt(playerid, "IsInHouse") == 0) return SendClientMessage(playerid, RED, "You need to be in a house to use this command.");
		if(strcmp(GetHouseOwner(GetPVarInt(playerid, "LastHouseCP")), GetName(playerid), false)) return SendClientMessage(playerid, RED, "You dont own this house.");
		{
        HouseInfo[houseid][hMoney] + money;
        format(string,sizeof(string),"You have deposit in the safe $%d.Now you have $%d",money,HouseInfo[playerid][houseid][hMoney]);
        SendClientMessage(playerid,-1,string);
        SaveHouseStats(houseid);
        GivePlayerCash(playerid, -money);
        }
		return 1;
}

CMD:hwithdraw(playerid, params[])
{
        new houseid;
        new string[2000], money;
		if(sscanf(params, "i",money)) return SendClientMessage(playerid, RED, "Usage: /hwithdraw [Money]");
		if(HouseInfo[houseid][hMoney] < 1) return SendClientMessage(playerid, RED, "You dont have any money in Your house storage");
		if(GetPVarInt(playerid, "IsInHouse") == 0) return SendClientMessage(playerid, RED, "You need to be in a house to use this command.");
		if(strcmp(GetHouseOwner(GetPVarInt(playerid, "LastHouseCP")), GetName(playerid), false)) return SendClientMessage(playerid, RED, "You dont own this house.");
		{
        HouseInfo[houseid][hMoney] - money;
        GivePlayerCash(playerid, money);
		format(string,sizeof(string),"You have take from Your house safe $%d. Money in your safe = $%d.",money,HouseInfo[houseid][hMoney]);
        SendClientMessage(playerid,-1,string);
        SaveHouseStats(houseid);
        }
		return 1;
}
Reply


Messages In This Thread
House Storage? - by MohammedZ - 12.06.2015, 21:30
Re: House Storage? - by MohammedZ - 13.06.2015, 09:36
Re: House Storage? - by Ritzy2K - 13.06.2015, 17:01
Re: House Storage? - by MohammedZ - 13.06.2015, 18:03
Re: House Storage? - by Alpay0098 - 13.06.2015, 18:28
Re: House Storage? - by MohammedZ - 13.06.2015, 18:50

Forum Jump:


Users browsing this thread: 1 Guest(s)