'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
}
}
}
}