Raised This Month: $ Target: $400
 0% 

Ham_Killed help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 08-30-2009 , 09:21   Ham_Killed help
Reply With Quote #1

All that i need is in this code.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
 
public plugin_init()
{
      
register_plugin("Frags By Monster Killed""1.0""Fr33m@n")
      
RegisterHamHam_Killed"func_wall""monster_killed")
}
public 
monster_killed (monsterEntattackershouldgib)
{
     if ( 
pev(monsterEntpev_flags) & FL_MONSTER && is_user_alive(attacker) ) {
           new 
frags // Just an example
           
new newfrags get_user_frags(attacker) + frags
           set_user_frags
(attackernewfrags)
           
//what is the more efficient way beetween these two for add frags ?
           
ExecuteHamB(Ham_AddPointsattackerfragsfalse)
 
           
client_print(attackerprint_chat"You got %d Frags for killing a Monster"frags)
 
 
           new 
namea[32]
           
get_user_name(attackernameacharsmax(namea))
           
client_print(0print_chat"%s killed a Monster (%d Frags)"attackerfrags)
           
//I want that all players show it except the attacker, 0 isn't possible 
           //( and the more efficient way if is possible)
     
}

please help me ;)

Last edited by Fr33m@n; 08-30-2009 at 09:27.
Fr33m@n is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-30-2009 , 09:24   Re: Ham_Killed help
Reply With Quote #2

- The second, but the difference is trivial there.
- You have to loop through all players and checking if player is not "attacker".
__________________
Arkshine is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 08-30-2009 , 10:08   Re: Ham_Killed help
Reply With Quote #3

PHP Code:
new gIsAttacker[33]
 
...
 
gIsAttacker[attacker] = true
static players[32], playerCountplayeri
get_players
(playersplayerCount"h")
for ( 
0playerCounti++ ) {
     new 
namea[32]
     
get_user_nameattackernameacharsmax(namea) )
     
player players[i]
     if (!
gIsAttacker[player]) {
           
client_print(playerprint_chat"%s killed a Monster (%d Frags)"attackerfrags)
     }
}
gIsAttacker[attacker] = false 
something like that ?

Last edited by Fr33m@n; 08-30-2009 at 10:11.
Fr33m@n 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 14:58.


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