AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help when take weapon 500 speed goes 250 (https://forums.alliedmods.net/showthread.php?t=209366)

wizz 02-24-2013 15:36

Need help when take weapon 500 speed goes 250
 
hello! i have vipmenu with speed what makes speed "500"
but when i take weapon the speed goes "250"

Help please :)
_____________________________________________ ______________________
{
if( is_user_alive( id ) )
{
client_print(id, print_chat, "[VIP]: You get speed!")
set_user_maxspeed(id, 500.0);
}
}

Kard1nal 02-25-2013 01:27

Re: Need help when take weapon 500 speed goes 250
 
Check sv_maxspeed

wizz 02-25-2013 13:40

Re: Need help when take weapon 500 speed goes 250
 
Quote:

Originally Posted by Kard1nal (Post 1901469)
Check sv_maxspeed

no,, i have problem when i take /vipmenu speed then speed goes 500 (its okay) and if i take weapon now the speed goes 250 back (NOT OKAY)
i want if i take weapon the speed not goes back 250..

YamiKaitou 02-25-2013 13:44

Re: Need help when take weapon 500 speed goes 250
 
MaxSpeed is dependent on the weapon the client is using, so you need to reset it when the client changes weapons as well.

wizz 02-25-2013 16:58

Re: Need help when take weapon 500 speed goes 250
 
Quote:

Originally Posted by YamiKaitou (Post 1901765)
MaxSpeed is dependent on the weapon the client is using, so you need to reset it when the client changes weapons as well.

and hoi i do that?

CrAsH.94 02-25-2013 19:41

Re: Need help when take weapon 500 speed goes 250
 
1)Create a global array

Code:

new szPlayerSpeed[33]
2)Add to plugin_init()

Code:

register_event("CurWeapon", "FixSpeed", "be", "1=1")
register_event("HLTV", "RoundStart", "a", "1=0", "2=0")

3)Added to the end

Code:

public RoundStart()
{
    new szPlayers[32]
    new szNum, szPlayer
   
    get_players(szPlayers, szNum)
   
    for (new i; i < szNum; i++)
    {
        szPlayer = szPlayers[i]

        if(!szPlayerSpeed[szPlayer])
            continue

        szPlayerSpeed[szPlayer] = false
    }
}

public FixSpeed(id)
{
    if(is_user_alive(id) && is_user_connected(id))
    {
        if(szPlayerSpeed[id])
        {
            set_user_maxspeed(id, 500.0)
        }
    }
}

4)In issuing speed

Code:

szPlayerSpeed[id] = true

wizz 05-26-2013 16:34

Re: Need help when take weapon 500 speed goes 250
 
Quote:

Originally Posted by CrAsH.94 (Post 1901988)
1)Create a global array

Code:

new szPlayerSpeed[33]
2)Add to plugin_init()

Code:

register_event("CurWeapon", "FixSpeed", "be", "1=1")
register_event("HLTV", "RoundStart", "a", "1=0", "2=0")

3)Added to the end

Code:

public RoundStart()
{
    new szPlayers[32]
    new szNum, szPlayer
   
    get_players(szPlayers, szNum)
   
    for (new i; i < szNum; i++)
    {
        szPlayer = szPlayers[i]

        if(!szPlayerSpeed[szPlayer])
            continue

        szPlayerSpeed[szPlayer] = false
    }
}

public FixSpeed(id)
{
    if(is_user_alive(id) && is_user_connected(id))
    {
        if(szPlayerSpeed[id])
        {
            set_user_maxspeed(id, 500.0)
        }
    }
}

4)In issuing speed

Code:

szPlayerSpeed[id] = true

Thank you, its working. :)


All times are GMT -4. The time now is 21:38.

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