AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   pls edit this *.sma that it doesnt need engine-module (https://forums.alliedmods.net/showthread.php?t=23666)

AllMassive 01-27-2006 06:10

pls edit this *.sma that it doesnt need engine-module
 
hi

I'm using this plugin for some time now - before the release of amxx 1.60 i was able to use it without the engine-module.
I found that script at the amx-forums and just changed the #include to amxmodx.

Could someone please look over this code and change the parts which needs the engine-module (if its possible).


Code:

/* AMX Mod script.
*
* This is Johnny's edit of the death info beams, which
* allows all deaths to be seen (by all dead people).
*
* If you want to see it in action, go to my server:
* [DuDeS] - Freakin Sweet
* 129.237.51.145:27015
*
* Death Info Beams by SpaceDude
* This file is provided as is (no warranties).
*
*/

#include <amxmodx>

#define TE_BEAMPOINTS 0

new m_spriteTexture

public death(){
        new player_num = 0                          // A Player incrementer.
        new maxpl = get_maxplayers()+1              // Max players.
        new killer_id = read_data(1)                // Killer's player ID.
        new victim_id = read_data(2)                // Victim's player ID.
        new killer_team = get_user_team(killer_id)  // The team the killer's on.

        if (get_cvar_num("amx_deathbeams_enabled") == 1)
        {
                if (killer_id!=victim_id && killer_id)
                {
                        new k_origin[3]
                        new v_origin[3]
                        get_user_origin(killer_id,k_origin)
                        get_user_origin(victim_id,v_origin)
                       
                        for(player_num = 1;player_num < maxpl; player_num++)
                        {
                                if(is_user_alive(player_num)==0 && get_user_time(player_num)!= 0)
                                {
                                        message_begin(MSG_ONE, SVC_TEMPENTITY,{0,0,0},player_num)
                                        write_byte( TE_BEAMPOINTS )
                                        write_coord(k_origin[0])
                                        write_coord(k_origin[1])
                                        write_coord(k_origin[2])
                                        write_coord(v_origin[0])
                                        write_coord(v_origin[1])
                                        write_coord(v_origin[2])
                                        write_short( m_spriteTexture )
                                        write_byte( 1 )  // framestart
                                        write_byte( 1 )  // framerate
                                        write_byte( 100 ) // life in 0.1's
                                        write_byte( 25 )  // width
                                        write_byte( 0 )  // noise

                                        // Set the color of the beam.
                                        if (get_cvar_num("amx_deathbeams_randcolor") == 1)
                                        {
                                                write_byte( random_num(50,255) ) // red
                                                write_byte( random_num(50,255) )  // green
                                                write_byte( random_num(50,255) )  // blue
                                        }
                                        else
                                        {
                                                if (killer_team == 1)
                                                { // Terrorist
                                                        write_byte( 255 ) // red
                                                        write_byte( 0 )  // green
                                                        write_byte( 0 )  // blue
                                                }
                                                else
                                                { // Counter-terrorist
                                                        write_byte( 0 )  // red
                                                        write_byte( 0 )  // green
                                                        write_byte( 255 )  // blue
                                                      }
                                        }
                                        write_byte( 100 ) // brightness
                                        write_byte( 0 )  // speed
                                        message_end()
                                }
                        }
                }
        }
}

public plugin_precache()
  m_spriteTexture = precache_model("sprites/dot.spr")

public plugin_init()
{
        register_plugin("All Death Beams","0.9","SpaceDude")
        register_event("DeathMsg","death","a")
        register_cvar("amx_deathbeams_enabled","1")
        register_cvar("amx_deathbeams_randcolor","0")
}

I really dont know why it worked without engine-module before - but i think its the right place to post my request.

thx

Charming 01-27-2006 06:42

so its asking for engine correct? well all you would really have to do is remove ;engine.dll er something like that from ur modules.ini and add #include <engine>


Code:
/* AMX Mod script. * * This is Johnny's edit of the death info beams, which * allows all deaths to be seen (by all dead people). * * If you want to see it in action, go to my server: * [DuDeS] - Freakin Sweet * 129.237.51.145:27015 * * Death Info Beams by SpaceDude * This file is provided as is (no warranties). * */ #include <amxmodx> #include <engine> //#include <fun> // it might need this dunno but if it asks for it take away the "//" behind the include #define TE_BEAMPOINTS 0 new m_spriteTexture public death(){    new player_num = 0                          // A Player incrementer.    new maxpl = get_maxplayers()+1              // Max players.    new killer_id = read_data(1)                // Killer's player ID.    new victim_id = read_data(2)                // Victim's player ID.    new killer_team = get_user_team(killer_id)  // The team the killer's on.    if (get_cvar_num("amx_deathbeams_enabled") == 1)    {       if (killer_id!=victim_id && killer_id)       {          new k_origin[3]          new v_origin[3]          get_user_origin(killer_id,k_origin)          get_user_origin(victim_id,v_origin)                    for(player_num = 1;player_num < maxpl; player_num++)          {             if(is_user_alive(player_num)==0 && get_user_time(player_num)!= 0)             {                message_begin(MSG_ONE, SVC_TEMPENTITY,{0,0,0},player_num)                write_byte( TE_BEAMPOINTS )                write_coord(k_origin[0])                write_coord(k_origin[1])                write_coord(k_origin[2])                write_coord(v_origin[0])                write_coord(v_origin[1])                write_coord(v_origin[2])                write_short( m_spriteTexture )                write_byte( 1 )   // framestart                write_byte( 1 )   // framerate                write_byte( 100 ) // life in 0.1's                write_byte( 25 )  // width                write_byte( 0 )   // noise                // Set the color of the beam.                if (get_cvar_num("amx_deathbeams_randcolor") == 1)                {                   write_byte( random_num(50,255) ) // red                   write_byte( random_num(50,255) )   // green                   write_byte( random_num(50,255) )   // blue                }                else                {                   if (killer_team == 1)                   { // Terrorist                      write_byte( 255 ) // red                      write_byte( 0 )   // green                      write_byte( 0 )   // blue                   }                   else                   { // Counter-terrorist                      write_byte( 0 )   // red                      write_byte( 0 )   // green                      write_byte( 255 )   // blue                         }                }                write_byte( 100 ) // brightness                write_byte( 0 )   // speed                message_end()             }          }       }    } } public plugin_precache()    m_spriteTexture = precache_model("sprites/dot.spr") public plugin_init() {    register_plugin("All Death Beams","0.9","SpaceDude")    register_event("DeathMsg","death","a")    register_cvar("amx_deathbeams_enabled","1")    register_cvar("amx_deathbeams_randcolor","0") }

AllMassive 01-27-2006 06:46

Well thx for this fast reply.

BUT (:oops:) - can you modify the script that i DONT NEED the engine-module.

Or are there routines which definatly need the engine-module ?
I used this script <amxx1.60 and i dont needed the engine module.

AllMassive 01-27-2006 06:50

Oh - dammit.

i didnt saw your first line in your post - i'll try.
i always thought that i need the modules that are mentioned by the #includes.

AllMassive 01-27-2006 09:29

Like i thought - still needs the engine module.

:(

VEN 01-27-2006 11:45

Just compile original code and install plugin correctly.
Engine not needed.

AllMassive 01-27-2006 13:06

Thats what i did multiple times - without the engine-module i got bad load .

Brad 01-27-2006 13:37

Try commenting out the include line for engine.

AllMassive 01-27-2006 13:47

Thats what i started with - look at my first post.

The Original *.sma had '#include <amxmod>' - i changed it to '#include <amxmodx>.
With older Versions of AmxModX (before the 1.60 - i didnt use 1.55,) i ran the plugin without needing the engine-module.
Since i switched to Amxx 1.60 i need that Module - without the Engine-Module i get bad load :?
It was user 'Charming' who told me to add this '#include <engine> thing - but it didnt work either.

Brad 01-27-2006 15:04

What does your AMXX log say about the error?

AssKicR 01-27-2006 17:34

why won't you use engine module :/

Charming 01-27-2006 17:41

Yeah i mean why do you care if it uses engine module aslong as it works eh?

Brad 01-27-2006 19:38

The engine module runs even when functions in it are not called, thus increasing CPU usage. We may not be talking about a lot of CPU usage but it is there and thus, should be respected.

AssKicR, you know that.

AllMassive 01-27-2006 23:36

right brad - thats why i want to disable it.

AllMassive 02-03-2006 14:06

Well - so its not possible to modify this sma that it runs without the engine-module ?

I've search the command which are used in this plugin at funcwiki, but i cannot see why it needs the engine-module.

Perhaps there's someone who can point me to the problematical instruction.

Brad 02-03-2006 14:20

Quote:

Originally Posted by Brad
What does your AMXX log say about the error?

When you get bad load, what does it say in your logs? Add "debug" after the plugin name in your plugins.ini.

DaSoul 02-03-2006 14:26

Quote:

Originally Posted by AllMassive
Well - so its not possible to modify this sma that it runs without the engine-module ?

I've search the command which are used in this plugin at funcwiki, but i cannot see why it needs the engine-module.

Perhaps there's someone who can point me to the problematical instruction.

I took out the engine include compiled put it in my plugins.ini and it ran fine. I am not sure why you are having trouble. Are you sure you updated the plugin saved it and copied over the proper compiled plugin?

Des12 02-03-2006 15:48

@DaSoul, he dosen't want to use the Engine module at all due to increased server lag.

AllMassive 02-03-2006 16:01

Strange!

In my local test-enviroment it works without the engine-module - at least i dont get a bad load.

I will check this on the server tommorow morning, when the server is empty.

I will tell the results here.

DaSoul 02-03-2006 17:07

Quote:

Originally Posted by Des12
@DaSoul, he dosen't want to use the Engine module at all due to increased server lag.

I said I took it OUT... I was not running engine module...

AllMassive 02-04-2006 05:12

Strange - why does it work locally - on the server i get this error:

L 02/04/2006 - 11:12:12: [AMXX] Plugin "all_death_beams.amxx" failed to load: Module "engine" required for plugin. Check modules.ini.

???

AllMassive 02-04-2006 05:46

Its working now.

I recompiled everything and reinstalled amxmodx.

Now its working - thanks for your answers !


All times are GMT -4. The time now is 07:27.

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