message flooding bug..
#1

Hey again need help...

VIDEO:
https://*********/WUqOK94zlgA

Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	if(clickedid == Darbo_TD[playerid][6])
	{
		SendClientMessage(playerid, -1, "Press button");
		CancelSelectTextDraw(playerid);
		for(new s = 0; s < 15; s++) TextDrawHideForPlayer(playerid, Darbo_TD[playerid][s]);
		return 1;
	}
 	else if(clickedid == Text:INVALID_TEXT_DRAW)
	{
		SendClientMessage(playerid, -1, "Press Esc");
		CancelSelectTextDraw(playerid);
		for(new s = 0; s < 15; s++) TextDrawHideForPlayer(playerid, Darbo_TD[playerid][s]);
		return 1;
	}
	return 1;
Reply
#2

Try.
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	if(clickedid == Darbo_TD[playerid][6])
	{
		CancelSelectTextDraw(playerid);
		for(new s = 0; s < 15; s++) TextDrawHideForPlayer(playerid, Darbo_TD[playerid][s]);
                SendClientMessage(playerid, -1, "Press button");
		return 1;
	}
 	else if(clickedid == Text:INVALID_TEXT_DRAW)
	{
		CancelSelectTextDraw(playerid);
		for(new s = 0; s < 15; s++) TextDrawHideForPlayer(playerid, Darbo_TD[playerid][s]);
                SendClientMessage(playerid, -1, "Press Esc");
		return 1;
	}
	return 1;
        }
Reply
#3

ZeMunaC no still flooding
Reply
#4

you don't need else
PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == Darbo_TD[playerid][6])
    {
        
CancelSelectTextDraw(playerid);
        for(new 
015s++) TextDrawHideForPlayer(playeridDarbo_TD[playerid][s]);
                
SendClientMessage(playerid, -1"Press button");
        return 
1;
    }
     if(
clickedid == Text:INVALID_TEXT_DRAW)
    {
        
CancelSelectTextDraw(playerid);
        for(new 
015s++) TextDrawHideForPlayer(playeridDarbo_TD[playerid][s]);
                
SendClientMessage(playerid, -1"Press Esc");
        return 
1;
    }
    return 
1;

Reply
#5

jlalt still flooding
Reply
#6

may it cuz of this for(new.... try this one:
PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == Darbo_TD[playerid][6])
    {
        
CancelSelectTextDraw(playerid);
        
SendClientMessage(playerid, -1"Press button");
        for(new 
015s++) { TextDrawHideForPlayer(playeridDarbo_TD[playerid][s]); }
        return 
1;
    }
     if(
clickedid == Text:INVALID_TEXT_DRAW)
    {
        
CancelSelectTextDraw(playerid);
        
SendClientMessage(playerid, -1"Press Esc");
        for(new 
015s++) { TextDrawHideForPlayer(playeridDarbo_TD[playerid][s]); }
        return 
1;
    }
    return 
1;

Reply
#7

You can simply remove SendClientMessages,don't see reason why are you using them?
Reply
#8

because, i need text.. and if i remove problem still here..
Reply
#9

You must not use CancelSelectTextDraw if the clickedid is INVALID_TEXT_DRAW, because CancelSelectTextDraw calls OnPlayerClickTextdraw again with INVALID_TEXT_DRAW, thus creating an infinite loop. This is also outlined on the wiki page: https://sampwiki.blast.hk/wiki/CancelSelectTextDraw
Reply
#10

Vince thanks.. its fixed.. but i dont know why if i press button its send 2 messages

Код:
SendClientMessage(playerid, -1, "Press Esc");

SendClientMessage(playerid, -1, "Press button");
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)