AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   double kill codes (https://forums.alliedmods.net/showthread.php?t=48682)

SAMURAI16 12-18-2006 06:31

double kill codes
 
i need an script example for double kill, if can somebody make one ; but only if i kill 2 players with a bullet
Hope to understand .. thanks

dutchmeat 12-18-2006 06:50

Re: double kill codes
 
You are saying that the bullet 'dies' when it hits a player ?

jim_yang 12-18-2006 06:52

Re: double kill codes
 
he meant one killed two at the same time with a shot.

SAMURAI16 12-18-2006 07:25

Re: double kill codes
 
ya , that's it .. anybody ?

dutchmeat 12-18-2006 07:27

Re: double kill codes
 
I guess you will have to make your own bullet then, there are alot of topics here.

XxAvalanchexX 12-18-2006 16:56

Re: double kill codes
 
I'd do something like this...

Code:
 #define TASK_CLEAR_KILL    100  new kill[33][24];  public plugin_init()  {     register_event("DeathMsg","event_deathmsg","a");  }  public event_deathmsg()  {     new killer = read_data(1);     new victim = read_data(2);     if(killer == victim || !killer)         return;     new weapon[24];     read_data(4,weapon,23);     if(kill[killer][0] && equal(kill[killer],weapon))     {         client_print(0,print_chat,"DOUBLE KILL!!");         kill[killer][0] = 0;     }     else     {         kill[killer] = weapon;         set_task(0.1,"clear_kill",TASK_CLEAR_KILL+killer);     }  }  public clear_kill(taskid)  {     new id = taskid-TASK_CLEAR_KILL;     kill[id][0] = 0;  }

When a death message appears, it stores what weapon it was with for a tenth of a second. If another death message from the same player with the same weapon appears in that time, it shows a double kill.

dutchmeat 12-18-2006 17:05

Re: double kill codes
 
I thought he was trying to make the bullet stay alive after it touched a body.

Ywa*NL 12-19-2006 02:00

Re: double kill codes
 
Quote:

Originally Posted by dutchmeat (Post 417009)
I thought he was trying to make the bullet stay alive after it touched a body.


That's not a bad idea either.

dutchmeat 12-19-2006 04:18

Re: double kill codes
 
It may not be a bad idea, but you will have to create a new bullet, since you can't do anything with the old source-coded bullets(at my opinion).


All times are GMT -4. The time now is 07:00.

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