AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Module: CSX Extended 2.0.1.0 (https://forums.alliedmods.net/showthread.php?t=236021)

Shooting King 02-26-2014 11:55

Re: Module: CSX Extended (v1.0.1)
 
A Simple but efficient reset_user_stats (Explicitly calling Stats() constructor)
PHP Code:

static cell AMX_NATIVE_CALL reset_user_stats(AMX *amxcell *params)  /*1 param */
{
    
int index params[1];
    
CHECK_PLAYERRANGE(index);
    
CPlayerpPlayer GET_PLAYER_POINTER_I(index);

    if( 
pPlayer->rank )
    {
        
pPlayer->rank->Stats::Stats();
        
pPlayer->PutInServer();
        
pPlayer->rank->updatePosition(pPlayer->rank);
        return 
1;
    }
    return 
0;


https://github.com/ShootingKing-AM/csx/

Edit:
You can remove WinCSX from your project, This update is not related to WinCSX.

_GamerX 02-28-2014 05:44

Re: Module: CSX Extended (v1.0.1)
 
Please make Linux verison !

souvikdas95 03-02-2014 11:44

Re: Module: CSX Extended (v1.1)
 
^ compiled. please see if it works or not

K.K.Lv 03-02-2014 12:17

Re: Module: CSX Extended (v1.1)
 
just fixed your code guy :down:!
Code:
static cell AMX_NATIVE_CALL get_user_score(AMX *amx, cell *params)  /*3 param */ {     int index = params[1];     CHECK_PLAYER(index);     CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);     params[1] = pPlayer->pEdict->v.frags;     params[2] = *((int *)pPlayer->pEdict->pvPrivateData + OFFSET_CSDEATHS);     return 1; }

Code:
static cell AMX_NATIVE_CALL set_user_score(AMX *amx, cell *params)  /*3 param */ {     int index = params[1];     CHECK_PLAYER(index);     CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);     pPlayer->restartStats();     pPlayer->setScore(params[1],params[2]);     return 1; }

souvikdas95 03-02-2014 12:21

Re: Module: CSX Extended (v1.1)
 
hmm... sorry for that... will fix in the upcoming version... just a few heads up...
will be including separate native for sql to file n file to sql operation :). Claudhiks will be helping with that :)

K.K.Lv 03-02-2014 12:29

Re: Module: CSX Extended (v1.1)
 
I think use MF_GetAmxAddr in "get_user_score" will be better
something like this:
Code:
native get_user_score(index, &frag, &deads);

Shooting King 03-02-2014 12:44

Re: Module: CSX Extended (v1.1)
 
We are thinking to remove get_user_score(), because we already have get_user_[frags|deaths]().


EDIT: Can You please BOLD The code that you had fixed ?

K.K.Lv 03-02-2014 12:59

Re: Module: CSX Extended (v1.1)
 
like this:
Code:
static cell AMX_NATIVE_CALL get_user_score(AMX *amx, cell *params)  /*3 param */ {     int index = params[1];     CHECK_PLAYER(index);     CPlayer* pPlayer = GET_PLAYER_POINTER_I(index);     cell *pFrags = MF_GetAmxAddr(amx, params[2]);     cell *pDeads = MF_GetAmxAddr(amx, params[3]);     *pFrags = amx_ftoc(pPlayer->pEdict->v.frags);     *pDeads = *((int *)pPlayer->pEdict->pvPrivateData + OFFSET_CSDEATHS);     return 1; }

Shooting King 03-05-2014 11:45

Re: Module: CSX Extended (v1.1)
 
5 Attachment(s)
CSX Extended v1.2 Released.

Change log 1.2 -
  • Now Module uses Binary Search instead of slow old Sequential Search for some natives like get_stats(), get_stats2(), get_user_rank() etc.

    Spoiler

    get_stats()

    Comparison Table(loops)


  • get_user_rank(id) native is added.
  • force_save_stats() native is now modified to take custom file path for saving stats file.

    Spoiler

  • Removed get_user_score() native.
  • Changed reset_user_score() from native to stock, as set_user_score() and this, has the same function.

    Spoiler

  • Changed get_stats_size() from native to stock.

    Spoiler

  • Modified csstats.inc to keep backward compatibility intact.
  • Fixed some bugs in natives.

    csstats_extended.inc

    csstats.inc

GitHub : https://github.com/ShootingKing-AM/csx

^SmileY 03-06-2014 09:09

Re: Module: CSX Extended (v1.1)
 
Guys i not sure, but you can check the new stats from Amx Mod 2010.1 and fork with you projects :)
Like Played time, rounds i think (And provide support for assits will be n1ce)

Ps. I think it is like get_stats2(somearray[8]);


All times are GMT -4. The time now is 19:45.

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