AlliedModders

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

Velocity36 08-22-2005 23:48

#include...
 
I'm porting a plugin that used VexdUM which we're not allowed to use, so I #include engine.

It give me 4 remove_entities errors and 1 find_entity error.

I checked the engine.inc file and it had remove_entities and find_entity, I already included engine but its giving me these errors. Help please?

v3x 08-22-2005 23:56

Code:
remove_entity() find_ent_by_class()
I believe.

Velocity36 08-23-2005 00:17

Yeah what about about it? How am I supposed to use that to fix my script?

DahVid 08-23-2005 00:21

Wow, a single celled organism could of found that out. Look at the similarities between what you posted and he posted. Maybe, replace them? :?

Velocity36 08-23-2005 02:15

Okay I did that, I don't get those erroes anymore however When i compile now I get these errors. BTW thanx v3x

/home/groups/amxmodx/tmp/phpg4mj4r.sma(43) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp/phpg4mj4r.sma(44) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp/phpg4mj4r.sma(63) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp/phpg4mj4r.sma(64) : error 035: argument type mismatch (argument 1)

n0obie4life 08-23-2005 05:18

So, your expecting us to guess your code...how smart.

Velocity36 08-23-2005 13:10

Code:
#include <amxmodx> #include <amxmisc>   #include <engine> new bool:can_plant new planter, old_bombtarget new Float:bomb_origin[3] public plugin_init() {     register_plugin("Plant Anywhere", "0.2", "KRoTaL")     register_cvar("sv_c4plant", "60")     register_event("TextMsg", "game_restart", "a", "1=4", "2&#Game_C", "2&#Game_w")     register_event("SendAudio", "round_end", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw")     register_logevent("new_round", 2, "0=World triggered", "1=Round_Start")     register_event("StatusIcon", "gotbomb", "be", "1=1", "1=2", "2=c4")     old_bombtarget = find_ent_by_class(-1, "func_bomb_target")     if(old_bombtarget > 0) entity_get_vector(old_bombtarget, EV_VEC_origin, bomb_origin) } public gotbomb(id) {     planter = id     return PLUGIN_CONTINUE } public round_end() {     set_task(4.0, "disable_planting", 78645135) } public game_restart() {     set_task(0.5, "disable_planting", 71586461) } public disable_planting() {     if(task_exists(97564673)) remove_task(97564673)     planter = 0     can_plant = false     remove_entity("func_bomb_target")     remove_entity("info_bomb_target")     new bombtarget = create_entity("func_bomb_target")     if(bombtarget > 0)     {         DispatchKeyValue(bombtarget, "classname", "func_bomb_target")         DispatchSpawn(bombtarget)         entity_set_string(bombtarget, EV_SZ_classname, "func_bomb_target")     }     bombtarget = create_entity("info_bomb_target")     if(bombtarget > 0)     {         DispatchKeyValue(bombtarget, "classname", "info_bomb_target")         DispatchSpawn(bombtarget)         entity_set_string(bombtarget, EV_SZ_classname, "info_bomb_target")     } } public new_round() {     remove_entity("func_bomb_target")     remove_entity("info_bomb_target")     set_task(get_cvar_float("sv_c4plant"), "enable_planting", 97564673) } public enable_planting() {     can_plant = true     create_bombtarget() } public create_bombtarget() {     if(old_bombtarget > 0)     {         new bombtarget = create_entity("func_bomb_target")         if(bombtarget > 0)         {             DispatchKeyValue(bombtarget, "classname", "func_bomb_target")             DispatchSpawn(bombtarget)             entity_set_size(bombtarget, Float:{-1000000.0,-1000000.0,-1000000.0}, Float:{1000000.0,1000000.0,1000000.0})             entity_set_string(bombtarget, EV_SZ_classname, "func_bomb_target")             entity_set_origin(bombtarget, bomb_origin)         }         bombtarget = create_entity("info_bomb_target")         if(bombtarget > 0)         {             DispatchKeyValue(bombtarget, "classname", "info_bomb_target")             DispatchSpawn(bombtarget)             entity_set_size(bombtarget, Float:{-1000000.0,-1000000.0,-1000000.0}, Float:{1000000.0,1000000.0,1000000.0})             entity_set_string(bombtarget, EV_SZ_classname, "info_bomb_target")             entity_set_origin(bombtarget, bomb_origin)         }     } } public client_prethink(id) {     if(id == planter && !can_plant)     {         new clip, ammo, weapon = get_user_weapon(id, clip, ammo)         if(weapon == CSW_C4)         {             entity_set_int(id, EV_INT_button, entity_get_int(id, EV_INT_button) & ~IN_ATTACK)         }     } }

And I get the erroes above. If anybody can help please do, I will give you karma.

XxAvalanchexX 08-23-2005 16:30

Code:
#include <amxmodx> #include <amxmisc>   #include <engine> new bool:can_plant new planter, old_bombtarget new Float:bomb_origin[3] public plugin_init() {     register_plugin("Plant Anywhere", "0.2", "KRoTaL")     register_cvar("sv_c4plant", "60")     register_event("TextMsg", "game_restart", "a", "1=4", "2&#Game_C", "2&#Game_w")     register_event("SendAudio", "round_end", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw")     register_logevent("new_round", 2, "0=World triggered", "1=Round_Start")     register_event("StatusIcon", "gotbomb", "be", "1=1", "1=2", "2=c4")     old_bombtarget = find_ent_by_class(-1, "func_bomb_target")     if(old_bombtarget > 0) entity_get_vector(old_bombtarget, EV_VEC_origin, bomb_origin) } public gotbomb(id) {     planter = id     return PLUGIN_CONTINUE } public round_end() {     set_task(4.0, "disable_planting", 78645135) } public game_restart() {     set_task(0.5, "disable_planting", 71586461) } public remove_all_entity(classname[]) {     new ent     while((ent = find_ent_by_class(ent,classname)) != 0) {         remove_entity(ent)     } } public disable_planting() {     if(task_exists(97564673)) remove_task(97564673)     planter = 0     can_plant = false     remove_all_entity("func_bomb_target")     remove_all_entity("info_bomb_target")     new bombtarget = create_entity("func_bomb_target")     if(bombtarget > 0)     {         DispatchKeyValue(bombtarget, "classname", "func_bomb_target")         DispatchSpawn(bombtarget)         entity_set_string(bombtarget, EV_SZ_classname, "func_bomb_target")     }     bombtarget = create_entity("info_bomb_target")     if(bombtarget > 0)     {         DispatchKeyValue(bombtarget, "classname", "info_bomb_target")         DispatchSpawn(bombtarget)         entity_set_string(bombtarget, EV_SZ_classname, "info_bomb_target")     } } public new_round() {     remove_all_entity("func_bomb_target")     remove_all_entity("info_bomb_target")     set_task(get_cvar_float("sv_c4plant"), "enable_planting", 97564673) } public enable_planting() {     can_plant = true     create_bombtarget() } public create_bombtarget() {     if(old_bombtarget > 0)     {         new bombtarget = create_entity("func_bomb_target")         if(bombtarget > 0)         {             DispatchKeyValue(bombtarget, "classname", "func_bomb_target")             DispatchSpawn(bombtarget)             entity_set_size(bombtarget, Float:{-1000000.0,-1000000.0,-1000000.0}, Float:{1000000.0,1000000.0,1000000.0})             entity_set_string(bombtarget, EV_SZ_classname, "func_bomb_target")             entity_set_origin(bombtarget, bomb_origin)         }         bombtarget = create_entity("info_bomb_target")         if(bombtarget > 0)         {             DispatchKeyValue(bombtarget, "classname", "info_bomb_target")             DispatchSpawn(bombtarget)             entity_set_size(bombtarget, Float:{-1000000.0,-1000000.0,-1000000.0}, Float:{1000000.0,1000000.0,1000000.0})             entity_set_string(bombtarget, EV_SZ_classname, "info_bomb_target")             entity_set_origin(bombtarget, bomb_origin)         }     } } public client_PreThink(id) {     if(id == planter && !can_plant)     {         new clip, ammo, weapon = get_user_weapon(id, clip, ammo)         if(weapon == CSW_C4)         {             entity_set_int(id, EV_INT_button, entity_get_int(id, EV_INT_button) & ~IN_ATTACK)         }     } }

Velocity36 08-23-2005 16:37

Thx.


All times are GMT -4. The time now is 14:28.

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