AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem orpheu CheckWinConditions (https://forums.alliedmods.net/showthread.php?t=277936)

Night90 01-20-2016 17:25

Problem orpheu CheckWinConditions
 
Hello, i have problem with my plugin.

The error log is:

Code:

[ORPHEU] Function "CHalfLifeMultiplay::CheckWinConditions" not found
 [AMXX] Run time error 10 (plugin "deathmatch.amxx") (native "OrpheuGetFunction") - debug not enabled!

I have server with linux and my version orpheu is v2.3a

Here is my file CheckWinConditions:
Code:

{
    "name"    : "CheckWinConditions",
    "class"  : "CGameRules",
    "library" : "mod",
    "indexes" :
    [
        {
            "os"    : "windows",
            "mod"  : "cstrike",
            "value" : 65
        },
        {
            "os"    : "linux",
            "mod"  : "cstrike",
            "value" : 65
        }
    ]
}


Arkshine 01-20-2016 17:37

Re: Problem orpheu CheckWinConditions
 
Where is the config file? How hook is registered?

Night90 01-20-2016 18:00

Re: Problem orpheu CheckWinConditions
 
Sorry but my english is not very well.

Can you give me some tip what config and hook you want ?

klippy 01-20-2016 18:12

Re: Problem orpheu CheckWinConditions
 
Arkshine asked for the location of CheckWinConditions file. It should be located in addons/amxmodx/configs/orpheu/virtualFunctions/CGameRules/ folder. Where is yours currently?

Night90 01-20-2016 18:15

Re: Problem orpheu CheckWinConditions
 
Quote:

Originally Posted by KliPPy (Post 2385002)
Arkshine asked for the location of CheckWinConditions file. It should be located in addons/amxmodx/configs/orpheu/virtualFunctions/CGameRules/ folder. Where is yours currently?

The file is in that location.

Here is photo:
http://screenshu.com/static/uploads/.../xn/q07n6e.jpg

klippy 01-20-2016 18:24

Re: Problem orpheu CheckWinConditions
 
I guess you are retrieving the function in your plugin in such way (or similar):
PHP Code:

OrpheuGetFunctionFromObject(g_pGameRules"CheckWinConditions""CHalfLifeMultiplay"); 

I think the last parameter has to be "CGameRules" instead of "CHalfLifeMultiplay". Not sure though, I don't know how Orpheu deals with class inheritance.
Show us how you retrieve the function in your code.

Night90 01-20-2016 18:29

Re: Problem orpheu CheckWinConditions
 
Here is

Code:

        OrpheuRegisterHook(OrpheuGetFunction("CheckMapConditions", "CHalfLifeMultiplay"), "game_blockConditions");
        OrpheuRegisterHook(OrpheuGetFunction("CheckWinConditions", "CHalfLifeMultiplay"), "game_blockConditions");
        OrpheuRegisterHook(OrpheuGetFunction("HasRoundTimeExpired", "CHalfLifeMultiplay"), "game_blockConditions");


klippy 01-20-2016 18:32

Re: Problem orpheu CheckWinConditions
 
As I said, try "CGameRules" instead of "CHalfLifeMultiplay" in the second (CheckWinConditions) call.

Night90 01-21-2016 02:23

Re: Problem orpheu CheckWinConditions
 
It doesn't work, I tried it.
Code:

Function "CGameRules::CheckWinConditions" not found

klippy 01-21-2016 05:06

Re: Problem orpheu CheckWinConditions
 
Oh wait, these are virtual functions, I don't think you should retrieve them like that, but rather from an object.
Look at this topic where Joaqim shows how to get a CGameRules object. You'll see that he uses OrpheuRegisterHookFromObject() to hook a virtual function.


All times are GMT -4. The time now is 09:33.

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