Raised This Month: $ Target: $400
 0% 

First plugin help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Rohit
Junior Member
Join Date: Nov 2005
Old 04-04-2006 , 13:48  
Reply With Quote #7

'K, now the event is working. But now it has another problem, with line 18.
here's the code ( line 18 is the register_concmd, problem with cv_speed )
Code:
public plugin_init() {
	register_plugin("Eerste plugin", "1.0", "Ro-WieT")
	register_event("CurWeapon","Event_CurWeapon","be") 
	register_cvar("m4a1_on","1") 
	register_concmd("amx_m4","cv_speed", ADMIN_CVAR," : <0 or 1 or 2> Change's CVAR")
}

public Event_CurWeapon(id)
	{
	new iClip, iAmmo, iWeapID = get_user_weapon(id, iClip, iAmmo)
	{
		if (get_cvar_num("m4a1_on") == 0)
			{
			if (iWeapID == TSW_M4A1)
				set_user_maxspeed (id, 275.0)
			else
				set_user_maxspeed (id, 275.0)
		}
		
		if (get_cvar_num("m4a1_on") == 1)
			{
			if (iWeapID == TSW_M4A1)
				set_user_maxspeed (id, 1500.0)
			else 
				set_user_maxspeed (id, 275.0)
		}
		
		if (get_cvar_num("m4a1_on") == 2)
			{
			if (iWeapID == TSW_M4A1)
				{
				set_user_maxspeed (id, 1500.0)
				ts_createpwup (TSPWUP_SUPERJUMP) + 256
			}
			else
				{
				set_user_maxspeed (id, 1500.0)
				ts_createpwup (TSPWUP_SUPERJUMP) - 256
			}
		}
		
	}
}
Rohit is offline
 



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 16:41.


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