Raised This Month: $ Target: $400
 0% 

money problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sb123
Senior Member
Join Date: Jan 2007
Old 06-05-2009 , 03:26   money problem
Reply With Quote #1

hi,Who can add in this plug-in bonus money 2-5 people

PHP Code:
/* Rewarding
   ver 0.1 By Zhao on 2004.12.4
*/
#include <amxmodx>
#include <cstrike>
#define BIG_MONEY_INDEX 16
new rewards[20]={50,100,300,500,1000,3000,5000,8000,10000,15000,20000,25000,40000,50000,80000,100000,150000,200000,500000,900000}//Rewarding Ramdon
new g_firstblood
new g_random
new rewardedbig
public ramdon_money(params[]){
 new 
killer=params[0]
 new 
oldamount=params[1]
 new 
amount
 
new killername[32]
 new 
random_range,randomvalue
 random_range
=(rewardedbig)?BIG_MONEY_INDEX:20
 
for(;;){
  
randomvalue=random(random_range)
  
amount=rewards[randomvalue]
  if (
amount!=oldamount) break;
 }
 
get_user_name(killer,killername,31)
 if (
g_random>0){
  
g_random--
  
set_hudmessage(0,255,0,0.05,0.25,00.020.40.010.12)
  
show_hudmessage(0,"%s Kills enemy bravely !! And be award %6d Dollars by Server",killername,amount)
  new 
param[2]
  
param[0]=killer 
  param
[1]=amount
  set_task
(0.3,"ramdon_money",0,param,1)
 } 
 else {
  if(
randomvalue>=BIG_MONEY_INDEXrewardedbig=1
  set_hudmessage
(0,255,0,0.050.2500.026.00.010.12)
  
show_hudmessage(0,"%s Kills enemy bravely !! And be award %6d Dollars by Server",killername,amount)
  
cs_set_user_money(killer,cs_get_user_money(killer)+amount)
 }
}
public 
eDeathMsg(){
 new 
killer,victim,TK
 killer
=read_data(1)
 if(!
killer) return PLUGIN_CONTINUE
 victim
=read_data(2)
 
TK=(get_user_team(killer)==get_user_team(victim))?1:0
 
new wpnname[4]
 
read_data(4,wpnname,3)
 if(
equal(wpnname,"c4")||TK) return PLUGIN_CONTINUE
 
new selfkill = ( killer==victim ) ? 1:0
 
if (selfkill) return PLUGIN_CONTINUE
 
if (g_firstblood){
  
g_firstblood=0
  g_random
=6
  
new param[2]
  
param[0]=killer
  param
[1]=0;
  
ramdon_money(param)
 }
 return 
PLUGIN_CONTINUE 
}
public 
new_round(){
 
g_firstblood=1
}
public 
eRestart(){
 
g_firstblood 0
 rewardedbig 
0
}
public 
plugin_init(){
 
register_plugin("First Killer Reward","0.1","Zhao")
 
register_event("DeathMsg","eDeathMsg","a"
 
g_firstblood=1
 rewardedbig 
0


Last edited by sb123; 06-05-2009 at 03:28.
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-05-2009 , 03:33   Re: money problem
Reply With Quote #2

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "Money bonus"
#define VERSION "1.0"
#define AUTHOR "TitANious"

new pCvarMoney

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
pCvarMoney register_cvar("sv_money""30")
}
public 
client_putinserver(id)
{
    new 
iMoney cs_get_user_money(id)
    new 
iPcvar get_pcvar_num(pCvarMoney)
    
cs_set_user_money(idiMoney iPcvar);

Would this work? It compiles fine
I dont understand what you are meaning, so i hope this is that
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.

Last edited by TitANious; 06-05-2009 at 03:38.
TitANious is offline
Send a message via MSN to TitANious
sb123
Senior Member
Join Date: Jan 2007
Old 06-05-2009 , 05:46   Re: money problem
Reply With Quote #3

What I mean is to increase the 2 3 4 5 award
I add 2 3 4 5 award
But the plugins can not be compiled
Who can help me

if(randomvalue>=BIG_MONEY_INDEX) rewardedbig=2
set_hudmessage(225,133,115,-1.0, 0.21, 0, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(0,"%s got the 2st kill! %6d money",killername,amount)
cs_set_user_money(killer, cs_get_user_money(killer)+amount)

if(randomvalue>=BIG_MONEY_INDEX) rewardedbig=3
set_hudmessage(225,133,115,-1.0, 0.21, 0, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(0,"%s got the 3nd kill! %6d money",killername,amount)
cs_set_user_money(killer, cs_get_user_money(killer)+amount)

if(randomvalue>=BIG_MONEY_INDEX) rewardedbig=4
set_hudmessage(225,133,115,-1.0, 0.21, 0, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(0,"%s got the 4rd kill! %6d money",killername,amount)
cs_set_user_money(killer, cs_get_user_money(killer)+amount)

if(randomvalue>=BIG_MONEY_INDEX) rewardedbig=5
set_hudmessage(225,133,115,-1.0, 0.21, 0, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(0,"%s got the 5th kill! %6d money",killername,amount)
cs_set_user_money(killer, cs_get_user_money(killer)+amount)
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-05-2009 , 06:15   Re: money problem
Reply With Quote #4

I please you to intend your code better, it's look better
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
sb123
Senior Member
Join Date: Jan 2007
Old 06-05-2009 , 07:04   Re: money problem
Reply With Quote #5

What do you mean? I do not understand
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-05-2009 , 07:32   Re: money problem
Reply With Quote #6

Like indent
Like here

By using the tab, instead of spaces
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-05-2009 , 07:33   Re: money problem
Reply With Quote #7

Quote:
Originally Posted by TitANious View Post
Like indent
Like here

By using the tab, instead of spaces
That must be the best explanation ever.
__________________
[X]-RayCat is offline
sb123
Senior Member
Join Date: Jan 2007
Old 06-05-2009 , 08:20   Re: money problem
Reply With Quote #8

Code have been indented
Please help me amend the code. Unable to compile
Attached Files
File Type: sma Get Plugin or Get Source (reward_sim.sma - 174 views - 3.1 KB)
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-05-2009 , 08:39   Re: money problem
Reply With Quote #9

you have too much else
__________________
xPaw is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-05-2009 , 09:01   Re: money problem
Reply With Quote #10

Quote:
Originally Posted by sb123 View Post
Code have been indented
Please help me amend the code. Unable to compile
WOW .. Its better to rewrite it..
__________________
[X]-RayCat 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 13:57.


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