Raised This Month: $51 Target: $400
 12% 

Roundstart Money


Post New Thread Reply   
 
Thread Tools Display Modes
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-22-2006 , 10:31  
Reply With Quote #11

UPDATED

ty sir..stupid me with my stupid mistakes.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
VEN
Veteran Member
Join Date: Jan 2005
Old 03-24-2006 , 02:38  
Reply With Quote #12

Code:
    //...     register_event("HLTV", "new_round", "a", "1=0", "2=0") }  public new_round()     //...
VEN is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 03-24-2006 , 07:33  
Reply With Quote #13

k

updated.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 03-31-2006 , 18:18  
Reply With Quote #14

lol, at least your trying.
__________________
bmann_420 is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 04-25-2006 , 19:38  
Reply With Quote #15

Lol.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 04-25-2006 , 20:16  
Reply With Quote #16

SweatyBanana:

The following code could be made more efficient:
Code:
public new_round()  {      new players[32], num, i;        get_players(players,num);              for(i=0;i<num;i++)        givemoney(players[i])}  public givemoney(id)  {        new cVar = get_cvar_num("round_money")        if(cs_get_user_money(id) < cVar)        cs_set_user_money(id, cVar)    }
By changing it to something like this:
Code:
public new_round()  {      new cVar = get_cvar_num("round_money");     new players[32], num, i;        get_players(players,num);            // make sure each player has at least x dollars     for(i=0;i<num;i++)     {         id = players[i];         if(cs_get_user_money(id) < cVar)                cs_set_user_money(id, cVar);     } }
I applaud your attempt to make the code more readible, but in a plugin this small and where the code your factoring out is so small and where the factored out code isn't being called from more than one place, it makes more sense to just comment the code rather than having the overhead of calling another function. Actually the overhead of calling two functions per player.

Make this minor change (not necessarily verbatim as my example) and I'll approve the plugin.
__________________
Brad is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 04-30-2006 , 23:43  
Reply With Quote #17

Oh thank you brad...you are right with your code...no use in setting a players cash to the cvar if they have more money or equal amount of money...

by the way..u forgot to declare id as a new variable


[ UPDATED ]
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-01-2006 , 08:26  
Reply With Quote #18

Thx EKS for telling me how to get it approved..Thx v3x for approval..


+karma to the both of u.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-01-2006 , 15:26   ADDED NEW VERSION
Reply With Quote #19

I added another plugin to the front post...

Now a new download to keep people from going past the limit.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 05-08-2006 , 18:11  
Reply With Quote #20

Anyone try this out?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
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 16:06.


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