Raised This Month: $32 Target: $400
 8% 

Damage by the amount of money 1.5


Post New Thread Reply   
 
Thread Tools Display Modes
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-08-2009 , 21:34   Re: Damage by the amount of money 1.1
Reply With Quote #11

Plugin updated at the version 1.1. Check the main post
__________________
alan_el_more is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-08-2009 , 21:53   Re: Damage by the amount of money 1.1
Reply With Quote #12

Sounds good.

alan_el_more is back xdd

G.J
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 04-08-2009 , 22:28   Re: Damage by the amount of money 1.1
Reply With Quote #13

He means this work for zombie plague when zp_buy_custom is off.

ON:

Nice plugin! GJ
AlejandroSk is offline
Send a message via MSN to AlejandroSk
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-08-2009 , 22:42   Re: Damage by the amount of money 1.0
Reply With Quote #14

PHP Code:
switch(cs_get_user_money(id))
{
    case 
5000..10000:
    {
        
PlayerLevels[id] = Level1
    
}
    case 
10001..14000:
    {
        
PlayerLevels[id] = Level2
    
}
    case 
14001..16000:
    {
        
PlayerLevels[id] = Level3
    
}
    default:
    {
        
PlayerLevels[id] = Level0;
    }

For large ranges such as these, it's best to use if().
PHP Code:
new money cs_get_user_money(id);
if( 
money 5000 )
{
    
PlayerLevels[id] = Level0;
}
else if( 
money <= 10000 )
{
    
PlayerLevels[id] = Level1;
}
else if( 
money <= 14000 )
{
    
PlayerLevels[id] = Level2;
}
else
{
    
PlayerLevels[id] = Level3;

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-08-2009 , 22:55   Re: Damage by the amount of money 1.0
Reply With Quote #15

Quote:
Originally Posted by Exolent[jNr] View Post
PHP Code:
switch(cs_get_user_money(id))
{
    case 
5000..10000:
    {
        
PlayerLevels[id] = Level1
    
}
    case 
10001..14000:
    {
        
PlayerLevels[id] = Level2
    
}
    case 
14001..16000:
    {
        
PlayerLevels[id] = Level3
    
}
    default:
    {
        
PlayerLevels[id] = Level0;
    }

For large ranges such as these, it's best to use if().
PHP Code:
new money cs_get_user_money(id);
if( 
money 5000 )
{
    
PlayerLevels[id] = Level0;
}
else if( 
money <= 10000 )
{
    
PlayerLevels[id] = Level1;
}
else if( 
money <= 14000 )
{
    
PlayerLevels[id] = Level2;
}
else
{
    
PlayerLevels[id] = Level3;

I don't know if that's true. But, if it is, its fault of the compiler.
__________________

Last edited by joaquimandrade; 04-08-2009 at 23:05.
joaquimandrade is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 04-08-2009 , 22:55   Re: Damage by the amount of money 1.1
Reply With Quote #16

anyway it should be

PHP Code:
if(money <= 5000)
    
PlayerLevels[id] = Level0;

else if(
money >= 5001 && money <= 10000)
{
    
PlayerLevels[id] = Level1;
}
else if(
money >= 10001 && money <= 14000)
{
    
PlayerLevels[id] = Level2;
}
else if(
money >= 14001)
{
    
PlayerLevels[id] = Level3;

__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-08-2009 , 22:56   Re: Damage by the amount of money 1.1
Reply With Quote #17

Quote:
Originally Posted by Starsailor View Post
should be
PHP Code:
if(money <= 5000)
    
PlayerLevels[id] = Level0;

else if(
money >= 5001 && money <= 10000)
{
    
PlayerLevels[id] = Level1;
}
else if(
money >= 10001 && money <= 14000)
{
    
PlayerLevels[id] = Level2;
}
else if(
money >= 14001)
{
    
PlayerLevels[id] = Level3;

Not.
__________________
joaquimandrade is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 04-08-2009 , 22:58   Re: Damage by the amount of money 1.1
Reply With Quote #18

Quote:
Originally Posted by joaquimandrade
Not.
why ?
__________________
Find my plugins here..

Ex - Spanish Moderator.
Starsailor is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-08-2009 , 23:02   Re: Damage by the amount of money 1.1
Reply With Quote #19

Quote:
Originally Posted by Starsailor View Post
why ?
PHP Code:
if(money <= 5000)
    
PlayerLevels[id] = Level0;

else if(
money >= 5001 && money <= 10000)
{
    
PlayerLevels[id] = Level1;

If it doesn't enter in the first if clause, the money is more than 5000 so no need to check it again.
__________________
joaquimandrade is offline
DotPT
Member
Join Date: Feb 2009
Old 04-09-2009 , 04:01   Re: Damage by the amount of money 1.1
Reply With Quote #20

After you optimize the code, why not include cvars for the different levels?
DotPT is offline
Reply


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 20:54.


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