Thread: VAC Ban Status
View Single Post
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-27-2009 , 11:35   Re: VAC Ban Status
Reply With Quote #12

Quote:
Originally Posted by Brad View Post
Yes, they work on single characters.
I don't think so, str_to_num takes an array, not a single chars as parameter.

And the reason I used this is that I'm manually copying every converted char to a single array element. If using str_to_num, I'd have to make a 2-element array, and just read the first one, and call a native and go all the way back to the VM again.

EDIT: A little optimization if you guys prefere it:
PHP Code:
num_to_char(num)
{
    if(
num || num 9)
        return 
'^0'

    
return('0' num)
}

char_to_num(char)
{
    if(
char '0' || char '9')
        return 
0
    
    
return (char '0')

__________________

Community / No support through PM

Last edited by danielkza; 01-27-2009 at 11:43.
danielkza is offline