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

[INC] Reapi_Stocks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-11-2019 , 07:38   [INC] Reapi_Stocks
Reply With Quote #1

I thought that reapi need have stocks like "engine_stocks.inc" & "fakemeta_stocks.inc"
I will try to add new commands that don't exists in reapi includes.
Hope you like it.

Commands;

PHP Code:
rg_get_user_button(index);
rg_get_user_oldbutton(index);
rg_get_user_flags(index);
rg_set_user_rendering(indexfx kRenderFxNone, {Float,_}:color[3] = {0.0,0.0,0.0}, render kRenderNormalFloat:amount 0.0);
rg_set_user_visibility(indexvisibility);
bool:rg_get_user_visibility(index);
rg_set_user_velocity(index, const Float:vec[3]);
rg_get_user_velocity(indexFloat:vec[3]);
rg_get_speed(index);
rg_user_kill(victimattackerbool:givefragtoattacker true); 
Attached Files
File Type: inc reapi_stocks.inc (2.2 KB, 220 views)
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }


Last edited by PurposeLessx; 08-11-2019 at 07:39.
PurposeLessx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-11-2019 , 10:34   Re: [INC] Reapi_Stocks
Reply With Quote #2

Congratulations, this is the next level of coding.

PHP Code:
stock rg_get_user_button(index)
{
    return 
get_entvar(indexvar_button);
}

stock rg_get_user_oldbutton(index)
{
    return 
get_entvar(indexvar_oldbuttons);
}

stock rg_get_user_flags(index)
{
    return 
get_entvar(indexvar_flags);
}

stock bool:rg_get_user_visibility(index
{
    return !(
get_entvar(indexvar_effects) & EF_NODRAW);
}

stock rg_set_user_velocity(index, const Float:vec[3])
{
    return 
set_entvar(entityvar_velocityvec);
}

stock rg_get_user_velocity(indexFloat:vec[3])
{
    return 
get_entvar(entityvar_velocityvec);
}

stock rg_get_speed(index)
{
    new 
Float:vel[3];
    
get_entvar(indexvar_velocityvel);

    return 
floatround(vector_length(vel));

You forgot one function tho:
PHP Code:
rg_register_plugin(const name[], const version[], const author[])
{
    
register_plugin(nameversionauthor)

__________________

Last edited by HamletEagle; 08-11-2019 at 10:35.
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-11-2019 , 11:19   Re: [INC] Reapi_Stocks
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
Congratulations, this is the next level of coding.

PHP Code:
stock rg_get_user_button(index)
{
    return 
get_entvar(indexvar_button);
}

stock rg_get_user_oldbutton(index)
{
    return 
get_entvar(indexvar_oldbuttons);
}

stock rg_get_user_flags(index)
{
    return 
get_entvar(indexvar_flags);
}

stock bool:rg_get_user_visibility(index
{
    return !(
get_entvar(indexvar_effects) & EF_NODRAW);
}

stock rg_set_user_velocity(index, const Float:vec[3])
{
    return 
set_entvar(entityvar_velocityvec);
}

stock rg_get_user_velocity(indexFloat:vec[3])
{
    return 
get_entvar(entityvar_velocityvec);
}

stock rg_get_speed(index)
{
    new 
Float:vel[3];
    
get_entvar(indexvar_velocityvel);

    return 
floatround(vector_length(vel));

You forgot one function tho:
PHP Code:
rg_register_plugin(const name[], const version[], const author[])
{
    
register_plugin(nameversionauthor)

Fakemeta Util, but it's not as advanced
__________________

Last edited by edon1337; 08-11-2019 at 11:20.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-11-2019 , 12:12   Re: [INC] Reapi_Stocks
Reply With Quote #4

Fakemeta util at least has some stuff that's not only wrappers around already existing functions.
But yeah, fm util is bad for multiple reasons(wrappers being one of them).
__________________
HamletEagle is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-11-2019 , 14:47   Re: [INC] Reapi_Stocks
Reply With Quote #5

So funny (!)
I made this include from engine_stocks.inc.
My purpose is not creating reapi_util.inc.
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }


Last edited by PurposeLessx; 08-11-2019 at 14:47.
PurposeLessx is offline
Reply


Thread Tools
Display Modes

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 18:26.


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