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

Convert to fake meta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
twix_p
Member
Join Date: Jul 2011
Old 03-11-2012 , 08:13   Convert to fake meta
Reply With Quote #1

Can someone help me to convert this to fakemeta?

PHP Code:
public client_PostThink(id)
{
    if(!
is_user_alive(id)) 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

I tried that but not works.


PHP Code:
public client_PostThink(id)
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE
    
if(dojump[id] == true)
    {
        new 
Float:vAngles[3]    
        
pev(idpev_anglesvAngles)
        
vAngles[2] = random_float(265.0,285.0)
        
pev(idpev_velocityvAngles)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE

Thanks in advance!
twix_p is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-11-2012 , 08:22   Re: Convert to fake meta
Reply With Quote #2

The fist would be more fast. Engine native are more fast than fakemeta one since it involves generally less code.
__________________

Last edited by Arkshine; 03-11-2012 at 08:23.
Arkshine is offline
twix_p
Member
Join Date: Jul 2011
Old 03-11-2012 , 08:31   Re: Convert to fake meta
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
The fist would be more fast. Engine native are more fast than fakemeta one since it involves generally less code.
I use engine in my server only for this function and I think it will be much better if I remove completely this module.
Do you know other way to do this?

Last edited by twix_p; 12-09-2012 at 06:41.
twix_p is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-11-2012 , 08:42   Re: Convert to fake meta
Reply With Quote #4

Much better in what ? You say that based on what evidence ? Tell me.

About your second code, you retrieve an angle and not the velocity...
__________________
Arkshine is offline
twix_p
Member
Join Date: Jul 2011
Old 03-11-2012 , 08:57   Re: Convert to fake meta
Reply With Quote #5

Does not matter, I will try again to make it.
twix_p is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-11-2012 , 09:13   Re: Convert to fake meta
Reply With Quote #6

It does matter, angle and velocity are different things. Also, you don't set the new value you do. You can find already a billion of threads telling entity_get_*== pev and entity_set* == set_pev.
__________________
Arkshine is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 03-11-2012 , 11:00   Re: Convert to fake meta
Reply With Quote #7

If you really care about the efficiency, don't make your server working on amxx level, at least amxx plugins level, better to code module. The best way is to ignore metamod, coding a metamod-like module directly sitting between engine and game mod.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang 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 22:08.


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