Raised This Month: $ Target: $400
 0% 

cvar problem !


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 12-22-2009 , 07:04   cvar problem !
Reply With Quote #1

First of all, please check the code:
PHP Code:
new cvar_random_money
//...
public plugin_init()
{
//...
cvar_random_money register_cvar("amx_rm""50 100 300 500 1000 3000 5000 8000 10000 15000 20000 25000 40000 50000 80000 100000 150000 200000 500000 900000")
}
 
public 
event_DeathMsg()
{
 new 
iKiller read_data(1)
 new 
iVictim read_data(2)
 if (!
iKiller) return PLUGIN_CONTINUE
 
if (get_user_team(iKiller) == get_user_team(iVictim)) return PLUGIN_CONTINUE
 
 
new iAwardMoney
 
if (g_FirstBlood)
 {
  new 
tempmoney[256]
  
get_pcvar_string(cvar_random_moneytempmoney255)
  new 
tempmoney1[20][6]
  
parse(tempmoney
  
tempmoney1[0], sizeof tempmoney1[] - 1tempmoney1[1], sizeof tempmoney1[] - 1tempmoney1[2], sizeof tempmoney1[] - 1tempmoney1[3], sizeof tempmoney1[] - 1
  
tempmoney1[4], sizeof tempmoney1[] - 1tempmoney1[5], sizeof tempmoney1[] - 1tempmoney1[6], sizeof tempmoney1[] - 1tempmoney1[7], sizeof tempmoney1[] - 1
  
tempmoney1[8], sizeof tempmoney1[] - 1tempmoney1[9], sizeof tempmoney1[] - 1tempmoney1[10], sizeof tempmoney1[] - 1tempmoney1[11], sizeof tempmoney1[] - 1
  
tempmoney1[12], sizeof tempmoney1[] - 1tempmoney1[13], sizeof tempmoney1[] - 1tempmoney1[14], sizeof tempmoney1[] - 1tempmoney1[15], sizeof tempmoney1[] - 1
  
tempmoney1[16], sizeof tempmoney1[] - 1tempmoney1[17], sizeof tempmoney1[] - 1tempmoney1[18], sizeof tempmoney1[] - 1tempmoney1[19], sizeof tempmoney1[] - 1)
  new 
num random_num(120)
  switch(
num)
  {
   case 
1:  iAwardMoney str_to_num(tempmoney1[0])
   case 
2:  iAwardMoney str_to_num(tempmoney1[1])
   case 
3:  iAwardMoney str_to_num(tempmoney1[2])
   case 
4:  iAwardMoney str_to_num(tempmoney1[3])
   case 
5:  iAwardMoney str_to_num(tempmoney1[4])
   case 
6:  iAwardMoney str_to_num(tempmoney1[5])
   case 
7:  iAwardMoney str_to_num(tempmoney1[6])
   case 
8:  iAwardMoney str_to_num(tempmoney1[7])
   case 
9:  iAwardMoney str_to_num(tempmoney1[8])
   case 
10:  iAwardMoney str_to_num(tempmoney1[9])
   case 
11:  iAwardMoney str_to_num(tempmoney1[10])
   case 
12:  iAwardMoney str_to_num(tempmoney1[11])
   case 
13:  iAwardMoney str_to_num(tempmoney1[12])
   case 
14:  iAwardMoney str_to_num(tempmoney1[13])
   case 
15:  iAwardMoney str_to_num(tempmoney1[14])
   case 
16:  iAwardMoney str_to_num(tempmoney1[15])
   case 
17:  iAwardMoney str_to_num(tempmoney1[16])
   case 
18:  iAwardMoney str_to_num(tempmoney1[17])
   case 
19:  iAwardMoney str_to_num(tempmoney1[18])
   case 
20:  iAwardMoney str_to_num(tempmoney1[19])
  }
  
g_FirstBlood 0
  ryu_set_money
(iKillerryu_get_money(iKiller)+iAwardMoney1)
  new 
iName[32]
  
get_user_name(iKilleriName31)
  
set_hudmessage(1001002550.150.2916.010.00.50.151)
  
show_hudmessage(0"%L"LANG_PLAYER"FIRST_BLOOD"iNameiAwardMoney)
    
client_cmd(0"spk misc/woohoo")
 } 
Now the problem comes
when I change the money level in amxx.cfg like this
PHP Code:
amx_rm "50 100 300 8000 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000 200000 300000 400000 500000 800000 900000" 
PHP Code:
100000 200000 300000 400000 500000 800000 900000 
will be changed into
PHP Code:
10000 20000 30000 40000 50000 80000 90000 
is there any wrong ?
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-22-2009 , 07:17   Re: cvar problem !
Reply With Quote #2

new tempmoney1[20][6]

Increase the value.
__________________
Arkshine is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 12-22-2009 , 07:20   Re: cvar problem !
Reply With Quote #3

you mean change it to

new tempmoney1[20][7] ??
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-22-2009 , 07:25   Re: cvar problem !
Reply With Quote #4

Think.. if you get less 0, it means the size is not enough which is obvious when you look at your size and the fact you remove -1 below.
__________________
Arkshine is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 12-22-2009 , 07:30   Re: cvar problem !
Reply With Quote #5

thx ! i got it !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 12-22-2009 , 07:34   Re: cvar problem !
Reply With Quote #6

ArkShine, I have another question !
Is there any way to get the money num from cvar ?

I see some one do something in the amxx.cfg like this
PHP Code:
amx_cvar "50,100000,20000,30000,40000,50000,60000,80000,90000,100000,200000,300000,500000,900000" 
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
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 04:16.


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