AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   kills. (https://forums.alliedmods.net/showthread.php?t=100805)

Mr.Noobie 08-18-2009 05:05

kills.
 
Does anyone know how to make kills level ?

Example :

Player kill a player | Deagle |

Player kill 2 player | MP5 |

Player kill 3 player | AWP |

Meanings :

| Deagle |

| MP5 |

| AWP |

Those are weapons given to the player if they meet the kills level requirment. - Just like gun game.

But i just want the codes.

Arkshine 08-18-2009 06:10

Re: kills.
 
You are in scripting section, so you are here to learn.

Create a global var which will contain the kill by player. Next, hook the DeahMsg event, update the var and give weapon when needs. ( give_item() )

Mr.Noobie 08-18-2009 06:14

Re: kills.
 
Quote:

Originally Posted by Arkshine (Post 904264)
You are in scripting section, so you are here to learn.

Create a global var which will contain the kill by player. Next, hook the DeahMsg event, update the var and give weapon when needs. ( give_item() )

what do you mean by global var ?

can you show me some example codes ?

Arkshine 08-18-2009 06:32

Re: kills.
 
new MyGlobalVar[ 33 ]; // contains the kill by player.

public plugin_init()
{

}

Mr.Noobie 08-18-2009 07:49

Re: kills.
 
Quote:

Originally Posted by Arkshine (Post 904279)
new MyGlobalVar[ 33 ]; // contains the kill by player.

public plugin_init()
{

}


How do i contains the kill by player ??

Can you give me more example codes ?

Bad_Bud 08-18-2009 14:38

Re: kills.
 
He's a sly one! :P

Mr.Noobie 08-19-2009 06:28

Re: kills.
 
Quote:

Originally Posted by Bad_Bud (Post 904647)
He's a sly one! :P

So someone can help me ?

I don't know what to start first.

Mr.Noobie 08-21-2009 02:48

Re: kills.
 
Sorry for the double posting. :(

I really need some help on this.

One 08-21-2009 05:03

Re: kills.
 
Quote:

Originally Posted by Bad_Bud (Post 904647)
He's a sly one! :P

u arent better ;)

Arkshine 08-21-2009 05:07

Re: kills.
 
Quote:

Originally Posted by Mr.Noobie (Post 904335)
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. }


All times are GMT -4. The time now is 15:01.

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