Raised This Month: $ Target: $400
 0% 

gravity and knockback problem


Post New Thread Reply   
 
Thread Tools Display Modes
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
Old 04-07-2011, 11:31
dFF
This message has been deleted by dFF.
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 04-07-2011 , 12:09   Re: gravity and knockback problem
Reply With Quote #2

look on the code from zp 4.3
PHP Code:
floatround(Float:ArrayGetCell(g_zclass_gravg_zombieclassnext[id]) * 800.0)
floatround(Float:ArrayGetCell(g_zclass_kbg_zombieclassnext[id]) * 100.0
__________________

Working on:
nothing
schmurgel1983 is offline
Old 04-08-2011, 12:08
georgik57
This message has been deleted by georgik57.
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-08-2011 , 14:09   Re: gravity and knockback problem
Reply With Quote #3

Quote:
Originally Posted by schmurgel1983 View Post
look on the code from zp 4.3
PHP Code:
floatround(Float:ArrayGetCell(g_zclass_gravg_zombieclassnext[id]) * 800.0)
floatround(Float:ArrayGetCell(g_zclass_kbg_zombieclassnext[id]) * 100.0
Attached Images
File Type: jpg fără titlu.jpg (95.9 KB, 114 views)
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
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 19:47.


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