Raised This Month: $51 Target: $400
 12% 

Bomb transfer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marquezs
Member
Join Date: Jun 2010
Old 01-03-2011 , 02:17   Bomb transfer
Reply With Quote #1

Hi, I was trying to make a plugin that deactivates bomb sites and that when a user drops a bomb the bomb is transfered to him if is alive or to other teammates if the user has died or disconnected.

The first part, disabling bomb sites is working with ConnorMcLeod code.

The part that isn't working is the fm_give_item function. This logevent registers when the bomb is dropped and I it is working fine because I get the message no to drop the bomb but then I drop and I don't receive the bomb again, so the fm_give_item isn't working, I don't know why so I came to ask your help

Thanks

Code:
/* Credits go to: - ConnorMcLeod for SetBombSites - VEN for everything else */ #include <amxmodx> #include <engine> #include <fakemeta_util.inc> #define PLUGIN "Bomb FM" #define VERSION "0.2" #define AUTHOR "marquezs" new bool:bActive stock get_loguser_index() {     new loguser[80], name[32]     read_logargv(0, loguser, 79)     parse_loguser(loguser, name, 31)       return get_user_index(name) }  public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         if (!engfunc(EngFunc_FindEntityByString, -1, "classname", "func_bomb_target"))         return     register_logevent("logevent_function_p", 3, "2=Dropped_The_Bomb")     SetBombSites(bActive) } public logevent_function_p() {             new id = get_loguser_index()     if(is_user_alive(id))     {         fm_give_item(id, "weapon_c4")         client_print(id, print_chat, "Do not drop the bomb again")     }     else if(!is_user_connected(id) || !is_user_alive(id))     {         new idp[32], num         get_players(idp, num, "ae", "TERRORIST")             if (!num)             return                 new user_b = random_num(0, num)             fm_give_item(user_b, "weapon_c4")         client_print(0, print_chat, "Here is the bomb, enjoy")     }     else         client_print(0, print_chat, "Errorr") }  SetBombSites( bool:bActive ) {     new iEnt = -1     while( (iEnt = find_ent_by_class(iEnt, "func_bomb_target")) > 0 )     {         entity_set_int(iEnt, EV_INT_solid, bActive ? SOLID_TRIGGER : SOLID_NOT)     }     while( (iEnt = find_ent_by_class(iEnt, "info_bomb_target")) > 0 )     {         entity_set_int(iEnt, EV_INT_solid, bActive ? SOLID_TRIGGER : SOLID_NOT)     } }

Last edited by marquezs; 01-03-2011 at 02:21.
marquezs is offline
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 13:21   Re: Bomb transfer
Reply With Quote #2

You can remove the bomb and than give_item.

Regards

Last edited by MyDooMJr; 01-05-2011 at 13:29.
MyDooMJr 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:21.


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