Raised This Month: $ Target: $400
 0% 

Read FLOAT from file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-15-2013 , 06:05   Re: Read FLOAT from file
Reply With Quote #4

2 solutions, in both you need to tag it as Float in the task callback because task index can only be an integer, else you would have to pass it as task parameter.

So :

Either you declare it as integer :
PHP Code:
    new file fopen(map_file"r")
    if (
file) {
        new 
r_origin_x
        fread
(filer_origin_xBLOCK_INT)
        
        
set_task(10.0"task_Announce"r_origin_x)
        
        
fclose(file)
    }  

public 
task_Announce(r_origin_x)
{
    
client_print(0print_chat"READED: %f"Float:r_origin_x)

Either you cast it :

PHP Code:
    new file fopen(map_file"r")
    if (
file) {
        new 
Float:r_origin_x
        fread
(file_:r_origin_xBLOCK_INT)
        
        
set_task(10.0"task_Announce"_:r_origin_x)
        
        
fclose(file)
    }  

public 
task_Announce(r_origin_x)
{
    
client_print(0print_chat"READED: %f"Float:r_origin_x)

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-15-2013 at 06:06.
ConnorMcLeod is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode