Raised This Month: $ Target: $400
 0% 

kills.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 05:07   Re: kills.
Reply With Quote #1

Quote:
Originally Posted by Mr.Noobie View Post
How do i contains the kill by player ??

Can you give me more example codes ?
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:
public Event_PlayerKilled() {      new Killer = read_data(1);      new Victim = read_data(2);      MyGlobalVar[ Killer ]++;  // We add +1 to the killer's kills. }
__________________
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 08-21-2009 , 08:56   Re: kills.
Reply With Quote #2

Quote:
Originally Posted by Arkshine View Post
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>&nbsp;</p><p> MyGlobalVar[ Killer ]++; // We add +1 to the killer's kills.</p><p>}</p><p>
PHP Code:
#include <amxmodx>
#include <fun>

new MyGlobalVar33 ]

public 
plugin_init() 
{
        
register_plugin"kills level""1.0""Mr.Noobie" )
        
register_event"DeathMsg""Event_PlayerKilled""a" )
}

public 
Event_PlayerKilled( )
{
     new 
Killer read_data)
     new 
Victim read_data)

     
MyGlobalVarKiller ]++;

     
give_itemKiller"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 ??
Mr.Noobie 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 15:00.


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