AlliedModders

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

nightscreem 03-22-2005 13:47

amx_plant_defuse_savehos
 
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

XxAvalanchexX 03-22-2005 17:02

Same problem as your last unsuccesful port, client_prethink is now client_PreThink.

nightscreem 03-22-2005 17:46

sry didn't work

Freecode 03-22-2005 18:16

compiles fine :x

nightscreem 03-22-2005 18:18

i know but in game it doesn't work
do I need
Code:
#include <cstrike>

v3x 03-22-2005 19:52

No.

nightscreem 03-23-2005 07:41

someone help plz

XxAvalanchexX 03-23-2005 17:16

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."


All times are GMT -4. The time now is 09:51.

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