Raised This Month: $ Target: $400
 0% 

[HELP] how optimize/change this code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
LudaGe
Senior Member
Join Date: May 2010
Location: World so cold
Old 12-02-2010 , 22:39   [HELP] how optimize/change this code?
Reply With Quote #1

Hi guys
I m using this code for set hp, speed, grav. in Gun XP Mod
but i dont like this form...

PHP Code:
// Set HP, Speed and Gravity
public Sethpspdgr(id)
{
    if (
g_PlayerLevel[id] >= 1)
    {
    
set_user_health(id120)
    
set_pev(idpev_maxspeed245.0)
    
set_user_gravity(id0.95)
    }
    if (
g_PlayerLevel[id] >= 2)
    {
    
set_user_health(id140)
    
set_pev(idpev_maxspeed250.0)
    
set_user_gravity(id0.9)
    }
    if (
g_PlayerLevel[id] >= 3)
    {
    
//Etc
}

Someone have other method ??

ps:
PHP Code:
public FwPlayerSpawn(id)
{
// Other code
    
Sethpspdgr(id)
// Other code

ps2: sorry my bad english

Last edited by LudaGe; 12-03-2010 at 00:21.
LudaGe is offline
 



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 11:24.


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