Raised This Month: $ Target: $400
 0% 

NEED HELP! i need help with my sma...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fai960820
Junior Member
Join Date: May 2011
Old 05-12-2011 , 10:40   NEED HELP! i need help with my sma...
Reply With Quote #1

Code:
#include <amxmod>
new num_dead
new num_nolost
 
public dead(){ 
    new killer = read_data(1) 
    new victim = read_data(2) 
    new Killer[33] 
    new Victim[33] 
    get_user_name(killer, Killer,32) 
    get_user_name(victim, Victim,32) 
    if(get_user_team(victim) != get_user_team(killer)){
  if(get_user_money(victim) < get_pcvar_num(num_nolost)){
 set_hudmessage(255, 150, 50, 0.10, 0.5, 0, 6.0, 10.0, 0.5, 0.15, 9) 
 show_hudmessage(0, "He Got No More MONEY")
}
else {
        new money = get_user_money(victim) 
        set_user_money(victim, money - get_pcvar_num(num_dead))
}
    } 
    return PLUGIN_CONTINUE 
} 
public plugin_init() {  
   register_plugin("kill Rewards","0.0","default") 
   register_event("DeathMsg","dead","ade") 
   num_dead = register_cvar("num_dead", "0")
num_nolost = register_cvar("num_nolost", "10000")
}
I can turn this sma into amxx, but it is not working well. Only when num_nolost is 0, or else i won't lost any money when i died. I want to set a number, when u got more money that this number, u will lost money when u are died. Please HELP! Is any part wrong, cuz i wrote it and i am a NOOB ):

Warning when i compile it:
compile: sma<18>: warning 217: loose indentation
compile: sma<30>: warning 217: loose indentation

Code:
register_event("DeathMsg","dead","ade")
And what is use of "ade" behind "dead" and somthings, there will be "5=0" "3=1" something like that. What is the use of these number?

Last edited by fai960820; 05-12-2011 at 10:47.
fai960820 is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 05-12-2011 , 12:26   Re: NEED HELP! i need help with my sma...
Reply With Quote #2

1.amxmod ==> amxmodx
2.you should see more infomation about DeathMsg Event from here
3.use AMXX-Studio press ctrl + i indent you code !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-12-2011 , 15:03   Re: NEED HELP! i need help with my sma...
Reply With Quote #3

Instead public dead hook player death with ham_killed: use Search.
__________________


Last edited by SonicSonedit; 05-12-2011 at 15:06.
SonicSonedit is offline
fai960820
Junior Member
Join Date: May 2011
Old 05-12-2011 , 19:13   Re: NEED HELP! i need help with my sma...
Reply With Quote #4

i don't know how to use ham_killed.... Sonic, can u show me what is the code please?
fai960820 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2011 , 19:16   Re: NEED HELP! i need help with my sma...
Reply With Quote #5

If you don't need to modify anything in the death then you are just fine using DeathMsg.

Quote:
Originally Posted by fai960820 View Post
Code:
register_event("DeathMsg","dead","ade")
And what is use of "ade" behind "dead" and somthings, there will be "5=0" "3=1" something like that. What is the use of these number?
See the documentation for register_event().

Also, you need to change "amxmod" to "amxmodx" and also include cstrike then use cs_get_user_money() and cs_set_user_money().

Other than that, it looks fine to me.
__________________

Last edited by fysiks; 05-12-2011 at 19:25.
fysiks is offline
fai960820
Junior Member
Join Date: May 2011
Old 05-12-2011 , 19:33   Re: NEED HELP! i need help with my sma...
Reply With Quote #6

register_event("DeathMsg","headshot","ade","3 =1","5=0")

Why the event for headshot is "3=1" "5=0"?
fai960820 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2011 , 19:40   Re: NEED HELP! i need help with my sma...
Reply With Quote #7

Quote:
Originally Posted by fai960820 View Post
Why the event for headshot is "3=1" "5=0"?
Where did you get that? There is no 5th argument for DeathMsg. See the link that K.K.Lv posted. "IsHeadshot" is the 3rd argument. If it is 1 and not 0 then it was a headshot kill.
__________________
fysiks is offline
fai960820
Junior Member
Join Date: May 2011
Old 05-12-2011 , 21:28   Re: NEED HELP! i need help with my sma...
Reply With Quote #8

Code:
#include <amxmodx>
#include <cstrike>
new num_dead
new num_nolost
public death(){ 
new killer = read_data(1) 
new victim = read_data(2) 
new Killer[33] 
new Victim[33] 
get_user_name(killer, Killer,32) 
get_user_name(victim, Victim,32) 
 
if(get_user_team(victim) != get_user_team(killer)){
if(cs_get_user_money(victim) < get_pcvar_num(num_nolost)){
set_hudmessage(255, 150, 50, 0.10, 0.5, 0, 6.0, 10.0, 0.5, 0.15, 9) 
show_hudmessage(0, "He Got No More MONEY")
}
else {
new money = cs_get_user_money(victim) 
cs_set_user_money(victim, money - get_pcvar_num(num_dead))
}
} 
return PLUGIN_CONTINUE 
} 
public plugin_init() { 
register_plugin("kill Rewards","0.0","default") 
register_event("DeathMsg","death","ade") 
num_dead = register_cvar("num_dead", "5000")
num_nolost = register_cvar("num_nolost", "10000")
}
It is still not working....Is any thing wrong?

I get that from a sma that get bouns money when headshot, may be that sma is wrong too...

Last edited by fai960820; 05-12-2011 at 21:31.
fai960820 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2011 , 21:39   Re: NEED HELP! i need help with my sma...
Reply With Quote #9

Use only "a" and not "ade" (as 'de' and 'e' contradict eachother). See if that works. If not, you need to learn to debug: see if code is being executed at all by using client_print(0, print_chat, "message") in code that doesn't seem to be working and see if it shows up. You can also check values of variables to see if they are what you think they are.
__________________
fysiks is offline
fai960820
Junior Member
Join Date: May 2011
Old 05-12-2011 , 22:07   Re: NEED HELP! i need help with my sma...
Reply With Quote #10

It works! Thx ALOT! (:

Last edited by fai960820; 05-12-2011 at 22:12.
fai960820 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 04:20.


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