Raised This Month: $ Target: $400
 0% 

Orpheu error!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-24-2012 , 09:01   Orpheu error!
Reply With Quote #1

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)
__________________
kiki33hun is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-24-2012 , 10:41   Re: Orpheu error!
Reply With Quote #2

Tried myself fastly and you will have to use Rage because Orpheu doesn't support value passed by reference.
__________________
Arkshine is offline
Old 09-24-2012, 11:04
kiki33hun
This message has been deleted by kiki33hun. Reason: np
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-24-2012 , 12:40   Re: Orpheu error!
Reply With Quote #3

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
__________________
kiki33hun is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-24-2012 , 13:09   Re: Orpheu error!
Reply With Quote #4

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)
__________________
Arkshine is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-24-2012 , 13:54   Re: Orpheu error!
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
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?
__________________
kiki33hun is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-24-2012 , 16:31   Re: Orpheu error!
Reply With Quote #6

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 ); }
Attached Files
File Type: zip handler.Void__Int-ptr-SRC.zip (50.1 KB, 74 views)
File Type: zip SV_CountPlayers+handler.Void__Int-Ptr-BIN.zip (43.6 KB, 90 views)
__________________

Last edited by Arkshine; 09-25-2012 at 17:17.
Arkshine is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-25-2012 , 09:44   Re: Orpheu error!
Reply With Quote #7

Okey, worked, and how to change current count?
__________________
kiki33hun is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-25-2012 , 10:19   Re: Orpheu error!
Reply With Quote #8

Hooking pre + RageSetParam + supercede.
__________________
Arkshine is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-25-2012 , 12:25   Re: Orpheu error!
Reply With Quote #9

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)
__________________
kiki33hun is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-25-2012 , 12:41   Re: Orpheu error!
Reply With Quote #10

...

Seriously, do some effort. Look at the function header before trying randomly.
__________________
Arkshine is offline
Reply



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 08:22.


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