Quote:
Originally Posted by Arkshine
You should search too. There are a lot of examples on the forum.
Hook DeathMsg : register_event( "DeathMsg", "Event_PlayerKilled", "a" );
Then in the function Event_PlayerKilled, you can count the kills.
Code:
</p><p>public Event_PlayerKilled()</p><p>{</p><p> new Killer = read_data(1);</p><p> new Victim = read_data(2);</p><p> </p><p> MyGlobalVar[ Killer ]++; // We add +1 to the killer's kills.</p><p>}</p><p>
|
PHP Code:
#include <amxmodx>
#include <fun>
new MyGlobalVar[ 33 ]
public plugin_init()
{
register_plugin( "kills level", "1.0", "Mr.Noobie" )
register_event( "DeathMsg", "Event_PlayerKilled", "a" )
}
public Event_PlayerKilled( )
{
new Killer = read_data( 1 )
new Victim = read_data( 2 )
MyGlobalVar[ Killer ]++;
give_item( Killer, "weapon_m4a1" )
}
Like this can it work. Btw the compile fail.
"Symbol is assigned a value that is never used "Victim"
I know because i didn't use Victim.
What should i do with Victim ??
SO how can i make like level ??