Raised This Month: $ Target: $400
 0% 

Cstrike Invalid id Out Of Range


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-29-2011 , 03:41   Cstrike Invalid id Out Of Range
Reply With Quote #1

For some reason while in Ham_Killed i get issues with Cstrike natives (cs_get_weapon_id()) Also tried multiple other cs natives all gave the same error

I used get_user_name to display the name of the killer and it returns my name so not sure why im having issues with cstrike natives saying im not a player lol.

Code:
L 07/29/2011 - 00:07:31: [CSTRIKE] Non-player entity 1 out of range
L 07/29/2011 - 00:07:31: [AMXX] Run time error 10: native error (native "cs_get_weapon_id")
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new bool:gBotsRegistered;

public 
plugin_init()
{
    
RegisterHam(Ham_Killed"player""fwdPlayerDeath");
}

public 
fwdPlayerDeath(iVictimiKilleriShouldGib)
{    
    if(!
is_user_alive(iKiller))
        return 
HAM_IGNORED;
    
    if(
get_user_team(iVictim) == get_user_team(iKiller))
        return 
HAM_IGNORED;
    
    
//This gives error posted in thread
    
new WeaponID cs_get_weapon_id(iKiller);//<----Error line
    
    //This works fine
    //new WeaponID = get_user_weapon(iKiller);
        
    
client_print(0print_chat"ID: %d ..... WeaponID: %d"iKillerWeaponID);
    
    return 
HAM_HANDLED;


Last edited by Doc-Holiday; 07-29-2011 at 03:43.
Doc-Holiday is offline
 



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 00:57.


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