Question about Text: clickedid
#8

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
Because IDC must be defined as a textdraw too:
PHP код:
new Text:IDC clickedid TD[GunHome][1]; 
I haven't come across a situation where that was needed, so I'm not 100% sure this will work properly. It seems odd to subtract two textdraws from each other.
You don't substract textdraws. You substract regular numbers (IDs in this case). He's getting the index of the first TextDraw for GunHome.

The only Tag you have to be careful with is Float, all other Tags in SAMP (Text3D, Menu etc) are just regular IDs like objects and vehicles. Some items have Tags to seperate them for us, but after compiling there is no difference to "normal" IDs. They don't even exist during run-time.


Quote:
Originally Posted by vasyok28
Посмотреть сообщение
Thank you very much, I decided to issue.

PHP код:
    if(clickedid >= TD[GunHome][1] && clickedid <= TD[GunHome][6])
    {
        new 
Text:IDC clickedid TD[GunHome][1];
        if(
_:IDC == -1) return 1;
        
printf("%d"_:IDC);
    } 
If you want to further calculate stuff with the IDC variable, you can do the following too:

PHP код:
    if(clickedid >= TD[GunHome][1] && clickedid <= TD[GunHome][6])
    {
        new 
IDC _:(clickedid TD[GunHome][1]);
        if(
IDC == -1) return 1;
        
printf("%d"IDC);
    } 
So you only need to convert the tags once, after that IDC can be used without any more Tag conversion.
In this example it doesn't matter, but if you are going to use IDC a few times more it's annoying to always put "_:" too.
Reply


Messages In This Thread
Question about Text: clickedid - by vasyok28 - 28.10.2016, 09:32
Re: Question about Text: clickedid - by iLearner - 28.10.2016, 09:34
Re: Question about Text: clickedid - by AndySedeyn - 28.10.2016, 09:38
Re: Question about Text: clickedid - by vasyok28 - 28.10.2016, 09:39
Re: Question about Text: clickedid - by vasyok28 - 28.10.2016, 09:48
Re: Question about Text: clickedid - by AndySedeyn - 28.10.2016, 09:57
Re: Question about Text: clickedid - by vasyok28 - 28.10.2016, 10:01
Re: Question about Text: clickedid - by NaS - 28.10.2016, 14:17
Re: Question about Text: clickedid - by AndySedeyn - 28.10.2016, 15:44

Forum Jump:


Users browsing this thread: 1 Guest(s)