Question about Text: clickedid
#1

Hello! In OnPlayerClickTextDraw(playerid, Text:clickedid) used Text:clickedid, i suppose you want to display: printf("%d", clickedid); and writes: warning 213: tag mismatch

sorry for my English
Reply
#2

Clickedid, think again.
Reply
#3

clickedid is a textdraw. You can forcefully remove the tag by doing:
PHP код:
printf("%d"_:clickedid); 
But I doubt that will give you the correct results. Give it a shot.
Reply
#4

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Clickedid, think again.
I know that clickedid transmits ID.

My goal is to make the design of this type:

PHP код:
    if(clickedid >= TD[GunHome][1] && clickedid <= TD[GunHome][6])
    {
        new 
IDC Clickedid TD[GunHome][1];
        if(
IDC == -1) return 1;
        
printf("%d"IDC);
    } 
Reply
#5

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
clickedid is a textdraw. You can forcefully remove the tag by doing:
PHP код:
printf("%d"_:clickedid); 
But I doubt that will give you the correct results. Give it a shot.
I incorrectly stated your question, in this case, it will work without warning
PHP код:
printf("%d"_:clickedid); 
But what to do if you want to compare ?

PHP код:
    if(clickedid >= TD[GunHome][1] && clickedid <= TD[GunHome][6]) 
    { 
        new 
IDC = [B]clickedid[/B] - TD[GunHome][1]; 
        if(
IDC == -1) return 1
        
printf("%d"IDC); 
    } 
If you delete a tag, it will be warning 213: tag mismatch
PHP код:
new IDC = [B]_:clickedid[/B] - TD[GunHome][1]; 
Sorry for my last question wrong
Reply
#6

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.
Reply
#7

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);
    } 
Reply
#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
#9

Quote:
Originally Posted by NaS
Посмотреть сообщение
-
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)