12.06.2015, 21:30
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.
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; }