Raised This Month: $ Target: $400
 0% 

Safe Speed Hide'N'Seek coderz


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Trafikkz
Junior Member
Join Date: Apr 2010
Old 08-17-2010 , 17:07   Safe Speed Hide'N'Seek coderz
Reply With Quote #1

Hello, I just want to say how to make this plugin to check and backspeed if is 300 like in the code below. Script is made by coderz and it's called Safe Speed. I really need to edit this because if you have cl_sidespeed 300, cl_backspeed 300 and cl_forwardspeed 300 this plugin doesn't affect anything. cl_sidespeed it's blocked, forwardspeed it's blocked, he just needs backspeed.

Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Safe Side Speed"
#define VERSION "1.1"
#define AUTHOR "coderiz"

new const Float:c_warning_interval = 5.0
new const c_warning[] = "!!! WARNING !!!^n^nYou are using illegal speed settings.^nPlease change your cvar values to defaults:^n^ncl_sidespeed 400^ncl_forwardspeed 400^ncl_backspeed 400"

new Float:plr_warntime[32]
new plr_warnings[32]
new plr_badframe[32]

new Float:vector[3]
new index, buttons
new Float:fw, Float: sd, Float:bw

new hudobj
new hudchannel


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_cvar("safespeed_hud", "-1")
    hudchannel = get_cvar_num("safespeed_hud")
    
    register_forward(FM_CmdStart, "cmdStart")
    register_forward(FM_ClientPutInServer, "putInServer")
    
    hudobj = CreateHudSyncObj()
}

public putInServer(id)
{
    plr_warnings[id-1] = 0
}

public cmdStart(id, uc_handle, seed)
{
    if(pev(id, pev_movetype) != MOVETYPE_WALK) return
    
    index = id - 1
    
    get_uc(uc_handle, UC_ForwardMove, fw)
    get_uc(uc_handle, UC_SideMove, sd)
    get_uc(uc_handle, UC_BackMove, bw)
    buttons = get_uc(uc_handle, UC_Buttons)
    
    if((buttons & IN_LEFT) || (buttons & IN_RIGHT))
    {
        pev(id, pev_velocity, vector)
        vector[0] = vector[0] * 0.8
        vector[1] = vector[1] * 0.8
        vector[2] = vector[2] * 0.8
        set_pev(id, pev_velocity, vector)
    }
    
    if(ff == 0.0 || sd == 0.0 || bw == 0.0) {
        plr_badframe[index] = 0
        return
    }
    
    if(floatabs(ff) != floatabs(sd) != floatabs(bw)) 
    {    
        plr_badframe[index]++
        if(plr_badframe[index] > 5) {
            badSpeedCvar(id)
        }
    } else {
        plr_warnings[index] = 0
        plr_badframe[index] = 0
    }
}

public badSpeedCvar(id)
{
    index = id -1
    
    pev(id, pev_velocity, vector)
    
    if(vector_length(vector) < 80.0) return
    
    vector[0] = vector[0] * 0.9
    vector[1] = vector[1] * 0.9
    vector[2] = vector[2] * 0.9
    
    set_pev(id, pev_velocity, vector)
    
    if(get_gametime() - plr_warntime[index] < c_warning_interval) return
    
    plr_warntime[index] = get_gametime()
    plr_warnings[index]++
    
    set_task(0.1, "plrWarn", id)
}

public plrWarn(id)
{
    index = id -1
    
    if(plr_warnings[index] == 0 || !is_user_connected(id)) return
    
    set_hudmessage(150, 50, 0, -1.0, 0.23, 0, 1.0, 3.0, 0.1, 0.2, hudchannel)
    ShowSyncHudMsg(id, hudobj, c_warning)
    
    set_task(3.0, "plrWarn", id)
}
The only error is at BackMove, undefined symbol, in fakemeta doesn't exist any Backward user command
Trafikkz 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 22:01.


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