Raised This Month: $ Target: $400
 0% 

client_death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 11-25-2010 , 09:36   client_death
Reply With Quote #1

PHP Code:
public client_death(killervictimwpnindexhitplaceTK)
{
    new 
headshot = (hitplace == HIT_HEAD);
    
msg("Kill Status: Killer: %s / Victim: %s / Weapon: %d / Hitplace: %s / TK: %d / HeadShot %d",killervictimwpnindexhitplaceTKheadshot);

when i am killing someone with headshot the msg is showing to me that i've killed him with headshot... from the var:
new headshot = (hitplace == HIT_HEAD);
but when i am echoing the hitplace is appearing like a number and not like a string :/
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-25-2010 , 09:52   Re: client_death
Reply With Quote #2

Hitplace: %s

should be %d or %i

%s = string
%d = decimal
%i = integer
__________________
Arkshine is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-25-2010 , 09:52   Re: client_death
Reply With Quote #3

That function gets passed all integers, no strings. If you are expecting player names for killer\victim, you will need to use get_user_name with killer\victim as player id (check first if they are players by (1<=id<=maxplayers)).
PHP Code:
public client_death(killervictimwpnindexhitplaceTK)
{
    
/* from amxconst.inc
    #define HIT_GENERIC        0
    #define HIT_HEAD        1
    #define HIT_CHEST        2
    #define HIT_STOMACH        3
    #define HIT_LEFTARM        4
    #define HIT_RIGHTARM        5
    #define HIT_LEFTLEG        6
    #define HIT_RIGHTLEG        7 */
    
    
new const HitPlaceStrings[][] = 
    {
        
"Generic",
        
"Head",
        
"Chest",
        
"Stomach",
        
"LeftArm",
        
"RightArm",
        
"LeftLeg",
        
"RightLeg"
    
};

    
msg("Kill Status: Killer: %d / Victim: %d / Weapon: %d / Hitplace: %s / TK: %d / HeadShot %s",killervictimwpnindexHitPlaceStringshitplace ] , TK, ( hitplace == HIT_HEAD ) : "yes" "no" );

__________________

Last edited by Bugsy; 11-25-2010 at 09:55.
Bugsy 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 11:24.


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