You need to hold the state of speed in a variable and regive the speed eighter (and this is recommended) with hamsandwich or (don't use this) with the CurWeapon-Event.
Have a look:
PHP Code:
new hasSpeed[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_CS_Player_ResetMaxSpeed, "player", "hamResetSpeedPost", true)
}
public hamResetSpeedPost(id)
{
if(hasSpeed[id])
{
set_user_maxspeed(id, 600.0)
}
}
public cmdVip(id)
{
if(get_user_flags(id) & VIP_LEVEL)
{
hasSpeed[id] = 1
set_user_maxspeed(id, 600.0);
client_print(id, print_chat, "You just activated your VIP attributes.");
client_print(id, print_chat, "Just write /vipoff to switch them off.");
}
else
{
client_print(id, print_chat, "You're no VIP!");
}
}
public cmdVipoff(id)
{
if(get_user_flags(id) & VIP_LEVEL)
{
hasSpeed[id] = 0
set_user_maxspeed(id, 250.0);
client_print(id, print_chat, "You just deactivated your VIP attributes.");
client_print(id, print_chat, "Just write /vip to switch them back on.");
}
}
For the skins thing:
You need to hook the spawn event (using hamsandwich) and then set the model. Also you don't need to precache your files twice.
Btw:
- Using a switch statement is bether than multiple if statements (line 65-72)
- You forgot the if-braces (line 47)
- pev_maxspeed vs set_user_maxspeed: This is pretty much a question of preference and modules. If you already include Fakemeta you could aswell use the pev-things and skip the Fun-module.