[HELP]SendClientMessage keeps spamming
#1

Everytime i go to the house entrance it spams
when it says "this house is for sale" it spams and when it says "House is owned by:%s" it spams also the
checkpoints keeps on blinking
Wat do you guys think is the problem?
Код:
public CustomPickups()
{
    new Float:oldposx, Float:oldposy, Float:oldposz;
    new string[128];
    NameTimer();
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerPos(i, oldposx, oldposy, oldposz);
            new tmpcar = GetPlayerVehicleID(i);
            new key = PlayerInfo[i][pPhousekey];
            if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
            {
                for(new h = 0; h < sizeof(SBizzInfo); h++)
                {
 
                    if(PlayerToPoint(2.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
                    {
                        if(SBizzInfo[h][sbOwned] == 1)
                        {
                            format(string, sizeof(string), "~w~]%s~w~~n~Owner : %s~n~Extortion by : %s~n~Entrance Fee : ~g~$%d ~n~~w~to enter type /enter]",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost]);
                        }
                        else
                        {
                            format(string, sizeof(string), "~w~]%s~w~~n~This Business is for sale~n~Cost: ~g~$%d ~w~Level : %d ~n~to buy this Business type /buybiz]",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
                        }
                        GameTextForPlayer(i, string, 5000, 3);
                        return 1;
                    }
                }
                                            for(new h = 0; h < sizeof(HouseInfo); h++)
                {
                    if(PlayerToPoint(2.0, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
                    {
                        if(HouseInfo[h][hOwned] == 1)
                        {
                            if(HouseInfo[h][hRentabil] == 0)
                            {
                                format(string, sizeof(string),"This House is owned by %s and is not for RENT!.",HouseInfo[h][hOwner]);
                                SendClientMessage(i, COLOR_GREEN, string);
                                SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
 
                            }
                            else
                            {
                        
                            format(string, sizeof(string), "This House is owned by %s and the rent is $%d",HouseInfo[h][hOwner],HouseInfo[h][hRent]);
                            SendClientMessage(i, COLOR_GREEN, string);
                            SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
 
                            }
                            return 1;
                        }
                        else
                        {
                        SendClientMessage(i, COLOR_GREEN, "Would you like to buy this house?");
                        SendClientMessage(i, COLOR_GREEN, "Price show in the text");
                        SendClientMessage(i, COLOR_WHITE, "Avilable Commands:/enter,(/buyhouse)");
                        format(string, sizeof(string), "This House is for sale/or is owned\nPrice: $%d\nLevel:%d\nto buy this house type (/buyhouse) or (/enter) if it owned",HouseInfo[h][hValue],HouseInfo[h][hLevel]);
              housesale = Create3DTextLabel(string, 0xC1C609FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
              SetPlayerCheckpoint(i,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],2.2);
                        }
 
                        return 1;
                    }
                }
Reply
#2

use timers...is one way to stop spamm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)