F5 and clickable TDs
#1

So there is a simple bug.
If you move your mouse to clickable TD and then hold F5, TD will be selected anyway wherever your mouse is and you can click on it even it was hidden by code.
I found out it and, hopefully, made some checks to prevent this.
For all, who has clickable TDs in gamemode, write some checks or server will do unexpected things (or crash).
Reply
#2

I can't reproduce this, as I'm not exactly sure what you mean. Can you give step-by-step instructions?
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
I can't reproduce this, as I'm not exactly sure what you mean. Can you give step-by-step instructions?
Ok.
1. Create code with clickable TD and send client message when player clicks on it and then hide this TD (but don't cancel TD selection).
2. Move mouse pointer to clickable TD.
3. Hold F5.
4. Click LMB. TD will disappear.
5. Click LMB again. You will see client message that shouldn't be sent.
6. Optional: move mouse to another position (but hold F5 still), click LMB, and you will see client message again.
Reply
#4

Does F5 have a special function that I'm not aware of? I don't think many players are running around holding F5 all the time ...
Reply
#5

It appears to lock the currently selected TD then you can move the mouse anywhere and click to activate the TD it doesn't seem to really be much of an issue though.
Reply
#6

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
It appears to lock the currently selected TD then you can move the mouse anywhere and click to activate the TD it doesn't seem to really be much of an issue though.
And if you hide this TD by code it still can be selected but this shouldn't be.
Reply
#7

You can simply fix this by setting textdrawcontrollable or whatever it was to 0 on player update,it would use onplayerupdate and maybe it can use abit cpu.

Edit:

this function

https://sampwiki.blast.hk/wiki/TextDrawSetSelectable
Reply
#8

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
You can simply fix this by setting textdrawcontrollable or whatever it was to 0 on player update,it would use onplayerupdate and maybe it can use abit cpu.

Edit:

this function

https://sampwiki.blast.hk/wiki/TextDrawSetSelectable
UPD: That won't help. Still can be selected.
Reply
#9

So, I don't see any person who tried to check this bug...
Ok, I made a video. Maybe now you will believe...
[ame]http://www.youtube.com/watch?v=cc_YLf8pFQc[/ame]
Script code:
PHP код:
#define FILTERSCRIPT
#include <a_samp>
new Text:Textdraw0;
public 
OnFilterScriptInit()
{
    
Textdraw0 TextDrawCreate(313.000000166.250015"Clickable TD");
    
TextDrawLetterSize(Textdraw01.0315003.618333);
    
TextDrawTextSize(Textdraw030.500000298.083007);
    
TextDrawAlignment(Textdraw02);
    
TextDrawColor(Textdraw0, -1);
    
TextDrawUseBox(Textdraw0true);
    
TextDrawBoxColor(Textdraw00);
    
TextDrawSetShadow(Textdraw00);
    
TextDrawSetOutline(Textdraw01);
    
TextDrawBackgroundColor(Textdraw051);
    
TextDrawFont(Textdraw02);
    
TextDrawSetProportional(Textdraw01);
    
TextDrawSetSelectable(Textdraw0true);
    return 
1;
}
public 
OnPlayerCommandText(playerid,cmdtext[])
{
    if(!
strcmp(cmdtext,"/choose",true))
    {
        
TextDrawShowForPlayer(playerid,Textdraw0);
        
SelectTextDraw(playerid,0x73B1EDFF);
        return 
1;
    }
    return 
0;
}
public 
OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == Textdraw0)
    {
        
TextDrawHideForPlayer(playerid,Textdraw0);
        
SendClientMessage(playerid,-1,"Textdraw0 was selected and hidden.");
        return 
1;
    }
    return 
1;

And how you can see, client sends data about TD clicking when it's hidden...
Reply
#10

Well, I broke some servers with that bug...Anyone?
Reply
#11

Interesting... I don't have time to check it and I don't have any selectable textdraws in my server, but I'll keep this in my head for when I will use them.

Thanks for the report. Maybe this will be fixed somewhere in the future. Until the fix, servers should really look into this stuff and try to avoid it.
Reply
#12

Quote:
Originally Posted by SDraw
View Post
Well, I broke some servers with that bug...Anyone?
Interesting.... because our server had the same problem 1 week ago.
Reply
#13

Quote:
Originally Posted by dannyk0ed
View Post
Interesting.... because our server had the same problem 1 week ago.
Naaah, they were Russian servers....
Reply
#14

How can you broke a server abusing of this bug? All the players online will have the same problem if you do it once?
Reply
#15

Quote:
Originally Posted by DiGiTaL_AnGeL
View Post
How can you broke a server abusing of this bug? All the players online will have the same problem if you do it once?
As I think on servers that I broke code was so stupid that servers gone to recursion
Reply
#16

Quote:
Originally Posted by SDraw
View Post
Naaah, they were Russian servers....
Ah. Okay.
Reply
#17

Quote:
Originally Posted by Basssiiie
View Post
Interesting... I don't have time to check it and I don't have any selectable textdraws in my server, but I'll keep this in my head for when I will use them.

Thanks for the report. Maybe this will be fixed somewhere in the future. Until the fix, servers should really look into this stuff and try to avoid it.
This should really be fixed, because server can't detect people pressing F5 so it's impossible to be fixed with any script.
Yeah, clicking a disappeared textdraw can mess up some GUI systems. Some argue that players don't press F5 very frequently, but it's not the problem. The problem is griefers will always use any possible bugs like this to mess your server up, so it should be fixed.

Btw, I can't accept people breaking any server with bugs purposely, no matter who owns the server. If you have one, you'll know the feeling, and simply say, people can always do the same thing (or more "funny" things) to you. So behave yourself.
Reply
#18

Quote:
Originally Posted by leong124
View Post
This should really be fixed, because server can't detect people pressing F5 so it's impossible to be fixed with any script.
Yeah, clicking a disappeared textdraw can mess up some GUI systems. Some argue that players don't press F5 very frequently, but it's not the problem. The problem is griefers will always use any possible bugs like this to mess your server up, so it should be fixed.
If the script is supposed to hide the textdraw after you press it, then you can add an extra variable and check for the player after it has been pressed once. The bug here is that OnPlayerClickTextDraw gets spammed when pressing while in F5 mode. In some servers this can cause problems, because you expect the textdraw to hide after the first OnPlayerClickTextDraw, while it doesn't.

Quote:
Originally Posted by leong124
View Post
Btw, I can't accept people breaking any server with bugs purposely, no matter who owns the server. If you have one, you'll know the feeling, and simply say, people can always do the same thing (or more "funny" things) to you. So behave yourself.
To be honest: it's bad yes, but if he didn't do it, you probably hadn't responded to this thread either? Anyway, the world is a difficult place. Sometimes rules have to be broken before people realize that this has to be prevented. It's just how the world works, sadly enough.
Reply
#19

Quote:
Originally Posted by Basssiiie
View Post
If the script is supposed to hide the textdraw after you press it, then you can add an extra variable and check for the player after it has been pressed once. The bug here is that OnPlayerClickTextDraw gets spammed when pressing while in F5 mode. In some servers this can cause problems, because you expect the textdraw to hide after the first OnPlayerClickTextDraw, while it doesn't.
It's then fixable with scripts and it will not be fixed officially. If people can spam the callback, use GetTickCount and ban them or don't do anything if they frequently click the same TD. Yet another fix for fixes.inc.

Quote:
Originally Posted by Basssiiie
View Post
To be honest: it's bad yes, but if he didn't do it, you probably hadn't responded to this thread either? Anyway, the world is a difficult place. Sometimes rules have to be broken before people realize that this has to be prevented. It's just how the world works, sadly enough.
True, but even the world is evil, it doesn't mean you have to be. Yes, only after people using some new kind of cheats in my server, I can develop new anti-cheat. However, does that mean if you have a cheat, you have to mess up a server? If you have a DoS software, does that mean you must DoS someone? Probably not.
What I suggest is to tell the others after knowing some bugs that can mess up servers.

For me, even if I really hate some servers, I'll never attack them in these ways. Words are much stronger. Sorry I'm too serious for this lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)