Raised This Month: $ Target: $400
 0% 

Engine ----> fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_lol_
Senior Member
Join Date: Apr 2009
Old 05-22-2009 , 13:07   Engine ----> fakemeta
Reply With Quote #1

possible?

PHP Code:
public client_PreThink(id)
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE
    
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
    
new nbut get_user_button(id)
    new 
obut get_user_oldbutton(id)
    if((
nbut IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < get_cvar_num("amx_maxjumps"))
        {
            
dojump[id] = true
            jumpnum
[id]++
            return 
PLUGIN_CONTINUE
        
}
    }
    if((
nbut IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        
jumpnum[id] = 0
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
client_PostThink(id)
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE
    
if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
    
if(dojump[id] == true)
    {
        new 
Float:velocity[3]    
        
entity_get_vector(id,EV_VEC_velocity,velocity)
        
velocity[2] = random_float(265.0,285.0)
        
entity_set_vector(id,EV_VEC_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE

__________________
_lol_ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-22-2009 , 13:14   Re: Engine ----> fakemeta
Reply With Quote #2

There is not benefit to use fakemeta instead of engine.
Arkshine is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 05-22-2009 , 13:17   Re: Engine ----> fakemeta
Reply With Quote #3

Quote:
Originally Posted by _lol_ View Post
possible?
1. Yes, of course it is possible. Any engine code can be converted to fakemeta.
2. arkshine is right
__________________
stupok is offline
_lol_
Senior Member
Join Date: Apr 2009
Old 05-22-2009 , 13:25   Re: Engine ----> fakemeta
Reply With Quote #4

i only want to learn fakemeta, could you help me or not...
__________________
_lol_ is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 05-22-2009 , 13:29   Re: Engine ----> fakemeta
Reply With Quote #5

There are many Engine to Fakemeta threads. Just use search next time..

You'll find the pev constants here.
set_pev ( index, value, [ ... ] )
pev ( index, value, [ ... ] )

You'll need to use these:
pev_flags
pev_velocity
__________________

Last edited by [X]-RayCat; 05-22-2009 at 13:34.
[X]-RayCat is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 05-22-2009 , 13:33   Re: Engine ----> fakemeta
Reply With Quote #6

Engine is faster than fakemeta.
Spunky is offline
Send a message via AIM to Spunky
_lol_
Senior Member
Join Date: Apr 2009
Old 05-22-2009 , 13:49   Re: Engine ----> fakemeta
Reply With Quote #7

it doesnt work, what is bad

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
    
register_plugin("MultiJump","1.1","MasI")
    
register_cvar("amx_maxjumps","50")
}

public 
client_putinserver(id)
{
    
jumpnum[id] = 0
    dojump
[id] = false
}

public 
client_disconnect(id)
{
    
jumpnum[id] = 0
    dojump
[id] = false
}

public 
client_PreThink(id)
{
    if(!
is_user_alive(id)) 
        return 
PLUGIN_CONTINUE
    
new nbut pev(idpev_button)
    new 
obut pev(idpev_oldbuttons)
    new 
flags pev(idpev_flags)
    if((
nbut IN_JUMP) && !(flags FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < get_cvar_num("amx_maxjumps"))
        {
            
dojump[id] = true
            jumpnum
[id]++
            return 
PLUGIN_CONTINUE
        
}
    }
    if((
nbut IN_JUMP) && (flags FL_ONGROUND))
    {
        
jumpnum[id] = 0
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
client_PostThink(id)
{
    if(!
is_user_alive(id)) 
        return 
PLUGIN_CONTINUE
        
    
if(dojump[id] == true)
    {
        new 
Float:velocity[3]
        
pev(idpev_velocity)
        
velocity[2] = random_float(265.0,285.0)
        
set_pev(idpev_velocityvelocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE

__________________
_lol_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-22-2009 , 14:07   Re: Engine ----> fakemeta
Reply With Quote #8

client_PreThink is an engine forward, you still have to include engine unless it is used by another plugin.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 05-22-2009 , 14:16   Re: Engine ----> fakemeta
Reply With Quote #9

Try this:

I might have messed up your checks with the flags, buttons, and oldbuttons when I tried to optimize them.

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> new jumpnum[33] = 0 new bool:dojump[33] = false new cvar_maxjumps public plugin_init() {     register_plugin("MultiJump","1.1","MasI")     cvar_maxjumps = register_cvar("amx_maxjumps","50")         register_forward(FM_PlayerPreThink, "forward_PreThink")     register_forward(FM_PlayerPostThink, "forward_PostThink") } public client_putinserver(id) {     jumpnum[id] = 0     dojump[id] = false } public client_disconnect(id) {     jumpnum[id] = 0     dojump[id] = false } public forward_PreThink(id) {     if(!is_user_alive(id))         return FMRES_IGNORED         new nbut = pev(id, pev_button)     new obut = pev(id, pev_oldbuttons)     new flags = pev(id, pev_flags)     if(nbut & IN_JUMP)     {         if(flags & FL_ONGROUND)         {             jumpnum[id] = 0         }         else if(!(obut & IN_JUMP) && jumpnum[id] < get_pcvar_num(cvar_maxjumps))         {             dojump[id] = true             jumpnum[id]++         }     }         return FMRES_IGNORED } public forward_PostThink(id) {     if(!is_user_alive(id))         return FMRES_IGNORED         if(dojump[id] == true)     {         new Float:velocity[3]         pev(id, pev_velocity, velocity)         velocity[2] = random_float(265.0,285.0)         set_pev(id, pev_velocity, velocity)         dojump[id] = false     }         return FMRES_IGNORED }
__________________
stupok 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 01:29.


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