Raised This Month: $51 Target: $400
 12% 

Orpheu: Using virtual functions


Post New Thread Reply   
 
Thread Tools Display Modes
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-14-2010 , 17:47   Re: Orpheu: Using virtual functions
Reply With Quote #31

Quote:
Originally Posted by Dr.G View Post
yea should work

K ill have to look into it im going to try to completly recode my Vff into this new module.

In take damage it registers when i shoot some one how ever if i add in something like


Quote:
Originally Posted by Dr.G View Post
yea should work

K ill have to look into it im going to try to completly recode my Vff into this new module.

In take damage it registers when i shoot some one how ever if i add in something like


PHP Code:
public OnPlayerHurt(victimattackerFloat:Damagedmgbits)
{
           
client_print(attackerprint_chat"You did %f Damage"damage)

It dosent display anything but 0...

victim attacker and the float is in the right spot.. so hmm idk.. also found the set param in the include how ever doing like this dosent work ither
(it has a diff name i know just not looking it up)

PHP Code:
vff get_pcvar_pointer(mp_friendlyfire)

setparam(3, (damage 3.0)*get_pcvar_float(vff)) 
With that it dosent do the second part of the math.

Last edited by Doc-Holiday; 02-14-2010 at 17:54.
Doc-Holiday is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-14-2010 , 19:51   Re: Orpheu: Using virtual functions
Reply With Quote #32

Code:
public OnPlayerHurt(victim, attacker, something, Float:Damage, dmgbits)
{
           client_print(attacker, print_chat, "You did %f Damage", damage)
}
try that..
__________________
Dr.G is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-14-2010 , 19:54   Re: Orpheu: Using virtual functions
Reply With Quote #33

( victim, inflictor, attacker, Float:damage, damagebits )
__________________
Arkshine is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-14-2010 , 20:05   Re: Orpheu: Using virtual functions
Reply With Quote #34

Quote:
Originally Posted by Arkshine View Post
( victim, inflictor, attacker, Float:damage, damagebits )

New i was forgeting something Thank you much....

Thank you now gotta mess aorund with prethink to get it to register button
pushes..

Im going to make a scripting help thread since this is a tut forum... But it will be dedicated to learning Orpheu... and Virtual Functions.

That way we dont tie all this forum up.
Doc-Holiday is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-15-2010 , 00:48   Re: Orpheu: Using virtual functions
Reply With Quote #35

Quote:
Originally Posted by Dr.G View Post
The Spawn function is pre when i tested it on dod.


PHP Code:
/* Plugin generated by AMXX-Studio */
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <amxmodx>
#include <Orpheu>
////////////////////////////////////////////////////////////////////////////////////////////////////
#define PLUGIN "DoD Orpheu testing"
#define VERSION "1.0 by Dr.G"
#define AUTHOR "AMXX DoD Team"
////////////////////////////////////////////////////////////////////////////////////////////////////
/* NOTE: */
/* CBasePlayer::PreThink(void) -> Offset WIN32 = 132 */

/* CBasePlayer::Spawn(void) -> Offset WIN32 = 3 */

/* CBasePlayer::Killed(entvars_s *, int) -> Offset WIN32 = 20 */

/* THESE are offsets for Day of Defeat! */
////////////////////////////////////////////////////////////////////////////////////////////////////
new i[33] = 0
new time_to_run 
new counter[33] = 0
new is_alive[33] = 0
////////////////////////////////////////////////////////////////////////////////////////////////////
public plugin_init() 
{
    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    new 
OrpheuFunction:iThink OrpheuGetFunctionFromClass("player""PreThink""CBasePlayer" )
    
OrpheuRegisterHook(iThink,"think_Player")
    
    new 
OrpheuFunction:Player_Spawn OrpheuGetFunctionFromClass("player""Spawn""CBasePlayer" )
    
OrpheuRegisterHook(Player_Spawn,"Spawn")
    
    new 
OrpheuFunction:Player_Killed OrpheuGetFunctionFromClass("player","Killed""CBasePlayer" )
    
OrpheuRegisterHook(Player_Killed,"player_Killed")
    
    
time_to_run register_cvar("time_to_run","30")
    
    
register_clcmd("say /thinktest","start_Test")
    
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public start_Test(id)
{
    
set_taskget_pcvar_float(time_to_run), "stop_Test"id )
    
counter[id] = 0
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public stop_Test(id)
{
    
client_print(id3"*Thinks per Sec: %d", (counter[id]/get_pcvar_num(time_to_run)))
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public Spawn(player//looks like its pre..
{
    
set_task(1.0"Spawn_Delayed"player)
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public Spawn_Delayed(id)
    
is_alive[id] = is_user_alive(id)
////////////////////////////////////////////////////////////////////////////////////////////////////
public think_Player(player)
{
    
counter[player]++
    
    
    if(
i[player] == 600)
    {
        
i[player] = 0
        
        
if(is_alive[player])
        {
            
client_print(player3"*Thinkin' and alive..")
            return
        }
        else
            
client_print(player3"*Thinkin' and dead..")
        
    }
    
i[player]++
    
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public player_Killed(victimkillersomething)
{
    
is_alive[victim] = 0
    client_print
(victim3"*You died!")
}
//////////////////////////////////////////////////////////////////////////////////////////////////// 

How bout? Im going to test real fast
Code:
native OrpheuHook:OrpheuRegisterHook(OrpheuFunction:function,hookFunctionName[],OrpheuHookPhase:phase = OrpheuHookPre)

enum OrpheuHookPhase
{
    OrpheuHookPre,
    OrpheuHookPost
}
PHP Code:
new OrpheuFunction:Player_SpawnOrpheuGetFunctionFromClass("player""Spawn""CBasePlayer" );
    
OrpheuRegisterHook(Player_Spawn,"OnPlayerSpawn"OrpheuHookPost); 

Last edited by Doc-Holiday; 02-15-2010 at 00:50.
Doc-Holiday is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-05-2010 , 21:40   Re: Orpheu: Using virtual functions
Reply With Quote #36

Is this a valid way to get property offsets?
I don't get it...
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-06-2010 , 01:37   Re: Orpheu: Using virtual functions
Reply With Quote #37

Edit: Wait for Arkshine's tutorial
__________________

Last edited by joaquimandrade; 03-06-2010 at 08:15.
joaquimandrade is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-06-2010 , 06:34   Re: Orpheu: Using virtual functions
Reply With Quote #38

Damn, I wanted to make a surprise with a planned tutorial.
__________________
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-06-2010 , 09:22   Re: Orpheu: Using virtual functions
Reply With Quote #39

I'm always one step ahead
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Old 07-26-2013, 13:20
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: troll, or posting random confusing code, or posting for posts count
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-26-2013 , 14:13   Re: Orpheu: Using virtual functions
Reply With Quote #40

Calling when you touch a weapon on the ground.
__________________
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 14:24.


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