View Single Post
Hn.S Xmix
Member
Join Date: May 2021
Old 04-26-2024 , 07:31   Re: Speedmeter +AmmoPacks
Reply With Quote #3

Quote:
Originally Posted by bigdaddy424 View Post
keeping this logic the player will get 1 ammo pack every FREQ seconds, in this case thats 0.1 or 10 ammo packs per second
you have 2 options. either give player 1 ammo pack every few seconds if they keep a constant speed of 1800+ or give player 1 ammo pack once they reach 1800 and in order to get another one, speed has to drop down around 1100 so its safe to assume that theyre not abusing or benefiting from the small lump where hitting 1799 and 1800 again will get you another ammo pack...
Thank you. those ideas are good but..

i did this actually before and it work but sometimes the player will not get any aps bcs if they strafe with +500 fps the speed will increase and jump EX: from 1795 to 1810 in 0.1 second so he will not get any aps + there is another problem some maps got ramp pucher that puch you with +1900 speed so there is no chance getting AmmoPacks

PHP Code:
SpeedTask(id)
{
    static 
get
        
new name[32]
    
get_user_name(idname31)
    static 
itarget
    
static Float:velocity[3]
    static 
Float:speedFloat:speedh
    
    
for(i=1i<=maxplayersi++)
    {
        if(!
is_user_connected(i)) continue
        if(!
plrSpeed[i]) continue
        
        
target pev(ipev_iuser1) == pev(ipev_iuser2) : i
        pev
(targetpev_velocityvelocity)

        
speed vector_length(velocity)
        
speedh floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
        
        static 
rgb
        
if(speedh >= 1805)
        {
            
255
            g 
20
            b 
20
        set_hudmessage
(rgb, -1.00.700.0FREQ0.010.0)
        
ShowSyncHudMsg(iSyncHud"%3.2f units/second^n%3.2f velocity^n^nWow! You Hit 1800 Speed!!!!"speedspeedh)
        
        }
        else if(
speedh >= 1800)
        {
            
255
            g 
20
            b 
20
        zp_set_user_ammo_packs
(izp_get_user_ammo_packs(i) + get_pcvar_num(zp_ammo_packs_get))
        
ColorChat(iTEAM_COLOR"^4[ZP] ^1You Got^3 %i ^4Ammo Packs"get_pcvar_num(zp_ammo_packs_get))
        
set_hudmessage(rgb, -1.00.700.0FREQ0.010.0)
        
ShowSyncHudMsg(iSyncHud"%3.2f units/second^n%3.2f velocity^n^nWow! You Hit 1800 Speed!!!!"speedspeedh)

        }
        else if(
speedh >= 1000)
        {
            
255
            g 
215
            b 
0
        set_hudmessage
(rgb, -1.00.700.0FREQ0.010.0)
        
ShowSyncHudMsg(iSyncHud"%3.2f units/second^n%3.2f velocity^n^nYou Hit 1000 Speed"speedspeedh)
        }
        else if(
speedh >= 500)
        {
            
20
            g 
255
            b 
20
        set_hudmessage
(rgb, -1.00.700.0FREQ0.010.0)
        
ShowSyncHudMsg(iSyncHud"%3.2f units/second^n%3.2f velocity^n^nYou Hit 500 Speed"speedspeedh)
        }
        else
        {
            
255
            g 
255
            b 
255
        set_hudmessage
(rgb, -1.00.700.0FREQ0.010.0)
        
ShowSyncHudMsg(iSyncHud"%3.2f units/second^n%3.2f velocity"speedspeedh)
        }
    }

i have question, is it possible to make ammopacks duration? i mean if the player hit +1800 speed he will get 1 aps every 10 seconds

Last edited by Hn.S Xmix; 04-26-2024 at 07:33.
Hn.S Xmix is offline