SA-MP Forums Archive
SetTimerEx does not display the correct variable's value - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetTimerEx does not display the correct variable's value (/showthread.php?tid=260126)



SetTimerEx does not display the correct variable's value - HP - 07.06.2011

pawn Код:
public OnGameModeInit()
{
    print("It's about to start the timer now, I suppose..");
    SetTimerEx("for_testing_purposes", 500, false, "is", 666, "Message for testing purposes!");
   
    return 1;
}

forward for_testing_purposes(integer, string[]);
public for_testing_purposes(integer, string[])
{
    printf("Integer: %i; String: %s", integer, string);
    return 1;
}
Just a simple timer for testing purposes, as you can see, but there's something wrong with passing the string. If you take a look at the server console print, you can see, that it's not passing the value of string correctly.

Quote:

[17:51:08] It's about to start the timer now, I suppose..
[17:51:08] Integer: 666; String:
1.03.0011

I've had similar problems with my enums and variables. Exempli gratia if I've set the variables value to 1, it will print 48 or something close to that.

Does anyone know what could cause the problem? It only occurs in the script, I'm developing.


Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

It looks like your SVN is down or something, and it still does not explain why I had problems with regular variables in an enum..

Quote:

Oops! ****** Chrome could not find svn.y-less.com




Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

Quote:

Authorization Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

Can't ignore it, keeps asking for username and password.


Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

I was wondering, why it's asking for login details, got it now anyway.

As for the deferred function, it won't recognize it as defined or maybe it's just related to me. Is it still necessary to forward it or what's the problem? I did forward it, but it still occurs this problem. What about using arrays, I shouldn't use "string:" tag there, right?

Quote:

...\...pwn(69) : error 017: undefined symbol "for_testing_purposes"
...\...pwn(74) : error 010: invalid function or declaration
...\...pwn(77) : error 010: invalid function or declaration




Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

Quote:

for_testing_purposes(666, "Message for testing purposes!");

4 char.


Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

I kind of understood it and I did use the first one.


Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

I did and something interesting just happened.

I re-downloaded "y_timers" and it required (did not occur before) "y_amx" and "y_scriptinit". After adding them, it crashes the compiler when compiling.


Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

I downloaded the whole package and it gives me a warning about "y_hooks". I even tried to replace it with YSI 1.0, but then it just crashes the compiler, again... Probably, because it's modified for "y_timers".

Quote:

..\pawno\include\YSI\y_hooks.inc(2770) : warning 235: public function lacks forward declaration (symbol "OnPlayerLogin")
..\pawno\include\YSI\y_hooks.inc(282 : warning 235: public function lacks forward declaration (symbol "OnPlayerLogout")




Re: SetTimerEx does not display the correct variable's value - HP - 07.06.2011

Ignore the other post..
It's missing "y_defines" include..

Quote:

..\pawno\include\YSI\y_hooks.inc(73) : fatal error 100: cannot read from file: "YSI\internal\y_defines"




Re: SetTimerEx does not display the correct variable's value - DRIFT_HUNTER - 07.06.2011

Well for me its works fine....im on windows 7 ultimate 32bit and latest samp package....