06.10.2013, 12:08
how can i make so maximum money at htakings to be 500.000$?so house is full of money..
PHP код:
if(strcmp(cmd, "/rentroom", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 1 && HouseInfo[h][hRentabil] == 1)
{
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " You already own a house, type /sellhouse if you want to rent this one.");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 4)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, " Trebuie sa detineti level 4 pentru a da /rentroom");
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255)
{
SendClientMessage(playerid, COLOR_GREY, "Ai deja inchiriat Casa!");
return 1;
}
if(GetPlayerCash(playerid) > HouseInfo[h][hRent])
{
PlayerInfo[playerid][pPhousekey] = h;
GivePlayerCash(playerid,-HouseInfo[h][hRent]);
HouseInfo[h][hTakings] = HouseInfo[h][hTakings]+HouseInfo[h][hRent];
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
GameTextForPlayer(playerid, "~w~Welcome Home~n~You can exit at any time by moving to this door si typing /exit", 5000, 3);
PlayerInfo[playerid][pLocal] = h;
PlayerInfo[playerid][pVirWorld] = HouseInfo[h][hWorld];
HouseEntered[playerid] = h;
PlayerInfo[playerid][pInteriorNr] = 39;
SendClientMessage(playerid, COLOR_WHITE, "Congratulations, You can enter si exit here anytime.");
SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new property help section.");
OnPlayerUpdateEx(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
return 1;
}
}
}
}
return 1;
}