AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Engine ----> fakemeta (https://forums.alliedmods.net/showthread.php?t=92403)

_lol_ 05-14-2009 20:57

Engine ----> fakemeta
 
PHP Code:

entity_set_float(idEV_FL_fuser20.0)        // Disable slow down after jumping
    // Code from CBasePlayer::Jump (player.cpp)        Make a player jump automatically
    
if (entity_get_int(idEV_INT_button) & 2
    {    
// If holding jump
        
new flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE
        
if ( entity_get_int(idEV_INT_waterlevel) >= )
            return 
PLUGIN_CONTINUE
        
if ( !(flags FL_ONGROUND) )
            return 
PLUGIN_CONTINUE

        
new Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
velocity[2] += 260.0
        entity_set_vector
(idEV_VEC_velocityvelocity)
        
entity_set_int(idEV_INT_gaitsequence6)    // Play the Jump Animation
    



posible in fakemeta or other module?

hlstriker 05-14-2009 21:48

Re: Engine ----> fakemeta
 
Edit: Thanks, IneedHelp ;)

Direct port:
PHP Code:

set_pev(idpev_fuser20.0)
if(
pev(idpev_button) & 2)
{
    new 
flags pev(idpev_flags)
    
    if(
flags FL_WATERJUMP)
        return 
PLUGIN_CONTINUE
    
if(pev(idpev_waterlevel) >= 2)
        return 
PLUGIN_CONTINUE
    
if(!(flags FL_ONGROUND))
        return 
PLUGIN_CONTINUE
    
    
new Float:velocity[3]
    
pev(idpev_velocityvelocity)
    
velocity[2] += 260.0
    set_pev
(idpev_velocityvelocity)
    
set_pev(idpev_gaitsequence6)



IneedHelp 05-14-2009 22:03

Re: Engine ----> fakemeta
 
You forgot this line (pev(id, pev_flags))

PHP Code:

new flags entity_get_int(idEV_INT_flags

EDIT: You fixed it :D

Emp` 05-14-2009 23:47

Re: Engine ----> fakemeta
 
Quote:

Originally Posted by _lol_ (Post 827628)
posible in fakemeta or other module?

Is there a reason why you don't want to use engine?

hleV 05-15-2009 07:20

Re: Engine ----> fakemeta
 
FM is easier IMO. Is there a reason not to use it?

Hunter-Digital 05-15-2009 07:33

Re: Engine ----> fakemeta
 
FM is more difficult AND much more sensible to failures, that means, one small mistake and your sever goes boom :lol:... also [set_]pev() is slower than entity_[get|set]_*() from what I've seen in profiles

Arkshine 05-15-2009 07:47

Re: Engine ----> fakemeta
 
Well engine is more faster than fakemeta ( a bit ) since fakemeta generates more code for each native.

SnoW 05-15-2009 10:10

Re: Engine ----> fakemeta
 
Quote:

Originally Posted by hleV (Post 827817)
FM is easier IMO. Is there a reason not to use it?

IMO yes there is. If the code is already engine and faster, what can be the reason to transfer it to fakemeta and do extra work?

_lol_ 05-15-2009 11:52

Re: Engine ----> fakemeta
 
thanks men, i want to use fakemeta because the plugin (zp-12k of lines)already includes the fakemeta module, but not the engine, and i dont want to include engine for only 10 lines....

rain of +k :D

SnoW 05-15-2009 12:49

Re: Engine ----> fakemeta
 
Quote:

Originally Posted by _lol_ (Post 827947)
thanks men, i want to use fakemeta because the plugin (zp-12k of lines)already includes the fakemeta module, but not the engine, and i dont want to include engine for only 10 lines....

Ye, and you shouldn't do that. You should include engine and use the engine code. If you wanna transfer code from module to module, instead of that transfer the hole other code from fakemeta to engine.
It doesn't matter if you use only one native from the module and include it, since the module is enabled and other plugins use it anyway.


All times are GMT -4. The time now is 01:31.

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