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

The transformation of the code of "engine" on "fakemate"


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Drago36
Junior Member
Join Date: Jul 2014
Old 09-23-2014 , 11:56   The transformation of the code of "engine" on "fakemate"
#1

Hello.

I do not know too much on the conversion of the "engine" to "fakemate". I would request to obecnanego to get it translated.
// google translator

Code:
stock create_camera( id )
{    
    new Float: v_angle[ 3 ], Float: angles[ 3 ];
    entity_get_vector( id, EV_VEC_origin, origin[ id ] );
    entity_get_vector( id, EV_VEC_v_angle, v_angle );
    entity_get_vector( id, EV_VEC_angles, angles );

    new ent = create_entity( "info_target" );

    entity_set_string( ent, EV_SZ_classname, "JJG75_Camera" );

    entity_set_int( ent, EV_INT_solid, 0 );
    entity_set_int( ent, EV_INT_movetype, MOVETYPE_NOCLIP );
    entity_set_edict( ent, EV_ENT_owner, id );
    entity_set_model( ent, "models/camera.mdl" );

    new Float:mins[ 3 ];
    mins[ 0 ] = -1.0;
    mins[ 1 ] = -1.0;
    mins[ 2 ] = -1.0;

    new Float:maxs[ 3 ];
    maxs[ 0 ] = 1.0;
    maxs[ 1 ] = 1.0;
    maxs[ 2 ] = 1.0;

    entity_set_size( ent, mins, maxs );

    entity_set_origin( ent, origin[ id ] );
    entity_set_vector( ent, EV_VEC_v_angle, v_angle );
    entity_set_vector( ent, EV_VEC_angles, angles );

    Util_SetRendering( ent, kRenderFxGlowShell, { 0.0, 0.0, 0.0 }, kRenderTransAlpha, 0.0 );

    camera[ id ] = ent;

    return 1;
}
Drago36 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-23-2014 , 12:20   Re: The transformation of the code of "engine" on "fakemate"
#2

Why do you want to convert it to Fakemeta?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-23-2014 , 13:29   Re: The transformation of the code of "engine" on "fakemate"
#3

There is no reason to convert engine to fakemeta, or fakemeta to engine.
__________________
HamletEagle is offline
Drago36
Junior Member
Join Date: Jul 2014
Old 09-23-2014 , 13:49   Re: The transformation of the code of "engine" on "fakemate"
#4

Quote:
Originally Posted by YamiKaitou View Post
Why do you want to convert it to Fakemeta?
I'm creating a plugin and am using only fakemate, I do not even add engine.
Drago36 is offline
FuckFace32
Junior Member
Join Date: Jul 2014
Location: Romania
Old 09-23-2014 , 13:53   Re: The transformation of the code of "engine" on "fakemate"
#5

Replace entity_get... with pev and entity_set with set_pev. EV_INT/ENT/etc... with pev_...
Example:

entity_get_vector( id, EV_VEC_origin, origin[ id ] );

will become:

pev( id, pev_origin, origin[ id ] );
FuckFace32 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-23-2014 , 14:38   Re: The transformation of the code of "engine" on "fakemate"
#6

Quote:
Originally Posted by Drago36 View Post
I'm creating a plugin and am using only fakemate, I do not even add engine.
Then add it.
__________________
HamletEagle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-23-2014 , 15:09   Re: The transformation of the code of "engine" on "fakemate"
#7

Quote:
Originally Posted by Drago36 View Post
I'm creating a plugin and am using only fakemate, I do not even add engine.
It is a bad coding practice to not use a module "just because you don't want to do so". If you can use engine, you should use engine. If you need fakemeta for a something that engine cannot do, then use fakemeta false (for that function only).
__________________
fysiks is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 09-23-2014 , 16:56   Re: The transformation of the code of "engine" on "fakemate"
#8

Quote:
Originally Posted by FuckFace32 View Post
Replace entity_get... with pev and entity_set with set_pev. EV_INT/ENT/etc... with pev_...
Example:

entity_get_vector( id, EV_VEC_origin, origin[ id ] );

will become:

pev( id, pev_origin, origin[ id ] );
Please, stop giving bad code habbits
baneado is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 09-23-2014 , 22:03   Re: The transformation of the code of "engine" on "fakemate"
#9

Quote:
Originally Posted by baneado View Post
Please, stop giving bad code habbits
FuckFace answered to his question. If the guy want answers to his bad habit coding, let him have it.
__________________
Like my clean plugins and work?
Baws is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-23-2014 , 22:31   Re: The transformation of the code of "engine" on "fakemate"
#10

Quote:
Originally Posted by Baws View Post
If the guy want answers to his bad habit coding, let him have it.
That's not really a good attitude when teaching people anything. It's better to get them informed early, it's much harder to change a habit if you have done it for a long time.

Also, I surely don't want to ask for help from a person that will give me bad advice just because I was trying to do something wrong. They should have the decency to inform me that there is a better way. That way, I can fix the mistake/habit early.
__________________

Last edited by fysiks; 09-23-2014 at 22:33.
fysiks is offline
Closed Thread



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 10:47.


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