AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   buzz_kill tripmine plugin (https://forums.alliedmods.net/showthread.php?t=3757)

Burnzy 07-13-2004 19:35

buzz_kill tripmine plugin
 
This is VERY strange. I got this all done but get errors on things that should work... example: entity_set_origin

very strange...

well this is for Vexd's Trip mine plugin (edited a little by Buzz_Kill a year ago)... for sum reason. It wont port!

Code:
/********************************************* * This plugin is originally from Vexd's Amx * Tripmine Plugin. * * bind a key to amx_setmine * *  example: (in console type) *   'bind alt amx_setmine' * * Bugs: *  -If you are too close when u place the mine, it will get u stuck in it. * * Change Log: * *  v1.3 Beta  -Doing sum shit - Do not use this yet... *  v1.2, -Made it so that anyone access's *        -Made beam lighter *  v1.1, -Fixed Warning. *  v1.0, -First Release * ********************************************** * Ported by Burnzy * Visit <a href="http://www.burnsdesign.org" target="_blank" rel="nofollow noopener">www.burnsdesign.org</a> **********************************************/ #include <amxmod> #include <amxmisc> #include <engine> new beam, boom #define MAX_MINES 2 new player_mines_ent[33][MAX_MINES] new player_mines_count[33] detonate_mine(iCurrent, iHit) { new Float:vOrigin[3] Entity_Get_Vector(iCurrent, EV_VEC_origin, vOrigin) message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(99) //99 = KillBeam write_short(iCurrent) message_end() message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(3) write_coord(floatround(vOrigin[0])) write_coord(floatround(vOrigin[1])) write_coord(floatround(vOrigin[2])) write_short(boom) write_byte(50) write_byte(15) write_byte(0) message_end() RadiusDamage(vOrigin, 1, 50) new id,slot //id = Entity_Get_Edict(iCurrent, EV_ENT_owner) Remove_Entity(iCurrent) // clear this from the list of live tripmines for (id=1;id<33;id++) {  for (slot=0;slot<MAX_MINES;slot++) {   if (player_mines_ent[id][slot] == iCurrent) {    player_mines_ent[id][slot] = -1    player_mines_count[id] = player_mines_count[id] - 1        if (iHit == -1)    {     client_print(id, print_chat, "[TripMines] Your mine has detonated.")    } else {     new szNetName[32]     Entity_Get_String(iHit, EV_SZ_netname, szNetName, 32)     client_print(id, print_chat, "[TripMines] %s detonated your mine.",szNetName)    }        break   }  } } } public Vexd_CreateMine(id,level,cid){ new Status = get_cvar_num( "amx_tripmine" ) if ( Status != 1  ){  client_print(id, print_chat, "[Tripmines] Tripmines are not currently active.")  return PLUGIN_HANDLED } if(Entity_Get_Int(id, EV_INT_deadflag) != 0)  return PLUGIN_HANDLED   if (is_user_alive(id) == 0)  return PLUGIN_HANDLED   if (player_mines_count[id] >= MAX_MINES) {  client_print(id, print_chat, "[Tripmines] Maximum mines have been deployed.")  return PLUGIN_HANDLED } new Float:vOrigin[3] new Float:vAngles[3] Entity_Get_Vector(id, EV_VEC_origin, vOrigin) Entity_Get_Vector(id, EV_VEC_v_angle, vAngles)        new NewEnt        NewEnt = CreateEntity("info_target")        if(NewEnt == 0) {            return PLUGIN_HANDLED_MAIN        }                         Entity_Set_String(NewEnt, EV_SZ_classname, "vexd_tripmine") Entity_Set_Int(NewEnt, EV_INT_movetype, 5) //5 = movetype_fly, No grav, but collides. Entity_Set_Int(NewEnt, EV_INT_solid, 0)        ENT_SetModel(NewEnt, "models/v_tripmine.mdl")                        Entity_Set_Float(NewEnt, EV_FL_frame, 0.0) Entity_Set_Int(NewEnt, EV_INT_body, 3) Entity_Set_Int(NewEnt, EV_INT_sequence, 7) // 7 = TRIPMINE_WORLD Entity_Set_Float(NewEnt, EV_FL_framerate, 0.0) Entity_Set_Float(NewEnt, EV_FL_takedamage, 1.0) Entity_Set_Float(NewEnt, EV_FL_dmg, 100.0) Entity_Set_Float(NewEnt, EV_FL_health, 5000.0) Entity_Set_Int(NewEnt, EV_INT_iuser2, 0) //0 Will be for inactive. new Float:MinBox[3] new Float:MaxBox[3] MinBox[0] = -8.0 MinBox[1] = -8.0 MinBox[2] = -8.0 MaxBox[0] = 8.0 MaxBox[1] = 8.0 MaxBox[2] = 8.0 Entity_Set_Vector(NewEnt, EV_VEC_mins, MinBox) Entity_Set_Vector(NewEnt, EV_VEC_maxs, MaxBox) new Float:vNewOrigin[3] new Float:vNormal[3] new Float:vTraceDirection[3] new Float:vTraceEnd[3] new Float:vTraceResult[3] new Float:vEntAngles[3] VelocityByAim(id, 64, vTraceDirection) vTraceEnd[0] = vTraceDirection[0] + vOrigin[0] vTraceEnd[1] = vTraceDirection[1] + vOrigin[1] vTraceEnd[2] = vTraceDirection[2] + vOrigin[2] TraceLn(id, vOrigin, vTraceEnd, vTraceResult) if(TraceNormal(id, vOrigin, vTraceEnd, vNormal) == 0) {  Remove_Entity(NewEnt)  client_print(id, print_chat, "[Tripmines] You must plant the tripmine on a wall!")  return PLUGIN_HANDLED_MAIN } new slot = 0; for (slot = 0; slot < MAX_MINES; slot++) {  if (player_mines_ent[id][slot] == -1)   break; } if (slot >= MAX_MINES)  //unhandled error  return PLUGIN_HANDLED_MAIN          player_mines_ent[id][slot] = NewEnt player_mines_count[id] = player_mines_count[id] + 1 vNewOrigin[0] = vTraceResult[0] + (vNormal[0] * 8.0) vNewOrigin[1] = vTraceResult[1] + (vNormal[1] * 8.0) vNewOrigin[2] = vTraceResult[2] + (vNormal[2] * 8.0) ENT_SetOrigin(NewEnt, vNewOrigin) VecToAngles(vNormal, vEntAngles) Entity_Set_Vector(NewEnt, EV_VEC_angles, vEntAngles) new Float:vBeamEnd[3] new Float:vTracedBeamEnd[3] vBeamEnd[0] = vNewOrigin[0] + (vNormal[0] * 8192) vBeamEnd[1] = vNewOrigin[1] + (vNormal[1] * 8192) vBeamEnd[2] = vNewOrigin[2] + (vNormal[2] * 8192) TraceLn(-1, vNewOrigin, vBeamEnd, vTracedBeamEnd) Entity_Set_Vector(NewEnt, EV_VEC_vuser1, vTracedBeamEnd) emit_sound(NewEnt, CHAN_WEAPON, "weapons/mine_deploy.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) emit_sound(NewEnt, CHAN_VOICE, "weapons/mine_charge.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) new args[4] num_to_str(NewEnt, args, 4) set_task(3.0, "TripMineActivate", 0, args, 4) return PLUGIN_HANDLED_MAIN } public TripMineActivate(MineID[]) { new EntID = str_to_num(MineID) new Float:vOrigin[3] Entity_Get_Vector(EntID, EV_VEC_origin, vOrigin) new Float:vEnd[3] Entity_Get_Vector(EntID, EV_VEC_vuser1, vEnd) message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(0) write_coord(floatround(vOrigin[0])) write_coord(floatround(vOrigin[1])) write_coord(floatround(vOrigin[2])) write_coord(floatround(vEnd[0])) //Random write_coord(floatround(vEnd[1])) //Random write_coord(floatround(vEnd[2])) //Random write_short(beam) write_byte(0) write_byte(0) write_byte(10) //Life write_byte(5) //Width write_byte(0) write_byte(255) // r write_byte(0) // g write_byte(0) // b write_byte(200) write_byte(0) message_end() Entity_Set_Int(EntID, EV_INT_iuser2, 1) //1 Will be for active. Entity_Set_Int(EntID, EV_INT_solid, 2) //1 Will be for active. emit_sound(EntID, CHAN_VOICE, "weapons/mine_activate.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) } public TripMineThink() { new iCurrent iCurrent = FindEntity(-1, "vexd_tripmine") while(iCurrent != -1) {  if(Entity_Get_Int(iCurrent, EV_INT_iuser2) == 1) {   new Float:vOrigin[3]   Entity_Get_Vector(iCurrent, EV_VEC_origin, vOrigin)   new Float:vEnd[3]   Entity_Get_Vector(iCurrent, EV_VEC_vuser1, vEnd)   new Float:vTrace[3]   new iHit   iHit = TraceLn(iCurrent, vOrigin, vEnd, vTrace)     new Float:health[1]     health[0] = Entity_Get_Float(iCurrent, EV_FL_health)     if (health[0] < 5000) {    detonate_mine(iCurrent,-1)   } else {    if(iHit > 0 ) {     new szClassName[32]     Entity_Get_String(iHit, EV_SZ_classname, szClassName, 32)         if(equal(szClassName, "player")) {      detonate_mine(iCurrent,iHit)     }    }   }  }  iCurrent =  FindEntity(iCurrent, "vexd_tripmine") } } public LaserThink() { new iCurrent iCurrent = FindEntity(-1, "vexd_tripmine") while(iCurrent != -1) {  if(Entity_Get_Int(iCurrent, EV_INT_iuser2) == 1) {   new Float:vOrigin[3]   Entity_Get_Vector(iCurrent, EV_VEC_origin, vOrigin)   new Float:vEnd[3]   Entity_Get_Vector(iCurrent, EV_VEC_vuser1, vEnd)   message_begin(MSG_BROADCAST,SVC_TEMPENTITY)   write_byte(0)   write_coord(floatround(vOrigin[0]))   write_coord(floatround(vOrigin[1]))   write_coord(floatround(vOrigin[2]))   write_coord(floatround(vEnd[0])) //Random   write_coord(floatround(vEnd[1])) //Random   write_coord(floatround(vEnd[2])) //Random   write_short(beam)   write_byte(0)   write_byte(0)   write_byte(10) //Life   write_byte(5) //Width   write_byte(0)   write_byte(255) // r   write_byte(0) // g   write_byte(0) // b   write_byte(50)   write_byte(0)   message_end()  }  iCurrent =  FindEntity(iCurrent, "vexd_tripmine") } } public plugin_init(){    register_plugin("Vexd Entity demo (TripMine)","1.01","default")    register_clcmd("amx_setmine","Vexd_CreateMine",0,"")        register_cvar( "amx_tripmine", "0", FCVAR_UNLOGGED )        set_task(0.01, "TripMineThink", 0, "", 0, "b")    set_task(1.0, "LaserThink", 0, "", 0, "b")        return PLUGIN_CONTINUE } public client_connect(id){ new j for (j=0;j<MAX_MINES;j++) {  player_mines_ent[id][j] = -1  player_mines_count[id] = 0 } return PLUGIN_CONTINUE } public client_disconnect(id){ new j, iCurrent player_mines_count[id] = 0 for (j=0;j<MAX_MINES;j++) {  if (player_mines_ent[id][j] != -1) {     iCurrent = player_mines_ent[id][j]     new Float:vOrigin[3]   Entity_Get_Vector(iCurrent, EV_VEC_origin, vOrigin)     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)   write_byte(99) //99 = KillBeam   write_short(iCurrent)   message_end()     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)   write_byte(3)   write_coord(floatround(vOrigin[0]))   write_coord(floatround(vOrigin[1]))   write_coord(floatround(vOrigin[2]))   write_short(boom)   write_byte(50)   write_byte(15)   write_byte(0)   message_end()     RadiusDamage(vOrigin, 1, 50)     Remove_Entity(iCurrent)     player_mines_ent[id][j] = -1    } } return PLUGIN_CONTINUE } public plugin_precache() { precache_sound("weapons/mine_deploy.wav") precache_sound("weapons/mine_charge.wav") precache_sound("weapons/mine_activate.wav") precache_model("models/v_tripmine.mdl") beam = precache_model("sprites/laserbeam.spr") boom = precache_model("sprites/zerogxplode.spr") return PLUGIN_CONTINUE }

these are the errors:
Quote:

Small compiler 2.1.0 Copyright (c) 1997-2002, ITB CompuPhase

amx_tripmine.sma(43) : error 017: undefined symbol "Entity_Get_Vector"
amx_tripmine.sma(66) : error 017: undefined symbol "Remove_Entity"
amx_tripmine.sma(84) : error 017: undefined symbol "Entity_Get_String"
amx_tripmine.sma(110) : error 017: undefined symbol "Entity_Get_Int"
amx_tripmine.sma(124) : error 017: undefined symbol "Entity_Get_Vector"
amx_tripmine.sma(125) : error 017: undefined symbol "Entity_Get_Vector"
amx_tripmine.sma(127) : warning 217: loose indentation
amx_tripmine.sma(128) : error 017: undefined symbol "CreateEntity"
amx_tripmine.sma(137) : warning 217: loose indentation
amx_tripmine.sma(137) : error 017: undefined symbol "Entity_Set_String"
amx_tripmine.sma(140) : error 017: undefined symbol "Entity_Set_Int"
amx_tripmine.sma(141) : error 017: undefined symbol "Entity_Set_Int"
amx_tripmine.sma(143) : warning 217: loose indentation
amx_tripmine.sma(143) : error 017: undefined symbol "ENT_SetModel"
amx_tripmine.sma(146) : error 017: undefined symbol "Entity_Set_Float"
amx_tripmine.sma(147) : warning 217: loose indentation
amx_tripmine.sma(147) : error 017: undefined symbol "Entity_Set_Int"
amx_tripmine.sma(148) : error 017: undefined symbol "Entity_Set_Int"
amx_tripmine.sma(149) : error 017: undefined symbol "Entity_Set_Float"
amx_tripmine.sma(151) : error 017: undefined symbol "Entity_Set_Float"
amx_tripmine.sma(152) : error 017: undefined symbol "Entity_Set_Float"
amx_tripmine.sma(153) : error 017: undefined symbol "Entity_Set_Float"
amx_tripmine.sma(155) : error 017: undefined symbol "Entity_Set_Int"
amx_tripmine.sma(168) : error 017: undefined symbol "Entity_Set_Vector"
amx_tripmine.sma(169) : error 017: undefined symbol "Entity_Set_Vector"
amx_tripmine.sma(184) : error 017: undefined symbol "TraceLn"
amx_tripmine.sma(186) : error 017: undefined symbol "TraceNormal"
amx_tripmine.sma(187) : error 017: undefined symbol "Remove_Entity"
amx_tripmine.sma(201) : warning 217: loose indentation
amx_tripmine.sma(202) : warning 217: loose indentation
amx_tripmine.sma(208) : error 017: undefined symbol "ENT_SetOrigin"
amx_tripmine.sma(209) : error 017: undefined symbol "VecToAngles"

Compilation aborted.
26 Errors.
Press any key to continue . . .
please help...

|2ob 07-14-2004 04:11

the function names have changed. besides, didnt i supply you with a working version?

Burnzy 07-14-2004 08:44

u did. But this is an update to it. So i want to no if i could get this one to work. I have changed all the functions if u look at my 'errors' but it was there undefined (even though i included engine module)

Blunted1 07-14-2004 18:14

1 Attachment(s)
it may be too simple to fix it, but have you tried "entity_set_string" instead of "Entity_Set_String" (etc) ? :P


edit: solved a whole load of your errors includeing the capitalized letters that should not have been and a few natives that were incorrect, mispelled or incomplete in some manner.

a few undefined symbols left that I dont have time to look up.....

"CreateEntity", "FindEntity".... I cant remember the rest its not in front of me know, but compile this and you will see what is left to do.

Blunted1 07-15-2004 18:43

1 Attachment(s)
.... and again with zero errors... (crashes server right away when starting a game when I tried it)

Burnzy 07-15-2004 19:11

ill make it so it works in game, thx for those problems fixes... me el stupido!


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

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