Raised This Month: $ Target: $400
 0% 

Why this doesn't work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 03-25-2011 , 10:26   Why this doesn't work?
Reply With Quote #1

PHP Code:
public Gravity_set(id)
{
       if(
get_user_gravity(id) == 1.0)
       {
       
set_user_gravity(id0.50)
       }

Why this code doesn't work?
KviZ is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 03-25-2011 , 11:11   Re: Why this doesn't work?
Reply With Quote #2

Show your full code..
__________________
<VeCo> is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-25-2011 , 11:45   Re: Why this doesn't work?
Reply With Quote #3

The function is probably not being called
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 03-25-2011 , 12:01   Re: Why this doesn't work?
Reply With Quote #4

Well, how can I call it whenever player's gravity is 800?
KviZ is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-25-2011 , 12:21   Re: Why this doesn't work?
Reply With Quote #5

Then get_user_gravity will return 1.0.
Again, the function is probably not being called.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 03-25-2011 , 12:24   Re: Why this doesn't work?
Reply With Quote #6

I don't understand :/
KviZ is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-25-2011 , 13:33   Re: Why this doesn't work?
Reply With Quote #7

Post all the code and we'll take a look at it.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 03-25-2011 , 15:55   Re: Why this doesn't work?
Reply With Quote #8

PHP Code:
/*================================================================================
    
    -----------------------------------
    -*- [BB] Default Zombie Classes -*-
    -----------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This plugin adds the default zombie classes from Zombie Plague
    into Base Builder. All credit belongs to MeRcyLeZZ.
    
    All classes have been balanced, but feel free to edit them if
    you are not satisfied.
    
================================================================================*/

#include <amxmodx>
#include <basebuilder>
#include <hamsandwich>
#include <fun>
#include <cstrike>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

// Classic Zombie Attributes
new const zclass1_name[] = { "Classic Zombie" }
new const 
zclass1_info[] = { "HP: 4000 Speed: 260" }
new const 
zclass1_model[] = { "bb_classic" }
new const 
zclass1_clawmodel[] = { "v_bloodyhands" }
const 
zclass1_health 4000
const zclass1_speed 260
const Float:zclass1_gravity 1.0
const zclass1_adminflags ADMIN_ALL

// Fast Zombie Attributes
new const zclass2_name[] = { "Fast Zombie" }
new const 
zclass2_info[] = { "HP: 3000 Speed: 325" }
new const 
zclass2_model[] = { "bb_fast" }
new const 
zclass2_clawmodel[] = { "v_bloodyhands" }
const 
zclass2_health 3000
const zclass2_speed 325
const Float:zclass2_gravity 1.0
const zclass2_adminflags ADMIN_ALL

// Jumper Zombie Attributes
new const zclass3_name[] = { "Jumper Zombie" }
new const 
zclass3_info[] = { "HP: 3500 Speed: 285 Gravity: 0.5x" }
new const 
zclass3_model[] = { "bb_jumper" }
new const 
zclass3_clawmodel[] = { "v_bloodyhands" }
const 
zclass3_health 3500
const zclass3_speed 285
const Float:zclass3_gravity 0.5
const zclass3_adminflags ADMIN_ALL

// Tanker Zombie Attributes
new const zclass4_name[] = { "Tanker Zombie" }
new const 
zclass4_info[] = { "HP: 5000 Speed: 210" }
new const 
zclass4_model[] = { "bb_tanker" }
new const 
zclass4_clawmodel[] = { "v_bloodyhands" }
const 
zclass4_health 5000
const zclass4_speed 210
const Float:zclass4_gravity 1.0
const zclass4_adminflags ADMIN_ALL
#define TANK_ARMOR 200

/*============================================================================*/

new g_zclass_tanker
new g_zclass_grav

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    
register_plugin("[BB] Default Zombie Classes""6.5""Tirant")
    
    
// Register all classes
    
bb_register_zombie_class(zclass1_namezclass1_infozclass1_modelzclass1_clawmodelzclass1_healthzclass1_speedzclass1_gravity0.0zclass1_adminflags)
    
bb_register_zombie_class(zclass2_namezclass2_infozclass2_modelzclass2_clawmodelzclass2_healthzclass2_speedzclass2_gravity0.0zclass2_adminflags)
    
g_zclass_grav bb_register_zombie_class(zclass3_namezclass3_infozclass3_modelzclass3_clawmodelzclass3_healthzclass3_speedzclass3_gravity0.0zclass3_adminflags)
    
g_zclass_tanker bb_register_zombie_class(zclass4_namezclass4_infozclass4_modelzclass4_clawmodelzclass4_healthzclass4_speedzclass4_gravity0.0zclass4_adminflags)
}

#if defined TANK_ARMOR
public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""ham_PlayerSpawn_Post"1)
}

public 
Gravity_set(id)
{
    if (
bb_is_user_zombie(id) && bb_get_user_zombie_class(id) == g_zclass_grav && get_user_gravity(id) == 1)
    {
        
set_user_gravity(id0.5);
    }
}

public 
ham_PlayerSpawn_Post(id)
{
    if (!
is_user_alive(id))
        return ;
        
    if (
bb_is_user_zombie(id) && bb_get_user_zombie_class(id) == g_zclass_tanker)
    {
        
give_item(id"item_assaultsuit");
        
cs_set_user_armor(idTANK_ARMORCS_ARMOR_VESTHELM);
    }
}
#endif 
KviZ is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 03-25-2011 , 16:09   Re: Why this doesn't work?
Reply With Quote #9

Like i said before, you're not calling the Gravity_set function. That's why it doesn't work.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
KviZ
Senior Member
Join Date: Feb 2011
Location: Lithuania
Old 03-25-2011 , 17:08   Re: Why this doesn't work?
Reply With Quote #10

So how can I call it?
KviZ 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 14:40.


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