Raised This Month: $ Target: $400
 0% 

Basic Lj stats help.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-05-2009 , 21:59   Re: Basic Lj stats help.
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #pragma semicolon 1 // Boo new bool:gInAir[33]; new const gPLUGIN[] = "ljstats"; new const gVERSION[] = "0.1"; new const gAUTHOR[] = "Fatalis"; public plugin_init() {     register_plugin(gPLUGIN, gVERSION, gAUTHOR);         register_cvar(gPLUGIN, gVERSION, FCVAR_SERVER);         register_forward(FM_PlayerPreThink, "fwdPlayerPreThink", 0); } public fwdPlayerPreThink(id) {     if( is_user_alive(id) )     {         static Float:vJumpedAt[33][3];         static Float:vOrigin[3];         static Float:vAngles[3];         static Float:vTraceEnd[3];                 if( pev(id, pev_button)&IN_JUMP         && pev(id, pev_flags)&FL_ONGROUND         && gInAir[id] == false)         {             gInAir[id] = true;                         pev(id, pev_origin, vOrigin);                         vOrigin[2]-=36.0;                         pev(id, pev_v_angle, vAngles);                         vOrigin[0]-=16.0*floatcos(vAngles[1], degrees);             vOrigin[1]-=16.0*floatsin(vAngles[1], degrees);                         vJumpedAt[id][0] = vOrigin[0];             vJumpedAt[id][1] = vOrigin[1];             vJumpedAt[id][2] = vOrigin[2];         }         else if( pev(id, pev_flags)&FL_ONGROUND && gInAir[id] == true )         {             gInAir[id] = false;                         pev(id, pev_origin, vOrigin);             pev(id, pev_v_angle, vAngles);                         vOrigin[0]+=16.0*floatcos(vAngles[1], degrees);             vOrigin[1]+=16.0*floatsin(vAngles[1], degrees);                         vTraceEnd[0] = vOrigin[0];             vTraceEnd[1] = vOrigin[1];             vTraceEnd[2] = vOrigin[2];             vTraceEnd[2]-=64.0;                         static Float:vLandedAt[3];             fm_trace_line(id, vOrigin, vTraceEnd, vLandedAt);                         static Float:fDistance;             fDistance = get_distance_f(vJumpedAt[id], vLandedAt);                         if( vJumpedAt[id][2] == vLandedAt[2] && fDistance > 210.0 )             {                     client_print(id, print_chat, "distance: %f", fDistance);             }         }     }         return FMRES_IGNORED; } fm_trace_line(ignoreEnt, const Float:vStart[3], const Float:vEnd[3], Float:vRet[3]) {     engfunc(EngFunc_TraceLine, vStart, vEnd, ignoreEnt == -1 ? 1 : 0, ignoreEnt);     new ent = global_get(glb_trace_ent);     global_get(glb_trace_endpos, vRet);     return pev_valid(ent) ? ent : 0; }

Okay, code is fixed, but there will still be bugs in the stats, such as cheating with noclip, ladders, teleports, etc.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



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 17:02.


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