Raised This Month: $ Target: $400
 0% 

gravity and knockback problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-07-2011 , 11:01   gravity and knockback problem
Reply With Quote #1

so i made 2 natives to get user knockback and gravity but they seem to return some random numbers instead of the actual gravity or knockback
please help me
here are the codes
PS: i tried without floatround too and it's the same result
PHP Code:
// Native: zpnm_get_user_gravity
public Float:native_get_user_gravity(id)
{
    
// ZP disabled
    
if (!g_pluginenabled)
        return -
1.0;
    
    if (!
is_user_valid_connected(id)
    || !
is_user_valid_alive(id))
        return 
0.0;
    
    if (
g_nemesis[id] || g_survivor[id] || g_sniper[id])
        return 
floatround(Float:pev(idpev_gravity)) * 800.0;
    else if (
g_zombie[id])
        return 
floatround(Float:ArrayGetCell(g_zclass_gravg_zombieclass[id])) * 800.0;
    else
        return 
floatround(Float:ArrayGetCell(g_hclass_gravg_humanclass[id])) * 800.0;
    
    return 
1.0;
}

// Native: zpnm_get_user_knockback
public Float:native_get_user_knockback(id)
{
    
// ZP disabled
    
if (!g_pluginenabled)
        return -
1.0;
    
    if (!
is_user_valid_connected(id)
    || !
is_user_valid_alive(id)
    || !
g_zombie[id])
        return 
0.0;
    
    if (
g_nemesis[id])
        return 
g_cached_nemkb[id];
    else
        return 
g_zombie_knockback[id];
    
    return 
1.0;

and the plugin i'm using to return the values:
PHP Code:
#include <amxmodx>
#include <zombieplaguenm>

public plugin_init()
{
    
register_plugin("[ZPNM] Sub-Plugin: Class Info""1.0""9 3 () |2 9 ! /<")
    
register_clcmd("say info""clcmd_info")
}

public 
clcmd_info(id)
{
    static 
name[32]
    
zpnm_get_user_class_name(idnamecharsmax(name))
    
    
client_print(idprint_chat"[ZPNM] Class name: %s"name)
    
client_print(idprint_chat"[ZPNM] Class speed: %d"zpnm_get_user_maxspeed(id))
    
client_print(idprint_chat"[ZPNM] Class gravity: %d"Float:zpnm_get_user_gravity(id))
    if (
zp_get_user_zombie(id))
        
client_print(idprint_chat"[ZPNM] Class knockback: %d"zpnm_get_user_knockback(id[LIST=1][/LIST]))

screenshots:
Attached Thumbnails
Click image for larger version

Name:	de_inferno_cz0000.jpg
Views:	141
Size:	53.4 KB
ID:	84471   Click image for larger version

Name:	de_inferno_cz0001.jpg
Views:	118
Size:	57.0 KB
ID:	84472   Click image for larger version

Name:	de_inferno_cz0002.jpg
Views:	128
Size:	31.3 KB
ID:	84473   Click image for larger version

Name:	de_inferno_cz0003.jpg
Views:	96
Size:	52.9 KB
ID:	84474   Click image for larger version

Name:	de_inferno_cz0004.jpg
Views:	110
Size:	56.5 KB
ID:	84475  

__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
 


Thread Tools
Display Modes

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 19:47.


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