Raised This Month: $51 Target: $400
 12% 

Replace Entity Strength


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-22-2017 , 02:49   Replace Entity Strength
Reply With Quote #1

Hello. There is a problem with this script. I want to change the strength to 1000 for all entities named glass_votemap . Any help will be appreciated. Thanks !

Code:
//* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>

#define PLUGIN "VoteMap"
#define VERSION "0.1"
#define AUTHOR "DarthMan"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	new entity = -1
	while((entity = fm_find_ent_by_tname(entity, "func_breakable")))
	{
	  DispatchKeyValue(entity,"Strength", "1000");
	}
}

Last edited by DarthMan; 02-22-2017 at 02:55.
DarthMan is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-22-2017 , 04:18   Re: Replace Entity Strength
Reply With Quote #2

You could do set pev health

Instead of tname do classname
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-22-2017 at 04:18.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-22-2017 , 05:02   Re: Replace Entity Strength
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
You could do set pev health

Instead of tname do classname
So what part of code do I ahve to basically change? I ahve enver used pev before.
DarthMan is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-22-2017 , 07:13   Re: Replace Entity Strength
Reply With Quote #4

PHP Code:
#include < amxmodx >
#include < engine >

#define PLUGIN "VoteMap"
#define VERSION "0.1"
#define AUTHOR "DarthMan"

public plugin_init( ) {

    
register_pluginPLUGINVERSIONAUTHOR );
    
    new 
ent = -1
    
while( ( ent find_ent_by_classent"func_breakable" ) ) )
    
    
entity_set_floatentEV_FL_health1000.0 )

__________________

Last edited by edon1337; 02-22-2017 at 07:13.
edon1337 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-22-2017 , 07:27   Re: Replace Entity Strength
Reply With Quote #5

Quote:
Originally Posted by edon1337 View Post
PHP Code:
#include < amxmodx >
#include < engine >

#define PLUGIN "VoteMap"
#define VERSION "0.1"
#define AUTHOR "DarthMan"

public plugin_init( ) {

    
register_pluginPLUGINVERSIONAUTHOR );
    
    new 
ent = -1
    
while( ( ent find_ent_by_classent"func_breakable" ) ) )
    
    
entity_set_floatentEV_FL_health1000.0 )

So that was the way to do it, EV_FL_health .
But another question, how can I make it only apply this to the entities named glass_votemap ?
DarthMan is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-22-2017 , 07:53   Re: Replace Entity Strength
Reply With Quote #6

Quote:
Originally Posted by DarthMan View Post
So that was the way to do it, EV_FL_health .
Idk if it's correct.

Quote:
Originally Posted by DarthMan View Post
But another question, how can I make it only apply this to the entities named glass_votemap ?
Then change func_breakable to glass_votemap ?
__________________
edon1337 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-22-2017 , 08:36   Re: Replace Entity Strength
Reply With Quote #7

Quote:
Originally Posted by edon1337 View Post
Idk if it's correct.



Then change func_breakable to glass_votemap ?
Is this gonna look for the targetname instead of the classname?
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-22-2017 , 08:50   Re: Replace Entity Strength
Reply With Quote #8

Quote:
Originally Posted by DarthMan View Post
Is this gonna look for the targetname instead of the classname?
Code:
public map_lights(id)
{
    new ent_light_1 = create_entity("light")
    entity_set_origin(ent_light_1,Float:{-384.0,952.0,-165.0})
    ready=1
}
This new code adds a light at a given position. Any ideas on how can i set the brightness of the light? Thanks ! This will be used for the panels.
DarthMan is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 02-22-2017 , 10:41   Re: Replace Entity Strength
Reply With Quote #9

pev renders natives ?
killerZM is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-22-2017 , 11:16   Re: Replace Entity Strength
Reply With Quote #10

Quote:
Originally Posted by DarthMan View Post
Is this gonna look for the targetname instead of the classname?
find_ent_by_tname - Finds by targetname

find_ent_by_class - Finds by classname

Quote:
Originally Posted by DarthMan View Post
Code:
public map_lights(id)
{
    new ent_light_1 = create_entity("light")
    entity_set_origin(ent_light_1,Float:{-384.0,952.0,-165.0})
    ready=1
}
This new code adds a light at a given position. Any ideas on how can i set the brightness of the light? Thanks ! This will be used for the panels.
EV_INT_light_level
__________________
edon1337 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:23.


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