PDA

View Full Version : CLOSED!


|2ob
04-27-2004, 00:24
{CLOSED}

Nick
04-27-2004, 00:37
Doesn't amxmodx use engine instead of VexdUtilites?
Change #include <amxmod> to #include <amxmodx>

|2ob
04-27-2004, 01:17
Doesn't amxmodx use engine instead of VexdUtilites?
Change #include <amxmod> to #include <amxmodx>

If i change Vexd_Utilities to engine i get 26 errors.

Nick
04-27-2004, 01:23
What did you expect to happen?

QwertyAccess
04-27-2004, 01:52
this is like the 3rd topic ive seen posted bout this.

BigBaller
04-27-2004, 02:33
Doesn't amxmodx use engine instead of VexdUtilites?
Change #include <amxmod> to #include <amxmodx>

If i change Vexd_Utilities to engine i get 26 errors.

That is because Vexd and Engine natives have changed. This is what you do, you go into the AMXX Includes folder, open up Vexd_Utilites, read what it says

it would say something like

stock Entvars_Set_Int(iIndex, iVariable, iNewValue)
return entity_set_int(iIndex, iVariable, iNewValue)

The first value is what was used in old VEXD module, the second value is what is used in the ENGINE module.

Soo knowing this, you take your code, Replace anything that says Entvars_Set_Int to entity_set_int

And it will work.

BigBaller
04-27-2004, 02:44
#include <amxmodx>
#include <amxmisc>
#include <engine>

new beam, boom

public Vexd_CreateMine(id,level,cid){
if (!cmd_access(id,level,cid,1))
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 = create_entity("info_target")

if(NewEnt == 0) {
return PLUGIN_HANDLED_MAIN
}

entity_set_string(NewEnt, EV_SZ_classname, "vexd_tripmine")

entity_set_model(NewEnt, "models/v_tripmine.mdl")
entity_set_int(NewEnt, EV_INT_body, 3)
entity_set_int(NewEnt, EV_INT_sequence, 7) // 7 = TRIPMINE_WORLD

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]

trace_line(id, vOrigin, vTraceEnd, vTraceResult)

if(trace_normal(id, vOrigin, vTraceEnd, vNormal) == 0) {
remove_entity(NewEnt)
console_print(id, "[TripMines] You must plant the tripmine on a wall!")
return PLUGIN_HANDLED_MAIN
}


vNewOrigin[0] = vTraceResult[0] + (vNormal[0] * 8.0)
vNewOrigin[1] = vTraceResult[1] + (vNormal[1] * 8.0)
vNewOrigin[2] = vTraceResult[2] + (vNormal[2] * 8.0)

entity_set_origin(NewEnt, vNewOrigin)
vector_to_angle(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)
trace_line(-1, vNewOrigin, vBeamEnd, vTracedBeamEnd)
entity_set_vector(NewEnt, EV_VEC_vuser1, vTracedBeamEnd)

entity_set_int(NewEnt, EV_INT_solid, 2) //2 = Solid bbox. (const.h)
entity_set_int(NewEnt, EV_INT_movetype, 5) //5 = movetype_fly, No grav, but collides.

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)

return PLUGIN_HANDLED_MAIN
}

public TripMineThink() {
new iCurrent
iCurrent = find_ent_by_class(-1, "vexd_tripmine")

while(iCurrent != -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 = trace_line(iCurrent, vOrigin, vEnd, vTrace)

if(iHit > 0) {
new szClassName[32]
entity_get_string(iHit, EV_SZ_classname, szClassName, 32);

if(equal(szClassName, "player")) {
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)

remove_entity(iCurrent)
}
}

iCurrent = find_ent_by_class(iCurrent, "vexd_tripmine")
}
}

public LaserThink() {
new iCurrent
iCurrent = find_ent_by_class(-1, "vexd_tripmine")

while(iCurrent != -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(200)
write_byte(0)
message_end()

iCurrent = find_ent_by_class(iCurrent, "vexd_tripmine")
}
}

public plugin_init(){
register_plugin("Vexd Entity demo (TripMine)","1.00","default")
register_concmd("amx_setmine","Vexd_CreateMine",ADMIN_KICK)

set_task(0.01, "TripMineThink", 0, "", 0, "b")
set_task(1.0, "LaserThink", 0, "", 0, "b")

return PLUGIN_CONTINUE
}

public plugin_precache() {
precache_sound("weapons/mine_deploy.wav")
precache_sound("weapons/mine_charge.wav")
precache_model("models/v_tripmine.mdl")
beam = precache_model("sprites/laserbeam.spr")
boom = precache_model("sprites/zerogxplode.spr")

return PLUGIN_CONTINUE
}

Down to only 5 warnings using AMXX Natives and such, I did not test it but you can try it now, it should work.

|2ob
04-28-2004, 19:56
I compiled the "fixed" version, 5 warnings like i was told but, it still won't work... i have no idea what the problem is, the server just freezes.

BigBaller
04-28-2004, 20:25
I compiled the "fixed" version, 5 warnings like i was told but, it still won't work... i have no idea what the problem is, the server just freezes.

make sure you have the engine module enabled, make sure your server starts with the engine module period before installing this plugin.

|2ob
04-28-2004, 20:27
I compiled the "fixed" version, 5 warnings like i was told but, it still won't work... i have no idea what the problem is, the server just freezes.

make sure you have the engine module enabled, make sure your server starts with the engine module period before installing this plugin.

duh, of course i have it enabled, im not that thick.

1 thing tho, this the cstrike module needed at all for this plugin?

BigBaller
04-28-2004, 20:33
no

|2ob
04-29-2004, 16:17
then whats the problem?

|2ob
04-30-2004, 17:47
so no one can make this plugin work, out of the whole community?

BAILOPAN
04-30-2004, 17:59
does the server FREEZE or CRASH?

|2ob
04-30-2004, 20:23
does the server FREEZE or CRASH?

I rent, i think it freezes, it freezes when i make a home-based dedicated.

remember i run Czero on Windows.

|2ob
05-01-2004, 13:12
*BUMP*

|2ob
05-02-2004, 22:16
*double bump*

Burnzy
05-03-2004, 17:27
*bump*
I like this idea, but can it get worked out?

|2ob
05-03-2004, 20:16
i hope so... :(

QwertyAccess
05-04-2004, 03:48
works fine for me i never had to modify it :o

|2ob
05-04-2004, 20:32
my CZ server crashes tho. not really... but doesnt show on list and no1 can connect to it.

RDEM
05-05-2004, 05:22
And that nor who will not help person

|2ob
05-05-2004, 21:44
*bump*

Dygear
07-09-2004, 21:40
This compiles w/o errors or warnings ...

#include <amxmodx>
#include <amxmisc>
#include <engine>

new beam, boom

public Vexd_CreateMine(id,level,cid){
if (!cmd_access(id,level,cid,1))
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 = create_entity("info_target")

if(NewEnt == 0) {
return PLUGIN_HANDLED_MAIN
}

entity_set_string(NewEnt, EV_SZ_classname, "vexd_tripmine")

entity_set_model(NewEnt, "models/v_tripmine.mdl")
entity_set_int(NewEnt, EV_INT_body, 3)
entity_set_int(NewEnt, EV_INT_sequence, 7) // 7 = TRIPMINE_WORLD

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]

trace_line(id, vOrigin, vTraceEnd, vTraceResult)

if(trace_normal(id, vOrigin, vTraceEnd, vNormal) == 0) {
remove_entity(NewEnt)
console_print(id, "[TripMines] You must plant the tripmine on a wall!")
return PLUGIN_HANDLED_MAIN
}


vNewOrigin[0] = vTraceResult[0] + (vNormal[0] * 8.0)
vNewOrigin[1] = vTraceResult[1] + (vNormal[1] * 8.0)
vNewOrigin[2] = vTraceResult[2] + (vNormal[2] * 8.0)

entity_set_origin(NewEnt, vNewOrigin)
vector_to_angle(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)
trace_line(-1, vNewOrigin, vBeamEnd, vTracedBeamEnd)
entity_set_vector(NewEnt, EV_VEC_vuser1, vTracedBeamEnd)

entity_set_int(NewEnt, EV_INT_solid, 2) //2 = Solid bbox. (const.h)
entity_set_int(NewEnt, EV_INT_movetype, 5) //5 = movetype_fly, No grav, but collides.

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)

return PLUGIN_HANDLED_MAIN
}

public TripMineThink() {
new iCurrent
iCurrent = find_ent_by_class(-1, "vexd_tripmine")

while(iCurrent != -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 = trace_line(iCurrent, vOrigin, vEnd, vTrace)

if(iHit > 0) {
new szClassName[32]
entity_get_string(iHit, EV_SZ_classname, szClassName, 32);

if(equal(szClassName, "player")) {
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, 0)

remove_entity(iCurrent)
}
}

iCurrent = find_ent_by_class(iCurrent, "vexd_tripmine")
}
}

public LaserThink() {
new iCurrent
iCurrent = find_ent_by_class(-1, "vexd_tripmine")

while(iCurrent != -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(200)
write_byte(0)
message_end()

iCurrent = find_ent_by_class(iCurrent, "vexd_tripmine")
}
}

public plugin_init(){
register_plugin("Vexd Entity demo (TripMine)","1.00","Vexd port by Dygear")
register_concmd("amx_setmine","Vexd_CreateMine",ADMIN_KICK)

set_task(0.01, "TripMineThink", 0, "", 0, "b")
set_task(1.0, "LaserThink", 0, "", 0, "b")

return PLUGIN_CONTINUE
}

public plugin_precache() {
precache_sound("weapons/mine_deploy.wav")
precache_sound("weapons/mine_charge.wav")
precache_model("models/v_tripmine.mdl")
beam = precache_model("sprites/laserbeam.spr")
boom = precache_model("sprites/zerogxplode.spr")

return PLUGIN_CONTINUE
}