Raised This Month: $ Target: $400
 0% 

Maxspeed help...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spire8989
Junior Member
Join Date: Oct 2004
Old 10-16-2004 , 22:59   Maxspeed help...
Reply With Quote #1

How would I stick maxspeed into a plugin so that as soon as a player joined there maxspeed is upped just a little?
spire8989 is offline
spire8989
Junior Member
Join Date: Oct 2004
Old 10-17-2004 , 02:48  
Reply With Quote #2

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.
spire8989 is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 10-17-2004 , 04:41  
Reply With Quote #3

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.
Johnny got his gun is offline
spire8989
Junior Member
Join Date: Oct 2004
Old 10-17-2004 , 13:46  
Reply With Quote #4

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 is offline
spire8989
Junior Member
Join Date: Oct 2004
Old 10-18-2004 , 20:19  
Reply With Quote #5

Bring
Up
My
Post
spire8989 is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 10-18-2004 , 21:11  
Reply With Quote #6

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)     } }
DS 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 17:20.


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