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

Invalid player id 0 [Error help]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AdogeN
Senior Member
Join Date: Feb 2007
Old 08-05-2008 , 09:12   Invalid player id 0 [Error help]
Reply With Quote #1

Code:
L 08/05/2008 - 00:38:37: Invalid player id 0
L 08/05/2008 - 00:38:37: [AMXX] Run time error 10 (plugin "hpforknife.amxx") (native "get_user_weapon") - debug not enabled!
L 08/05/2008 - 00:38:37: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "grimvh2"
#define VERSION "1.0"
#define AUTHOR "Knife Kill Bonus"
new maxhealth
public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    maxhealth = 100
 
    register_event("DeathMsg", "eDeath", "a");
}
public eDeath(  )
{
    new killer = read_data(1)
 
    new clip, ammo, weapon = get_user_weapon(killer,clip,ammo)
 
    if(weapon == CSW_KNIFE)
    {
        new killerhealth
        killerhealth = get_user_health(killer)
 
        if(killerhealth > maxhealth)
        {
            set_user_health(killer, maxhealth)
        }
        else
        {
            set_user_health(killer, maxhealth)
        }
    }
}
AdogeN is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-05-2008 , 09:27   Re: Invalid player id 0 [Error help]
Reply With Quote #2

Killer can be other than player, like world. ( id = 0 ).

Change your event by : register_event("DeathMsg", "eDeath", "a", "1>0" );
__________________
Arkshine is offline
AdogeN
Senior Member
Join Date: Feb 2007
Old 08-05-2008 , 09:31   Re: Invalid player id 0 [Error help]
Reply With Quote #3

thanks
AdogeN 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 01:27.


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