AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Slaughter Reward (https://forums.alliedmods.net/showthread.php?t=99501)

Debesėlis 08-06-2009 06:10

Slaughter Reward
 
Why don't give reward?????

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Slaughter Reward"
#define VERSION "1.0"
#define AUTHOR "BOYSplayCS"

#define Killed ADMIN_LEVEL_H

new Reward


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""Event_Death""a""1 > 0")
    
    
Reward register_cvar("amx_kill_reward""300")
}

public 
Event_Death()
{
    new 
Killer read_data(1)
    new 
Victim read_data(2)

    if((
Killer == Victim) || !(get_user_flags(Victim) & Killed) || (get_user_team(Victim) == get_user_team(Killer)))
        return 
PLUGIN_CONTINUE

    
new CheckWeapon[6];
    
read_data(4CheckWeapon5);

    if(
equal(CheckWeapon"knife"))
    {
        new 
KillReward get_pcvar_num(Reward)

        
cs_set_user_money(Killerclamp(cs_get_user_money(Killer) + KillReward016000))
        
client_print(Killerprint_chat"[AMXX] You have slaughtered an player! You have been awarded an extra %s dollars!"KillReward)
    }
    return 
PLUGIN_HANDLED



Debesėlis 08-06-2009 07:30

Re: Slaughter Reward
 
Anybody? :cry:

Arkshine 08-06-2009 08:09

Re: Slaughter Reward
 
I see nothing wrong. You are in scripting section, so don't ask without even trying to search yourself. Try to debug with some client_print() and you will find fastly. Plus don't bump before 15 days, it's in the rules..

Debesėlis 08-06-2009 08:27

Re: Slaughter Reward
 
Nothing wrong... When kill the player (ADMIN_LEVEL_H) nothing happens... No money no message on the chat...

Arkshine 08-06-2009 09:37

Re: Slaughter Reward
 
"1 > 0" -> "1>0"

Debesėlis 08-06-2009 10:44

Re: Slaughter Reward
 
It works! Thanks!


All times are GMT -4. The time now is 18:16.

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