Get a variable's tag...
#1

I did a quick search but I didn't really come across anything. Basically, I would like to be able to determine a variable's tag.

For example:

pawn Код:
new
    bool:varName,
    Float:varName2
;
varName is has a bool tag, varName2 has a float tag. Is there a function in PAWN I can use to determine what those are for particular variables?
Reply
#2

I don't think you can. Why would you need it, anyway?
Reply
#3

Quote:
Originally Posted by eblood1
Посмотреть сообщение
I don't think you can. Why would you need it, anyway?
Originally, I had a piece of code that basically goes through an enum and clears each piece of data, but some of the data has a "Timer:" tag that corresponds with the timers I have using y_timers. I wanted to make sure I could go through the enum in a loop and search to see if the tag equaled "Timer:" and if it did, it would just use the "stop" function y_timers has.

Nevertheless, I have found a solution around that. I'm still interested to see if this is even possible, though.

EDIT: Thanks ******, I'll check it out.

EDIT 2: Okay, this piece of code crashes the compiler... I tried it with a Float: tag, but that didn't work either...

pawn Код:
new
    Timer:tempTimerVar;
   
for(new i = 0; enumPlayerInfo:i < enumPlayerInfo; i++)
{
    if(tagof(enumPlayerInfo:i) == tagof(tempTimerVar))
    {
        stop pStats[playerid][enumPlayerInfo:i];
        continue;
    }
       
    pStats[playerid][enumPlayerInfo:i] = 0;
}
Reply
#4

Oh okay, that makes sense. It's getting late here, maybe I should go to sleep...

Thanks anyways, but it seems I don't even need to do this now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)