Raised This Month: $ Target: $400
 0% 

Basic Lj stats help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
{PHILMAGROIN}
Senior Member
Join Date: Aug 2007
Location: In the middle of the des
Old 03-04-2009 , 21:47   Basic Lj stats help.
Reply With Quote #1

I got this basic lj stats from kz monkeys site. and I have been deleting code just trying to get very basic jump distance. I have it to where it compiles fine with no errors but there is no stats showing. its probably something simple but i have no idea and was wondering if someone could help here is the code

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #pragma semicolon 1 #define FAST_SERVER // 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);     register_forward(FM_Touch, "fwdTouch", 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];         static Float:vVelocity[3];                 pev(id, pev_velocity, vVelocity);             if( gInAir[id] == true )         {                 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; }
__________________
[B]
{PHILMAGROIN} is offline
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
{PHILMAGROIN}
Senior Member
Join Date: Aug 2007
Location: In the middle of the des
Old 03-05-2009 , 22:05   Re: Basic Lj stats help.
Reply With Quote #3

thats how i want it thanks!
__________________
[B]
{PHILMAGROIN} is offline
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 17:02.


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