problem teleport to a position reading from file with io_read
#3

PHP код:
    if(!strcmp(cmdtext"/gopos"true))
    {
        if(
fexist("mypos.txt"))
        {
            new 
File:IFile fopen("mypos.txt"io_read), str[128];

            while(
fread(IFilestr))
            {
                if(
str[0] == '#') continue;

                new 
Float:XFloat:YFloat:Z;
                if(
sscanf(str"fff",XYZ))
                {
                                
SetPlayerPos(playeridXYZ);
                }
                else
                {
                    
printf("(i) Invalid Line: %s"str);                     
                }
            }

            
fclose(IFile);
        }
        return 
1;
    } 
I dont know if it will work but try
Thank you
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)