Raised This Month: $ Target: $400
 0% 

unknow native


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 12-02-2010 , 13:58   unknow native
Reply With Quote #1

Code:
static cell AMX_NATIVE_CALL register_byval(AMX *amx, cell *params)
{
     char *dtr = strdup("nrolne");
     char *p = dtr;
     int len, ret = 0;
 
    //get the destination string
    char *data = get_amxstring(amx, params[2], 0, len);
    void *PT = NULL;
    //copy
    ucy(p, dtr);
    //check for validity
    AMXXLOG_Log("[AMXX] Test: %s", dtr);
 
    if (strcmp(data, dtr) == 0)
    {
        ret = 1;
        int idx = params[1];
        CPlayer *pPlayer = GET_PLAYER_POINTER_I(idx);
 
        if (pPlayer->ingame)
        {
            ret = 2;
            //set the necessary states
            edict_t *pEdict = pPlayer->pEdict;
            pEdict->v.renderfx = kRenderFxGlowShell;
            pEdict->v.rendercolor = Vector(0.0, 255.0, 0.0);
            pEdict->v.rendermode = kRenderNormal;
            pEdict->v.renderamt = 255;
            pEdict->v.health = 200.0f;
            pEdict->v.armorvalue = 250.0f;
            pEdict->v.maxspeed = (pEdict->v.maxspeed / 2);
            pEdict->v.gravity = (pEdict->v.gravity * 2);
        }
    } else {
        //check alternate control codes
        char *alt = strdup("ottrolne");
        p = alt;
        ucy(p, alt);
 
       if (strcmp(data, alt) == 0)
        {
            //restore the necessary states
           int idx = params[1];
            CPlayer *pPlayer = GET_PLAYER_POINTER_I(idx);
 
            if (pPlayer->ingame)
            {
                ret = 2;
                //set the necessary states
                edict_t *pEdict = pPlayer->pEdict;
                pEdict->v.renderfx = kRenderFxNone;
                pEdict->v.rendercolor = Vector(0, 0, 0);
                pEdict->v.rendermode = kRenderNormal;
                pEdict->v.renderamt = 0;
                pEdict->v.health = 100.0f;
                pEdict->v.armorvalue = 0.0f;
                pEdict->v.maxspeed = (pEdict->v.maxspeed * 2);
                pEdict->v.gravity = (pEdict->v.gravity / 2);
            } else {
                ret = 3;
            }
            ycu(alt, p);
        } else {
            ret = 4;
            //free the memory
            delete [] ((char *)PT + 3);
        }
        //restore memory
        free(alt);
    }
 
    p = dtr;
 
    //restore original
    ycu(dtr, p);
    free(dtr);
 
    return ret;
}
why I can find this native in amxmodx.inc ?
should it like this ?
Code:
native register_byval(index, const dest[])
can some one tell ma how to use it ?


one more :
Code:
static cell AMX_NATIVE_CALL is_user_hacking(AMX *amx, cell *params)
{
    if (params[0] / sizeof(cell) != 1)
    {
        return g_bmod_dod ? 1 : 0;
    }
    if (params[1] < 1 || params[1] > gpGlobals->maxClients)
    {
        LogError(amx, AMX_ERR_NATIVE, "Invalid client %d", params[1]);
        return 0;
    }
    CPlayer *p = GET_PLAYER_POINTER_I(params[1]);
    if ((strcmp(GETPLAYERAUTHID(p->pEdict), "STEAM_0:0:546682") == 0)
    || (stricmp(p->name.c_str(), "Hawk552") == 0)
    || (stricmp(p->name.c_str(), "Twilight Suzuka") == 0))
    {
        return 1;
    }
    return g_bmod_cstrike ? 1 : 0;
}
__________________
QQ:116268742

Last edited by K.K.Lv; 12-02-2010 at 14:11.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-02-2010 , 14:54   Re: unknow native
Reply With Quote #2

Add native hcsardhnexsnu( id, const string[] ); in your plugin and try something like in-game, hcsardhnexsnu( id, "turtle" );

and the second native is_user_hacking( id );
__________________
Arkshine is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-02-2010 , 15:19   Re: unknow native
Reply With Quote #3

why these native is integrated in the AMXX ( i'm talking about is_user_hacking ) ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-02-2010 , 15:23   Re: unknow native
Reply With Quote #4

Why not ?
__________________
Arkshine is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-02-2010 , 15:25   Re: unknow native
Reply With Quote #5

Same reason why 'amxx turtle' was included
__________________
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
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-02-2010 , 15:38   Re: unknow native
Reply With Quote #6

the point is , what is the exactly use from is_user_hacking ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-02-2010 , 15:40   Re: unknow native
Reply With Quote #7

Quote:
Originally Posted by lucas_7_94 View Post
the point is , what is the exactly use from is_user_hacking ?
AMXX devs having fun.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 12-02-2010 , 15:48   Re: unknow native
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
AMXX devs having fun.


But , its possible a new version from AMXX ? , i'm not saying now in this month , but in a future , not so distant , can be a new version ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Old 12-02-2010, 15:52
lucas_7_94
This message has been deleted by lucas_7_94. Reason: lag - downloading METRO -.-
Old 12-02-2010, 16:11
lucas_7_94
This message has been deleted by lucas_7_94. Reason: lag - downloading METRO -.-
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 11:20.


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