It Keep Spamming
#1

PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    for(new 
0MAX_HOUSES;i++)
    {
        if(
pickupid == HouseBuyable[playerid])
        {
            new 
pName[24];
            
GetPlayerName(playerid,pName,24);
            
            if(
HInfo[playerid][Owned] == 0)
            {
                new 
string[128];
                
format(string,sizeof(string),"{FF0000}[System] {00FF00}You Can Buy This House For {FFFF00}$%i, {00FF00}Type \"{FFFF00}/buyh{00FF00}\" To Buy This House",HInfo[i][Price]);
                
SendClientMessage(playerid,-1,string);
            }
        }
        if(
pickupid == HouseUnBuyable[i])
        {
            new 
pName[24];
            
GetPlayerName(playerid,pName,24);
            if(
HInfo[i][Owned] == && strcmp(HInfo[i][Owner],pName) == 0)
            {
                
ShowPlayerDialog(playerid,DIALOG_C-ENTER,DIALOG_STYLE_MSGBOX,"{00FF00}House System","{FF0000}Are You Sure To Enter To Your House?","Yes","No");
            }
            if(
HInfo[i][Owned] == && strcmp(HInfo[i][Owner],pName) != 0)
            {
                
SendClientMessage(playerid,-1,"You don't own this house");
            }
        }
    }
    return 
1;

Reply
#2

anyone?!
Reply
#3

Provide more info please.
Reply
#4

what is spamming?

provide more information please
Reply
#5

whole code
http://pastebin.com/eJwjCDA7
Reply
#6

He's sending messages inside a loop - what do you guys think is spamming?

You've set MAX_HOUSES to 10000. This means that the loop will run 10000 times.

Please explain what you want to happen. What's the point of looping? What is HouseBuyable and HouseUnbuyable supposed to do?
Reply
#7

HouseBuyable = Creating Green Pickup
HouseUnBuyable = creating Blue Pickup
Reply
#8

pawn Код:
if(pickupid == HouseBuyable[playerid])
Then what the hell is this?

Anyway. Try using return or break to stop the loop.
Reply
#9

I get spam messages from formats i just return 1; after SendClientMessage problem solved for me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)