SA-MP Forums Archive
/rentroom problem - 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: /rentroom problem (/showthread.php?tid=468067)



/rentroom problem - Akcent_Voltaj - 06.10.2013

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;
                    } 



Re: /rentroom problem - Akcent_Voltaj - 07.10.2013

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


Re: /rentroom problem - RajatPawar - 07.10.2013

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.");