AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Maxspeed help... (https://forums.alliedmods.net/showthread.php?t=6852)

spire8989 10-16-2004 22:59

Maxspeed help...
 
How would I stick maxspeed into a plugin so that as soon as a player joined there maxspeed is upped just a little?

spire8989 10-17-2004 02:48

ok well i got the maxspeed working, but my speed in-game won't change, why is this? i go as slow as i do without it set.

Johnny got his gun 10-17-2004 04:41

If you are using CS I think that maxspeed is reset whenever you switch weapons (CurWeapon message), so you might want to check that the maxspeed you change to is always the same.

spire8989 10-17-2004 13:46

It compiles fine except the speed doesn't change. The footsteps and invisibility works though. Here's my code:

Code:

/*
NinjaMod 1.0
By -=|)347}{=-
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

public myfunction(id,level,cid) {
        if (!cmd_access(id,level,cid,1)) {
                return PLUGIN_HANDLED
        }
        client_print(0,print_center,"Welcome to NinjaMod v1.0")
        return PLUGIN_HANDLED
}

public round_start()
{
        client_print(0,print_center,"Setting up everything...")
        new maxplayers = get_maxplayers() + 1
        for(new i=1;i<maxplayers;i++)
        {
                if(is_user_alive(i)) {
                        set_user_maxspeed(i, 500.0)
                        set_user_rendering(i, kRenderFxGlowShell,0,0,0,kRenderTransAlpha,100)
                        set_user_footsteps(i, 1)
                }
        }
        return PLUGIN_CONTINUE
}

public CurWeapon()
{
        new Maxplayers = get_maxplayers() + 1
        for(new t=1;t<Maxplayers;t++)
        {
                if(is_user_alive(t)) {
                        set_user_maxspeed(t, 500.0)
                }
        }
}

public plugin_init() {
        register_plugin("NinjaMod","1.0","|)347}{")
        register_logevent("round_start",2,"0=World triggered","1=Round_Start")
        register_clcmd("amx_welcomein","myfunction",ADMIN_VOTE," : prints NinjaMod v1.0 to everyone")
        return PLUGIN_CONTINUE
}


spire8989 10-18-2004 20:19

Bring
Up
My
Post

DS 10-18-2004 21:11

Looking at your code there, it doesn't look like you registered the event to use CurWeapon. In plugin_init you need to add this:

Code:
register_event("CurWeapon", "CurWeapon", "be", "1=1")

Also within your CurWeapon function, you won't really need the for loop, beause it will called for each player on an individual basis. So maybe something like this is all you really need:
Code:
public CurWeapon(id) {     if(is_user_alive(id)) {         set_user_maxspeed(id, 500.0)     } }


All times are GMT -4. The time now is 17:20.

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