AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   unknow native (https://forums.alliedmods.net/showthread.php?t=144351)

K.K.Lv 12-02-2010 13:58

unknow native
 
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;
}


Arkshine 12-02-2010 14:54

Re: unknow native
 
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 );

lucas_7_94 12-02-2010 15:19

Re: unknow native
 
:crab: why these native is integrated in the AMXX ( i'm talking about is_user_hacking ) ?

Arkshine 12-02-2010 15:23

Re: unknow native
 
Why not ?

YamiKaitou 12-02-2010 15:25

Re: unknow native
 
Same reason why 'amxx turtle' was included

lucas_7_94 12-02-2010 15:38

Re: unknow native
 
the point is , what is the exactly use from is_user_hacking ?

Exolent[jNr] 12-02-2010 15:40

Re: unknow native
 
Quote:

Originally Posted by lucas_7_94 (Post 1361633)
the point is , what is the exactly use from is_user_hacking ?

AMXX devs having fun.

lucas_7_94 12-02-2010 15:48

Re: unknow native
 
Quote:

Originally Posted by Exolent[jNr] (Post 1361634)
AMXX devs having fun.

:bacon::bacon::bacon::bacon::bacon:

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 ?

Exolent[jNr] 12-02-2010 16:52

Re: unknow native
 
That's what the Developer Builds are for.


All times are GMT -4. The time now is 11:20.

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