Detecting strings using tagof
#6

I actually found a very nice way to do it.

Here is an example to test:

pawn Код:
stock MySQL_SaveCharacterStat(playerid, field[], E_CHARACTER_INFO:stat, format[])
{
    switch(format[0])
    {
        case 'i', 'd': printf("%d", gCharacterInfo[playerid][stat]);
        case 'f': printf("%f", gCharacterInfo[playerid][stat]);
        case 's': printf("%s", gCharacterInfo[playerid][stat]);
    }
}
Tested, working great
Reply


Messages In This Thread
Detecting strings using tagof - by Maxips2 - 21.03.2013, 13:30
Re: Detecting strings using tagof - by Misiur - 21.03.2013, 13:33
Re: Detecting strings using tagof - by Maxips2 - 21.03.2013, 13:38
Re: Detecting strings using tagof - by Misiur - 21.03.2013, 13:42
Re: Detecting strings using tagof - by Maxips2 - 21.03.2013, 14:01
Re: Detecting strings using tagof - by Maxips2 - 21.03.2013, 14:10
Re: Detecting strings using tagof - by Misiur - 21.03.2013, 14:21
Re: Detecting strings using tagof - by Maxips2 - 21.03.2013, 14:22
Re: Detecting strings using tagof - by Misiur - 21.03.2013, 14:28

Forum Jump:


Users browsing this thread: 2 Guest(s)