Message repeats itself over and over.
#7

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
can you show me whole command?And tell me where you place the cmd?
sure:

Код:
command(buyhouse, playerid, params[])
{
	new string[128];
    new pName[MAX_PLAYER_NAME]; //For the player's name - For the house
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME); //Get the name of the player and store it in pName
    for(new i = 0; i < MAX_HOUSES; i++) //Last time I'm gonna say it: Loop through all the houses
    {
        if(IsPlayerInRangeOfPoint(i, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir]) //Is player near house entrance, and if player is in interior of that house + virtual world (Last time I said this too!)
		{
            if(GetPlayerMoney(playerid) < HouseInfo[i][hPrice]) return SendClientMessage(playerid, GREY, "SERVER:{FFFFFF} You don't have enough money for this house!"); //Has player too less money? Send him a message!
			if(HouseInfo[i][hOwned]) return SendClientMessage(playerid, GREY, "SERVER:{FFFFFF} You are not near a buyable house!");
            HouseInfo[i][hOwned] = true; //The house is owned, where the player used /buyhouse
            strmid(HouseInfo[i][hOwner], pName, 0, false, strlen(pName)); //Put the players name into the "hOwner" of the house
            GivePlayerMoney(playerid, -HouseInfo[i][hPrice]); //Remove some money of the player.. The value of the house
            SendClientMessage(playerid, GREY, "House bought!"); //Send the player an message.
            SaveHouse(i);
            LoadHouseVisual(i, true); //Load House Visual. Now, I've added ', true': It will RELOAD now!
            return 1;
        }
        else
        {
            format(string, sizeof(string), "SERVER:{FFFFFF} You are not near a buyable house!");
            SendClientMessage(playerid, GREY, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Message repeats itself over and over. - by OMonger - 15.08.2015, 16:32
Re: Message repeats itself over and over. - by Dziugsas - 15.08.2015, 16:34
Re: Message repeats itself over and over. - by OMonger - 15.08.2015, 16:36
Re: Message repeats itself over and over. - by Dziugsas - 15.08.2015, 16:38
Re: Message repeats itself over and over. - by OMonger - 15.08.2015, 16:46
Re: Message repeats itself over and over. - by Dziugsas - 15.08.2015, 16:50
Re: Message repeats itself over and over. - by OMonger - 15.08.2015, 17:08
Re: Message repeats itself over and over. - by Dziugsas - 15.08.2015, 17:12
Re: Message repeats itself over and over. - by OMonger - 15.08.2015, 19:04
Re: Message repeats itself over and over. - by dominik523 - 15.08.2015, 19:20

Forum Jump:


Users browsing this thread: 1 Guest(s)