Raised This Month: $ Target: $400
 0% 

amx_plant_defuse_savehos


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-22-2005 , 13:47   amx_plant_defuse_savehos
Reply With Quote #1

i want to port this but i can't get it to work
normally if the pdsh_active 1
then ct's can plant t's can defuse and t's can rescue hos
but it doesn't work it still does the same as normal csstrike
do i have to enable <cstrike>?
Code:
#include <amxmodx> #include <engine> #define ADMIN_ACCESS ADMIN_LEVEL_A new maxplayers public plugin_init() {     register_plugin("Plant-Defuse-SaveHos", "0.2", "KRoTaL")     register_cvar("pdsh_active", "1")     maxplayers = get_maxplayers() + 1 } public client_PreThink(id) {     if(get_cvar_num("pdsh_active") == 0)     {         return PLUGIN_CONTINUE     }     if(!is_user_alive(id))     {         return PLUGIN_CONTINUE     }         if(get_user_flags(id) & ADMIN_ACCESS)     {         if(get_user_team(id) == 1)         {             if(get_user_button(id) & IN_USE && entity_get_int(id, 114) == 1)             {                 new c4 = find_ent(-1, "grenade")                 while(c4 > 0)                 {                     new model[32]                     entity_get_string(c4, EV_SZ_model, model, 31)                     if(equal(model, "models/w_c4.mdl"))                     {                         if(get_entity_distance(id, c4) < 72)                         {                             entity_set_int(id, 114, 2)                             entity_set_int(id, 193, entity_get_int(id, 193) + (1<<16))                             return PLUGIN_CONTINUE                          }                       }                     c4 = find_ent(c4, "grenade")                 }                 new hostage = find_ent(-1, "hostage_entity")                 while(hostage > 0)                 {                     if(get_entity_distance(id, hostage) < 72)                     {                         entity_set_int(id, 114, 2)                         entity_set_int(id, 193, entity_get_int(id, 193) + (1<<16))                         return PLUGIN_CONTINUE                      }                       hostage = find_ent(hostage, "hostage_entity")                 }             }             if(!(get_user_button(id) & IN_USE) && get_user_oldbutton(id) & IN_USE && entity_get_int(id, 114) == 2)             {                 entity_set_int(id, 114, 1)                 entity_set_int(id, 193, entity_get_int(id, 193) - (1<<16))             }         }     }     return PLUGIN_CONTINUE } public entity_touch(entity1, entity2) {     if(get_cvar_num("pdsh_active") == 0)     {         return PLUGIN_CONTINUE     }     if(entity1 > 0 && entity2 > 0 && entity2 < maxplayers)     {         if(get_user_flags(entity2) & ADMIN_ACCESS)         {             if(get_user_team(entity2) == 2)             {                 new model[32]                 entity_get_string(entity1, EV_SZ_model, model, 31)                 new classname[32]                 entity_get_string(entity1, EV_SZ_classname, classname, 31)                 if(equal(model, "models/w_backpack.mdl"))                 {                     if(entity_get_int(entity2, 114) == 2)                     {                         entity_set_int(entity2, 114, 1)                         set_task(0.1, "reset_team", entity2)                         return PLUGIN_CONTINUE                     }                 }                 if(equal(classname, "func_bomb_target"))                 {                     new clip, ammo, weapon = get_user_weapon(entity2, clip, ammo)                     if(weapon == CSW_C4)                     {                         if(entity_get_int(entity2, 114) == 2)                         {                             if(get_user_button(entity2) & IN_ATTACK)                             {                                 entity_set_int(entity2, 114, 1)                                 return PLUGIN_CONTINUE                             }                         }                     }                     else if(entity_get_int(entity2, 114) == 1)                     {                         entity_set_int(entity2, 114, 2)                         return PLUGIN_CONTINUE                     }                 }             }         }     }     return PLUGIN_CONTINUE } public reset_team(id) {     if(get_user_team(id) == 2 && entity_get_int(id, 114) == 1)     {         entity_set_int(id, 114, 2)     } }

help me here http://forums.alliedmods.net/showthread.php?t=11408
and here http://forums.alliedmods.net/showthread.php?t=11535
__________________
- Bye bye!
nightscreem is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-22-2005 , 17:02  
Reply With Quote #2

Same problem as your last unsuccesful port, client_prethink is now client_PreThink.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-22-2005 , 17:46  
Reply With Quote #3

sry didn't work
__________________
- Bye bye!
nightscreem is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 03-22-2005 , 18:16  
Reply With Quote #4

compiles fine
Freecode is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-22-2005 , 18:18  
Reply With Quote #5

i know but in game it doesn't work
do I need
Code:
#include <cstrike>
__________________
- Bye bye!
nightscreem is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-22-2005 , 19:52  
Reply With Quote #6

No.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-23-2005 , 07:41  
Reply With Quote #7

someone help plz
__________________
- Bye bye!
nightscreem is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-23-2005 , 17:16  
Reply With Quote #8

Talk to the original plugin creator or something. I know this is the scripting help, but it gets really annoying when people post a full plugin and say "it doesn't work."
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 09:51.


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