Half-Life и Adrenaline Gamer форум
http://aghl.ru/forum/

bomb map crossfire (killing)
http://aghl.ru/forum/viewtopic.php?f=28&t=2161
Страница 1 из 1

Автор:  abdobiskra [ 22 май 2015, 19:44 ]
Заголовок сообщения:  bomb map crossfire (killing)

Hello I want to help here, I want to count the number of dead to him who pressure bomb button when the exchange of fire explosion !
Код:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

//new Float:origin[3] = {-256.0,704.0,-1853.0}

new map_name[25]
new bool:a
new killer

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_touch("*","nuclear_rocket","nuke_touch")
   //register_touch("*","nuclear_bomb","bomb_touch")
   
   RegisterHam(Ham_Touch,"trigger_multiple","_trigger_multiple",1)
   RegisterHam(Ham_Killed,"player","fw_PlayerKilled")
   get_mapname(map_name, sizeof (map_name) - 1)
   killer = 0
}

public _trigger_multiple(const iEntity, const id)
{
   if(a)
      return HAM_IGNORED
   new n = find_ent_by_target(-1,"fire_button_texture")
   
   if (iEntity == n ) ////NUKEBUTTON   
   {
      a=true
      set_task(42.0,"test")
      set_task(60.0,"res")
      
      if(is_user_alive(id))
      {
         killer=id////
      }
      
   }
   
   return HAM_IGNORED
}

public res()
   a=false

public test(){
   for(new i;i<60;++i){
      set_task(random_float(0.0,14.0),"create_nuke")
   }
}
public fw_PlayerKilled(id,ent){
   
   if (equali(map_name,"crossfire"))
   {
      static classname[32]
      entity_get_string(ent,EV_SZ_classname,classname,31)
      
      if(!equal(classname,"nuke"))
         return HAM_IGNORED
         
      if(is_user_connected(killer))
      {
         SetHamParamEntity(2,killer)// set killer ID
      }
      
   }
   
   return HAM_IGNORED
}
/*public bomb_nuke(touched,ent){
   new Float:origin[3]
   
   if(!is_valid_ent(ent))
      return
   
   entity_get_vector(ent,EV_VEC_origin,origin)
   bomb_nuke (origin)
   remove_entity(ent)
}*/
I want to make the death toll to calculate the player who pressed the bomb button

Автор:  Lev [ 23 май 2015, 00:29 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

If I am not wrong, you can get working code about touching the button in the "EuroHL" plugin. By so you can get player who pressed the button.
Then you need to add frags to him when players die of "trigger_hurt" classname entity.

Автор:  unnamed [ 23 май 2015, 01:11 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

Keep in mind that there are 3 (as I remember) trigger_multiple at crossfire map.
First - secret room.
Second - nuclear button.
Third - around 2 satchels in bunker. This trigger unused. But it still can call your touch function.

Добавлено спустя 5 минут:
Lev, Red button - fake button.
In fact, there is a trigger_multiple.

Автор:  abdobiskra [ 23 май 2015, 19:33 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

Код:
Lev
 
No results found !

Автор:  Lev [ 23 май 2015, 21:16 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

You missed
Код:
      RegisterHam(Ham_Touch,"trigger_multiple","_trigger_multiple",1)
You should check not for
Код:
if(!equal(classname,"nuke"))
but
Код:
if(!equal(classname,"trigger_hurt"))
as I said earlier.

I see no reason for
Код:
         SetHamParamEntity(2,killer)// set killer ID
replace with
Код:
new Float:frags;
pev(id, pev_frags, frags);
frags++;
set_pev(index, pev_frags, frags);

Also I suggest to move check
Код:
if (equali(map_name,"crossfire"))
to plugin_init and pause plugin if map doesn't match.

Автор:  abdobiskra [ 23 май 2015, 22:14 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

Код:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

gggg.sma(53) : error 017: undefined symbol "pev"
gggg.sma(53) : warning 215: expression has no effect
gggg.sma(53) : error 001: expected token: ";", but found ")"
gggg.sma(53) : error 029: invalid expression, assumed zero
gggg.sma(53) : fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.
Could not locate output file gggg.amx (compile failed).
 
:Search:

Автор:  unnamed [ 25 май 2015, 04:40 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

Код:
//#include <fakemeta>
Uncomment this.

Автор:  Lev [ 25 май 2015, 06:07 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

And replace
Код:
set_pev(index
with
Код:
set_pev(id

Автор:  abdobiskra [ 27 май 2015, 00:49 ]
Заголовок сообщения:  Re: bomb map crossfire (killing)

No result does not work :(
But with found the right solution is nuclear bombing :D
I will make him like hell (map crossfire) :crazy: and frag back to me :D

The idea of nuclear missiles GordonFreeman :pardon:
When activate bomb ==> :

Страница 1 из 1 Часовой пояс: UTC + 5 часов [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/