Raised This Month: $ Target: $400
 0% 

get_gametime()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-09-2006 , 13:45   get_gametime()
Reply With Quote #1

It would just print out "diff = 0.000"
Whats wrong?
Code:
public plugin_init() {     register_plugin("test", "1.00", "[ --<-@ ]")     set_task(1.0, "test") } public test() {     start_timer()         new text1[32]         new i_file = fopen("addons/amxmodx/test.txt", "r");     new i_file2 = fopen("addons/amxmodx/result1.txt", "w");         if ( ! i_file )         return;         while ( ! feof(i_file) ) {         fgets(i_file, text1, 31);         fprintf(i_file2, "%s", text1)     }         fclose(i_file);     fclose(i_file2);         stop_timer() } new Float:start, Float:stop public start_timer()     start = get_gametime()     public stop_timer() {     stop = get_gametime()     new Float:diff = floatsub(start, stop)     server_print("diff = %f", diff) }

Last edited by [ --<-@ ] Black Rose; 12-09-2006 at 13:48.
[ --<-@ ] Black Rose is offline
 


Thread Tools
Display Modes

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 06:50.


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