Raised This Month: $ Target: $400
 0% 

[ Request ] Special origin. ( units ).


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-30-2012 , 04:32   [ Request ] Special origin. ( units ).
Reply With Quote #1

Hello guys !
I've got a new question ... It's in the code

Code:
#include < amxmodx > #include < engine > #include < fakemeta > new g_flOrigin[ 3 ][ 33 ]; public plugin_init( ) {     register_plugin( "Create an ent" , "1.0" , "Aooka" );         register_clcmd( "say /create" , "ClCmd_Origin" );     register_clcmd( "say_team /create" , "ClCmd_Origin" ); } public ClCmd_Origin( const id ) {     pev( id , pev_origin , g_flOrigin );     /*         Here i just want to call the function wich create the entity.         But not with a task ... I want the ent will create at 200 units         of me.     */ } public CreateEnt( ) {     new iEnt = create_entity( "info_target" );     entity_set_origin( iEnt , g_flOrigin );     entity_set_model( iEnt , g_szEntityMdl );     entity_set_float( iEnt , EV_FL_takedamage , 1.0 );     entity_set_float( iEnt , EV_FL_health , 500.0 );     entity_set_int( iEnt , EV_INT_solid , SOLID_TRIGGER );     entity_set_string( iEnt , EV_SZ_classname , ENT_NAME );     new         Float: SizeMaxs[ 3 ] ,         Float: SizeMins[ 3 ];         SizeMaxs[ 0 ] = 12.0;     SizeMaxs[ 1 ] = 12.0;     SizeMaxs[ 2 ] = 36.0;         SizeMins[ 0 ] = - 12.0;     SizeMins[ 1 ] = - 12.0;     SizeMins[ 2 ] = - 36.0;         entity_set_size( iEnt , SizeMins , SizeMaxs ); }

Thanks in advance all
__________________
Pawn ? Useless
Aooka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2012 , 04:36   Re: [ Request ] Special origin. ( units ).
Reply With Quote #2

Then CreateEnt function doesn't need to be public :

PHP Code:
public ClCmd_Origin( const id )
{
    new 
Float:origin[3]
    
pevid pev_origin origin )
    
origin[2] += 200.0 // 200 above player
    
CreateEntorigin )
}

CreateEnt( const Float:origin[3] )
{
    new 
iEnt create_entity"info_target" );
    
entity_set_originiEnt origin ); 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-30-2012 , 04:55   Re: [ Request ] Special origin. ( units ).
Reply With Quote #3

Oh thanks it's not really hard in fact !

Solved ^^
__________________
Pawn ? Useless
Aooka is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-30-2012 , 05:37   Re: [ Request ] Special origin. ( units ).
Reply With Quote #4

Thats basic programming...
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-30-2012 , 05:55   Re: [ Request ] Special origin. ( units ).
Reply With Quote #5

__________________
Pawn ? Useless
Aooka is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-30-2012 , 12:30   Re: [ Request ] Special origin. ( units ).
Reply With Quote #6

You dont think so? ;P
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
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 02:02.


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