Raised This Month: $ Target: $400
 0% 

Speedmeter +AmmoPacks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hn.S Xmix
Member
Join Date: May 2021
Old 04-25-2024 , 20:32   Speedmeter +AmmoPacks
Reply With Quote #1

Hello

i tried my best to edit a plugin speedmeter for players get only 1 ammopacks every time they reach 1800 speed. But the problem is if the players stay at +1800 speed for too long they will get a lot of Aps as you can see in Screan Shot

Request: Is it possible to make a players get 1 ammo packs everytime they hit 1800 speed?


Attached Files
File Type: sma Get Plugin or Get Source (zp_addons_speedometer.sma - 41 views - 2.8 KB)
Hn.S Xmix is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-25-2024 , 21:49   Re: Speedmeter +AmmoPacks
Reply With Quote #2

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...
__________________
bigdaddy424 is offline
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
Old 04-26-2024, 08:53
Tote
This message has been deleted by Tote.
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-26-2024 , 20:59   Re: Speedmeter +AmmoPacks
Reply With Quote #4

Quote:
Originally Posted by Hn.S Xmix View Post

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
I checked it and tested it on my friends server. It should work normally

PHP Code:
SpeedTask(id)
{
    static 
get
    
new name[32]
    
get_user_name(idname31)
    static 
itarget
    
static Float:velocity[3]
    static 
Float:speedFloat:speedh
    
static Float:lastSpeedCheck[33]
    static 
Float:lastAmmoPackTime[33]
    static 
Float:cooldownTime 10.0
    
    
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 >= 1800 && lastSpeedCheck[i] < 1800)
        {
            
lastSpeedCheck[i] = speedh
            Float currentTime 
get_gametime()
            if(
currentTime lastAmmoPackTime[i] >= cooldownTime)
            {
                
lastAmmoPackTime[i] = currentTime
                zp_set_user_ammo_packs
(izp_get_user_ammo_packs(i) + 1
                
ColorChat(iTEAM_COLOR"^4[ZP] ^1You Got^3 1 ^4Ammo Pack")
            }
        }
        
        if(
speedh 1800 && lastSpeedCheck[i] >= 1800)
        {
            
lastSpeedCheck[i] = speedh
        
}
        
        
// SPEED
        
if(speedh >= 1800)
        {
            
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 >= 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)
        }
    }

__________________
CS:CZ > CS 1.6

Last edited by Ace67; 04-26-2024 at 21:09.
Ace67 is offline
Hn.S Xmix
Member
Join Date: May 2021
Old 04-27-2024 , 08:03   Re: Speedmeter +AmmoPacks
Reply With Quote #5

It work so good i wasn't expecting to see so much changes you are absolutely genius, im trying so hard to be like you. by the way..

i got this error
Quote:
Error: Undefined symbol "Float" on line 104
Error: Undefined symbol "currentTime" on line 105
Error: Undefined symbol "currentTime" on line 107

3 Errors.
Could not locate output file C:\Users\BST\Desktop\plugin\zp_addons_speedom eter.amx (compile failed).
so i kinda fix it and it work perfectly. i have change this
----->

PHP Code:
Float currentTime get_gametime() 
to this
----->

PHP Code:
static Float:currentTime
currentTime 
get_gametime() 
Hn.S Xmix is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-27-2024 , 17:25   Re: Speedmeter +AmmoPacks
Reply With Quote #6

Quote:
Originally Posted by Hn.S Xmix View Post
It work so good i wasn't expecting to see so much changes you are absolutely genius, im trying so hard to be like you. by the way..

i got this error


so i kinda fix it and it work perfectly. i have change this
----->

PHP Code:
Float currentTime get_gametime() 
to this
----->

PHP Code:
static Float:currentTime
currentTime 
get_gametime() 
Strange, there were no errors in my friends servers console. Enjoy buddy if you need help feel free to PM me.
__________________
CS:CZ > CS 1.6

Last edited by Ace67; 04-27-2024 at 17:27.
Ace67 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 14:36.


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