AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Orpheu error! (https://forums.alliedmods.net/showthread.php?t=196687)

kiki33hun 09-24-2012 09:01

Orpheu error!
 
I am need some help, this script dont working!

Code:
public plugin_precache() {     new teszt = OrpheuGetFunctionAddress(OrpheuGetFunction("SV_CountPlayers"))         new address     OrpheuMemoryGetAtAddress(teszt, "SV_CountPlayers", address);     log_to_file("kiki.log", "ERTEKE: %d", teszt); }

and log:
L 09/24/2012 - 14:16:45: [ORPHEU] Invalid memory structure "SV_CountPlayers"
L 09/24/2012 - 14:16:45: [AMXX] Displaying debug trace (plugin "teszt.amxx")
L 09/24/2012 - 14:16:45: [AMXX] Run time error 10: native error (native "OrpheuMemoryGetAtAddress")
L 09/24/2012 - 14:16:45: [AMXX] [0] teszt.sma::plugin_precache (line 24)

Arkshine 09-24-2012 10:41

Re: Orpheu error!
 
Tried myself fastly and you will have to use Rage because Orpheu doesn't support value passed by reference.

kiki33hun 09-24-2012 12:40

Re: Orpheu error!
 
I am probaly, and found this:


Code:
#include <amxmodx> #include <rage> #include <rage_const> new RageFunc:SV_CountPlayers public plugin_init() {     register_plugin("test", "1.0", "Kiki33") } public plugin_precache() {     SV_CountPlayers = RageCreateHook( RageGetFunction("SV_CountPlayers"), "OnSV_CountPlayers", RageHookPost)     } public OnSV_CountPlayers() {     log_to_file("kiki.log", "ERTEKE: %d", RageGetReturn()); }

Log:
[RAGE] Function "SV_CountPlayers" not found in rage

rage errors:
<TAB>The file for the function 'SV_CountPlayers' has an invalid structure

Arkshine 09-24-2012 13:09

Re: Orpheu error!
 
For the second time, this function DOES NOT return a value. The count is passed by reference. Forget about Orpheu, you have to do it with Rage. (So, making an handle Void__Int-ptr)

kiki33hun 09-24-2012 13:54

Re: Orpheu error!
 
Quote:

Originally Posted by Arkshine (Post 1805363)
For the second time, this function DOES NOT return a value. The count is passed by reference. Forget about Orpheu, you have to do it with Rage. (So, making an handle Void__Int-ptr)

Okey, you can help me the handler?

Arkshine 09-24-2012 16:31

Re: Orpheu error!
 
2 Attachment(s)
Unzip *-BIN.zip in /addons.

Example :

Code:
#include <amxmodx> #include <rage> new RageFunc:HandleFuncCountPlayers; public plugin_init() {     register_concmd( "test", "ConsoleCommand_Test" );         HandleFuncCountPlayers = RageGetFunction( "SV_CountPlayers" ); } public ConsoleCommand_Test() {     new count;     RageCall( HandleFuncCountPlayers, count );         log_amx( "count = %d", count ); }

kiki33hun 09-25-2012 09:44

Re: Orpheu error!
 
Okey, worked, and how to change current count?

Arkshine 09-25-2012 10:19

Re: Orpheu error!
 
Hooking pre + RageSetParam + supercede.

kiki33hun 09-25-2012 12:25

Re: Orpheu error!
 
Okey, hook completed, the hook:

RageSetParam(11);
return RageHookSupercede; -> warning 213: tag mismatch
And log:
L 09/25/2012 - 18:23:07: [RAGE HANDLER] Parameter out of range
L 09/25/2012 - 18:23:07: [AMXX] Displaying debug trace (plugin "teszt.amxx")
L 09/25/2012 - 18:23:07: [AMXX] Run time error 10: native error (native "RageSetParam")
L 09/25/2012 - 18:23:07: [AMXX] [0] teszt.sma::OnSV_CountPlayers (line 17)

Arkshine 09-25-2012 12:41

Re: Orpheu error!
 
...

Seriously, do some effort. Look at the function header before trying randomly.


All times are GMT -4. The time now is 08:22.

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