Coding Help

Active Member
✔️ HL Verified
💻 Oldtimer
Joined
Mar 13, 2005
Messages
3,877
Best answers
0
Code:
public client_PostThink(id)

{

	new entity; 
	new maxentities = get_global_int(GL_maxEntities); 
    
	for( entity = 1; entity < maxentities; entity++) { 
	   if ( !is_valid_ent( entity ) ) 
	      continue; 
            
	   new owner = entity_get_edict( entity, EV_ENT_owner ); 
	   if( owner == id ) { 
          
	      new szModel[32]; 
	      entity_get_string( entity, EV_SZ_model, szModel, 31 ); 
             
	      if( containi( szModel, "aura" ) != -1 ) { 
	         entity_set_int( entity, EV_INT_skin, 1 );
	      } 
	   } 
	}

	return PLUGIN_CONTINUE

Is this right to change the Turbo Color?




And this should change the sprites out right?

Code:
public client_PostThink(id)

{

	new ent = find_ent_in_sphere( -1, vOrigin, 64.0 ); 
	while( ent > 0 )

	{ 

		new szModel[32]; 
		entity_get_string( ent, EV_SZ_model, szModel, 31 ); 
		if( containi( szModel, "sprites/sprite.spr" ) != -1 )

		{ 

	        	entity_set_model( ent, "sprites/sprite2.spr" ); 

		} 

	}

	return PLUGIN_CONTINUE

}
 
Active Member
✔️ HL Verified
💻 Oldtimer
Joined
Nov 6, 2004
Messages
3,055
Best answers
0
Code:
new iEnt
while ((iEnt = find_ent_in_sphere(-1, vOrigin, 64.0)) != 0)
{
// Do whatever
}
You created an infinite loop. The above is the proper method. I wouldn't know about the other stuff, I don't really code for ESF. The code looks right in theory though.
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Code:
public client_PostThink(id)

{

	new entity; 
	new maxentities = get_global_int(GL_maxEntities); 
    
	for( entity = 1; entity < maxentities; entity++) { 
	   if ( !is_valid_ent( entity ) ) 
	      continue; 
            
	   new owner = entity_get_edict( entity, EV_ENT_owner ); 
	   if( owner == id ) { 
          
	      new szModel[32]; 
	      entity_get_string( entity, EV_SZ_model, szModel, 31 ); 
             
	      if( containi( szModel, "aura" ) != -1 ) { 
	         entity_set_int( entity, EV_INT_skin, 1 );
	      } 
	   } 
	}

	return PLUGIN_CONTINUE

Is this right to change the Turbo Color?
No. This is:
Code:
#include <amxmodx>
#include <fakemeta>

new g_iMaxPlayers;

public plugin_init()
{
	register_forward(FM_EmitSound, "fwdEmitSound");

	g_iMaxPlayers = get_maxplayers();
}

public fwdEmitSound(iClient, iEntity, szSample[])
{
	if (!(1 <= iClient <= g_iMaxPlayers))
		return;

	if (!equal(szSample, "weapons/aura.wav") && !equal(szSample, "weapons/swoop.wav"))
		return;

	iEntity = g_iMaxPlayers + 1;

	while ((iEntity = engfunc(EngFunc_FindEntityByString, iEntity, "model", "models/aura.mdl")) > 0)
	{
		if (pev(iEntity, pev_owner) != iClient)
			continue;

		set_pev(iEntity, pev_skin, 1);

		break;
	}
}
You can still use Engine module to get entity owner and set entity's skin, though.
 
Last edited:
Active Member
✔️ HL Verified
💻 Oldtimer
Joined
Mar 13, 2005
Messages
3,877
Best answers
0
Ahhh Thanks.

I am still working on a bit of stuff.



Code:
#include <amxmodx>
#include <fun>
#include <engine>
#include <fakemeta>

public plugin_init()

{

	register_plugin("Attack modification","1.0","DS")
	register_message( get_user_msgid( "EETrail" ), "trail" );

	return PLUGIN_CONTINUE

}

new sprite
new sprite2

public trail( id )

{

	new playerID = get_msg_arg_int( 1 );

	new clip,ammo

	new weapon = get_user_weapon( pid, clip, ammo )
   
	if( weapon == WEAPON )

	{

		set_msg_arg_int( 5, ARG_SHORT, sprite ); // beam start
		set_msg_arg_int( 6, ARG_SHORT, sprite ); // beam head
		set_msg_arg_int( 7, ARG_SHORT, sprite );
		set_msg_arg_int( 8, ARG_SHORT, sprite2 ); // trail

		return PLUGIN_CONTINUE;

	}
   

	return PLUGIN_CONTINUE;

}

Right?
 
Last edited:
Active Member
✔️ HL Verified
💻 Oldtimer
Joined
Nov 6, 2004
Messages
3,055
Best answers
0
You don't actually do anything with clip or ammo, so you can just use one variable like this:
Code:
new iTemp
new iWeapon = get_user_weapon(id, iTemp, iTemp)
Otherwise, if you know those are the right arguments for the message, yes, it should be correct.
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
You don't ever have to provide second and third arguments in get_user_weapon().
 
Former Forcepit Member :(
✔️ HL Verified
💻 Oldtimer
Joined
Aug 21, 2006
Messages
1,715
Best answers
0
my bad i posted a vid in the wrong Thread LOLS
 
Last edited:

Users who are viewing this thread

Top