givemoney help
#1

I am working with a house system selling to players but having this issue...
PHP код:
if(House[i][forsale])
    {
        if(
Player[playerid][playerMoney] >= House[i][saleprice] ) //&& Player[playerid][pID] == House[i][houseOwner]
        
{
            new 
count countplayerHouse(playerid);
            if(
count maxhouse)
            {
                
takeMoney(playeridHouse[i][saleprice]);
                
giveMoney(House[i][houseOwner],House[i][saleprice]);
                new 
nme[100];
                
format(nme,sizeof(nme),"Your house has been bought by %s",Player[playerid][Name]);
                
SendClientMessage(House[i][houseOwner],COLOR_YELLOW,nme);
                
House[i][houseOwner]    = Player[playerid][pID];
                
House[i][houseOwned]    = true;
                
House[i][forsale]        = false;
                
House[i][saleprice]        = House[i][housePrice];
                
format(msgsizeof(msg), CHAT_INFO"[PRESS Y TO ENTER]\n"CHAT_WHITE"ID : "CHAT_YELLOW"%d\n"CHAT_WHITE"Owner : "CHAT_YELLOW"%s\n"CHAT_WHITE"Title : "CHAT_YELLOW"%s"CHAT_WHITE"\nLocation :"CHAT_YELLOW"%s"House[i][houseID], findName(House[i][houseOwner]), House[i][houseTitle], GetXY2DZone(House[i][housePos][0], House[i][housePos][1]));
                
DestroyDynamic3DTextLabel(House[i][houseLabel]);
                
House[i][houseLabel]    = CreateDynamic3DTextLabel(msgCOLOR_WHITEHouse[i][housePos][0], House[i][housePos][1], House[i][housePos][2] + 0.510.0);
                
mysql_format(koneksimsgsizeof(msg), "UPDATE `house` SET `owner` = '%d',`forsale` = '0' ,`saleprice` = '%d',`owned` = '1' where `id` = '%d'"House[i][houseOwner],House[i][housePrice], House[i][houseID]);
                
mysql_query(koneksimsgfalse);
            }
            else
            {
                if(
Player[playerid][english])
                    
//Server(playerid, "You have reached max house.");
                    
SendClientMessage(playerid,COLOR_RED,"You have reached maximum house limit.");
                else
                    
Server(playerid"Kamu telah mencapai batas kepemilikan rumah.");
            }
        } 
In this [/php]giveMoney(House[i][houseOwner],House[i][saleprice]); [/php] is not working
it is a number or id of the player that is saved in mysql
Reply
#2

You will have to loop through all the online players, and check if the one you're searching for is online.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)