Raised This Month: $ Target: $400
 0% 

First plugin help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rohit
Junior Member
Join Date: Nov 2005
Old 04-02-2006 , 16:43   First plugin help
Reply With Quote #1

Hello,

When I load my (first) plugin in the server. It says that de event is wrong. Ramono and I couldn't find the good event. So I hope if one of you guys can help me

And yes, the code is from Ramono I have permission from him 2 use it. And I'm justing practicing

//edit
Forgotten
it's for TS


Code:
public plugin_init() {
	register_plugin("Eerste plugin", "1.0", "Ro-WieT")
	register_event("Curweapon","Event_curweapon", "be")
	register_cvar("sv_speed", "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("sv_speed") == 0)
		{
			if (iWeapID == TSW_M4A1)
			set_user_maxspeed (id, 275.0)
			else
			set_user_maxspeed (id, 275.0)
		}
		
		if (get_cvar_num("sv_speed") == 1)
		{
			if (iWeapID == TSW_M4A1)
			set_user_maxspeed (id, 1500.0)
			else 
			set_user_maxspeed (id, 275.0)
		}
		
		if (get_cvar_num("sv_speed") == 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
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-02-2006 , 17:21  
Reply With Quote #2

Curweapon CurWeapon
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Rohit
Junior Member
Join Date: Nov 2005
Old 04-03-2006 , 14:13  
Reply With Quote #3

Quote:
Originally Posted by Hawk552
Curweapon CurWeapon
k, thanks.
Will test it out
//edit

It's doesn't work's, but I was forgotten 2 say that it is for TS
Rohit is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-03-2006 , 16:33  
Reply With Quote #4

In the server console, type "meta game" and give me the results.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Rohit
Junior Member
Join Date: Nov 2005
Old 04-04-2006 , 10:07  
Reply With Quote #5

Quote:
Originally Posted by Hawk552
In the server console, type "meta game" and give me the results.
Ok, here's the meta game list.
Code:
meta game
GameDLL info:
        name: ts
        desc: The Specialists
     gamedir: c:\program files\steam\steamapps\princepersia\half-life/ts
    dll file: mp.dll
dll pathname: c:\program files\steam\steamapps\princepersia\half-life/ts/dlls/mp.dll
Game registered user msgs:    msgid   size
   VoiceMask                    64      8
   ReqState                     65      0
   SelAmmo                      66      4
   CurWeapon                    67      3
   Geiger                       68      1
   Flashlight                   69      2
   FlashBat                     70      1
   Health                       71      1
   Damage                       72     12
   Battery                      73      2
   Train                        74      1
   HudText                      75     -1
   SayText                      76     -1
   TextMsg                      77     -1
   WeaponList                   78     -1
   ResetHUD                     79      1
   InitHUD                      80      0
   GameTitle                    81      1
   DeathMsg                     82     -1
   ScoreInfo                    83      9
   TeamInfo                     84     -1
   TeamScore                    85     -1
   GameMode                     86      1
   MOTD                         87     -1
   ServerName                   88     -1
   AmmoPickup                   89      2
   WeapPickup                   90      1
   ItemPickup                   91     -1
   HideWeapon                   92      1
   SetFOV                       93      1
   ShowMenu                     94     -1
   ScreenShake                  95      6
   ScreenFade                   96     10
   AmmoX                        97      2
   TeamNames                    98     -1
   VGUIMenu                     99      1
   WeaponInfo                  100      6
   ClipInfo                    101      1
   WStatus                     102      2
   ActItems                    103      2
   KFuPower                    104      1
   TSHealth                    105      1
   TSArmor                     106      1
   TSState                     107      1
   TSCash                      108      2
   TSSpace                     109      1
   NextStunt                   110      1
   PwUp                        111      3
   PwUpTime                    112      1
   RoundTime                   113      2
   Objective                   114     -1
   DelObj                      115      1
   Wires                       116      3
   GloSlow                     117      1
   SrvSett                     118      3
   TSPAward                    119      2
   TSBTime                     120      1
   TSHVoice                    121      1
   CustomWP                    122     -1
   Spectator                   123      2
   TSMessage                   124     -1
   TSSlowMo                    125      2
   PTakeDam                    126     13
   TSFrags
Rohit is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-04-2006 , 10:25  
Reply With Quote #6

I see CurWeapon in that list. You must be doing it incorrectly.

Code:
register_event("CurWeapon","my_function","be","1>0")
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 04-04-2006 , 13:53  
Reply With Quote #8

I think you need a cvar:
Code:
register_cvar("amx_m4","0")

http://www.amxmodx.org/funcwiki.php?...cvar&go=search
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Rohit
Junior Member
Join Date: Nov 2005
Old 04-04-2006 , 14:05  
Reply With Quote #9

nop, won't work.
Rohit is offline
ObscureAlucard
Junior Member
Join Date: Mar 2006
Location: Washington
Old 04-04-2006 , 15:37  
Reply With Quote #10

you want the concmd cv_speed to turn off the cvar amx_m4a1 0? or 1? like switch between the 2?
__________________
ObscureAlucard is offline
Send a message via AIM to ObscureAlucard
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 16:41.


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