Misanthropist
π Staff
π Beta Tester
β
Black Lounger β
βοΈ HL Verified
π Steam Linked
π» Oldtimer
OK, Im working on a transformation plugin, which works quite well for the most part, but for some reason doing something as [apparently] simple as changing beam sprites is just doing my head in.
Ive scoured the web about this and my syntax is correct, i cant see anything wrong with it, but it just wont compile. AlliedMods isnt very helpful, and from what Ive seen im not doing anything any different. Please please help while I have a shred of sanity left!
Ive got most of the ESF constants sussed out, and have an idea on manipulating them. Ive only posted code here relevant to sprites.
What am i doing wrong?
Ive scoured the web about this and my syntax is correct, i cant see anything wrong with it, but it just wont compile. AlliedMods isnt very helpful, and from what Ive seen im not doing anything any different. Please please help while I have a shred of sanity left!
Ive got most of the ESF constants sussed out, and have an idea on manipulating them. Ive only posted code here relevant to sprites.
Code:
public plugin_init() {
register_plugin("blah", "blah", "blah")
// register beam attack
register_message( get_user_msgid( "EETrail" ), "BeamAttack" )
return PLUGIN_CONTINUE;
}
new RedBeamHead
new RedBeamStart
new RedBeamTrail
public plugin_precache() {
// WHY DOES THIS HATE ME?
RedBeamHead = precache_model("sprites/redattacka.spr")
RedBeamStart = precache_model("sprites/redattackastart.spr")
RedBeamTrail = precache_model("sprites/redtrail.spr")
}
// COMPILER HATES ANY REFERENCE TO REDBEAMHEAD ETC
public BeamAttack(id)
{
new playerID = get_msg_arg_int(1);
new clip
new ammo
new weaponID = get_user_weapon( playerID, clip, ammo )
// CHANGE GENERIC BEAM IF TRANSFORMED
if (weaponID == 4 && PlayerTransformed[id])
{
set_msg_arg_int( 4, ARG_SHORT, RedBeamStart) // beam start a
set_msg_arg_int( 5, ARG_SHORT, RedBeamStart) // beam start b
set_msg_arg_int( 6, ARG_SHORT, RedBeamHead) // beam head a
set_msg_arg_int( 7, ARG_SHORT, RedBeamHead) // beam head b
set_msg_arg_int( 8, ARG_SHORT, RedBeamTrail) // trail
set_msg_arg_int( 9, ARG_BYTE, get_msg_arg_int(9) * 10 ) // size
}
return PLUGIN_CONTINUE;
}
// THIS WORKS FOR THE MOST PART, BIT DODGY BUT NOT REALLY FUSSED ATM
public client_PostThink(id) //
{
// Check Class is Goku
new playerClass = entity_get_int(id, EV_INT_playerclass)
if(PlayerTransformed[id] && playerClass == 2) {
new ent, Float:origin[3];
entity_get_vector(id,EV_VEC_origin,origin);
// Change BlueCharge into RedCharge
while((ent = find_ent_in_sphere(ent,origin,64.0)) != 0) {
new model[32];
entity_get_string(ent,EV_SZ_model,model,31);
if(containi(model,"sprites/bluecharge.spr") != -1) {
entity_set_model(ent,"sprites/redcharge.spr");
}
}
}
return PLUGIN_CONTINUE
}
What am i doing wrong?
Last edited: