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

Module: CSX Extended 2.0.1.0


Post New Thread Reply   
 
Thread Tools Display Modes
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 02-26-2014 , 11:55   Re: Module: CSX Extended (v1.0.1)
Reply With Quote #11

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.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 02-26-2014 at 12:07.
Shooting King is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 02-28-2014 , 05:44   Re: Module: CSX Extended (v1.0.1)
Reply With Quote #12

Please make Linux verison !
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-02-2014 , 11:44   Re: Module: CSX Extended (v1.1)
Reply With Quote #13

^ compiled. please see if it works or not
souvikdas95 is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-02-2014 , 12:17   Re: Module: CSX Extended (v1.1)
Reply With Quote #14

just fixed your code guy !
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; }
__________________
QQ:116268742

Last edited by K.K.Lv; 03-02-2014 at 12:20.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
souvikdas95
Senior Member
Join Date: Mar 2012
Old 03-02-2014 , 12:21   Re: Module: CSX Extended (v1.1)
Reply With Quote #15

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

Last edited by souvikdas95; 03-02-2014 at 12:21.
souvikdas95 is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-02-2014 , 12:29   Re: Module: CSX Extended (v1.1)
Reply With Quote #16

I think use MF_GetAmxAddr in "get_user_score" will be better
something like this:
Code:
native get_user_score(index, &frag, &deads);
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 03-02-2014 , 12:44   Re: Module: CSX Extended (v1.1)
Reply With Quote #17

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 ?
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 03-02-2014 at 12:46.
Shooting King is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-02-2014 , 12:59   Re: Module: CSX Extended (v1.1)
Reply With Quote #18

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; }
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 03-05-2014 , 11:45   Re: Module: CSX Extended (v1.1)
Reply With Quote #19

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
Attached Files
File Type: zip csx-extended-v1.2.zip (58.4 KB, 177 views)
File Type: dll csx_amxx.dll (418.5 KB, 263 views)
File Type: so csx_amxx_i386.so (63.2 KB, 277 views)
File Type: inc csstats.inc (105 Bytes, 279 views)
File Type: inc csstats_extended.inc (5.2 KB, 287 views)
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 03-06-2014 , 09:09   Re: Module: CSX Extended (v1.1)
Reply With Quote #20

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]);
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 04:10.


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