Raised This Month: $ Target: $400
 0% 

suicide help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vl@d
Senior Member
Join Date: Dec 2006
Location: Romania
Old 08-14-2007 , 11:52   suicide help
Reply With Quote #1

this is part of the plugin:
Code:
public he_kills(){
   new killer_id = read_data(1) 
   new victim_id = read_data(2) 
   new killer_name[32], victim_name[33] 
    
   get_user_name(killer_id,killer_name,33) 
   get_user_name(victim_id,victim_name,33) 

   new hekmode[8] 
   get_cvar_string("hekill_mode",hekmode,8) 
   new hekmode_bit = read_flags(hekmode)

   if (hekmode_bit & 1) { 
    if (victim_id != killer_id) 
     {
    if (hekmode_bit & 4) { 
     client_cmd(0,"spk amx.nobody.ro/amx_grenade") 
    }
    set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
    show_hudmessage(0,he_messages[ random_num(0,HEMESSAGES-1)],killer_name,victim_name) 
     }
   } 

   if (hekmode_bit & 2) { 
    if (victim_id == killer_id)
     {
    if (hekmode_bit & 4) { 
     client_cmd(0,"spk amx.nobody.ro/amx_witch")
    }
    set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
    show_hudmessage(0,hes_messages[ random_num(0,HESMESSAGES-1) ],victim_name) 
     } 
   }

}
i dont anderstand with it shows the servername and multikill.
like Amx.Nobody.ro:Multikill.

Any ideea?
__________________


I hate Spammers....
vl@d is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 08-14-2007 , 12:11   Re: suicide help
Reply With Quote #2

PHP Code:
new id
new name[32]
get_user_name(idname31
name string will contain servername if id < 1 or id > get_maxplayers()

you need to add checks if killer id and victim id is a valid player and it will fix the problem
__________________
Impossible is Nothing

Last edited by Sylwester; 08-14-2007 at 12:17.
Sylwester is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 08-14-2007 , 12:11   Re: suicide help
Reply With Quote #3

Make sure killer_id is a valid player.
You could break execution using
PHP Code:
if(!is_user_connected(killer_id)) return 
Or you could register the DeathMsg with proper (>0) killer id flags.

@ Sylwester: If id > max players then it will result in a native error.
_Master_ is offline
vl@d
Senior Member
Join Date: Dec 2006
Location: Romania
Old 08-14-2007 , 12:18   Re: suicide help
Reply With Quote #4

hmm i will try
__________________


I hate Spammers....
vl@d is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 08-14-2007 , 12:20   Re: suicide help
Reply With Quote #5

nope there will be no error, I made simple plugin to check it and whatever value you insert as id it always return server name if id is not valid player id.
__________________
Impossible is Nothing

Last edited by Sylwester; 08-14-2007 at 12:22.
Sylwester is offline
vl@d
Senior Member
Join Date: Dec 2006
Location: Romania
Old 08-14-2007 , 17:05   Re: suicide help
Reply With Quote #6

ooo my bad i but #define levels 10, it should been #define level 11
__________________


I hate Spammers....
vl@d 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 13:28.


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