/rentroom problem
#1

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:oldposxFloat:oldposyFloat:oldposz;
                    
GetPlayerName(playeridplayernamesizeof(playername));
                    
GetPlayerPos(playeridoldposxoldposyoldposz);
                    for(new 
0sizeof(HouseInfo); h++)
                    {
                        if(
IsPlayerInRangeOfPoint(playerid2HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == && HouseInfo[h][hRentabil] == 1)
                        {
                            if(
PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playernameHouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
                            {
                                
SendClientMessage(playeridCOLOR_WHITE"   You already own a house, type /sellhouse if you want to rent this one.");
                                return 
1;
                            }
                            if(
PlayerInfo[playerid][pLevel] < 4)
                            {
                                
SendClientMessage(playeridCOLOR_LIGHTBLUE"  Trebuie sa detineti level 4 pentru a da /rentroom");
                                return 
1;
                            }
                            if(
PlayerInfo[playerid][pPhousekey] != 255)
                            {
                                
SendClientMessage(playeridCOLOR_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"50003);
                                
PlayerInfo[playerid][pLocal] = h;
                                
PlayerInfo[playerid][pVirWorld] = HouseInfo[h][hWorld];
                                
HouseEntered[playerid] = h;
                                
PlayerInfo[playerid][pInteriorNr] = 39;
                                
SendClientMessage(playeridCOLOR_WHITE"Congratulations, You can enter si exit here anytime.");
                                
SendClientMessage(playeridCOLOR_WHITE"Type /help to review the new property help section.");
                                
OnPlayerUpdateEx(playerid);
                                return 
1;
                            }
                            else
                            {
                                
SendClientMessage(playeridCOLOR_WHITE"You don't have the cash for that");
                                return 
1;
                            }
                        }
                    }
                    }
                    return 
1;
                    } 
Reply
#2

anyone??i want so the maximum money is 500.000$ not in /rentroom at [htakings]
Reply
#3

I don't understand you, but maybe add this somewhere, at the top or somewhere, I am not going through that code! ()
pawn Код:
if( (HouseInfo[h][hTakings]+HouseInfo[h][hRent]) > 500000 ) return SendClientMessage(playerid, COLOR_RED, "RENT: Rent wasn't collected as maximum limit has been reached.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)