PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <colorchat>
#include <fun>
#include <hamsandwich>
#define VERSION "1.0.0"
new pPlugin
new pPrefix
new szPrefix[32]
new iNoscope[33]
new iNormal[33]
new iHighGravity[33]
public plugin_init() {
register_plugin("ScoutzKnivez Fun Rounds", VERSION, "NapoleoN#")
register_forward(FM_CmdStart, "CmdStart")
RegisterHam(Ham_Spawn, "player", "FwPlayerSpawn")
pPlugin = register_cvar("sk_enable", "1")
pPrefix = register_cvar("sk_prefix", "SK")
get_pcvar_string(pPrefix, szPrefix, charsmax(szPrefix))
}
public FwPlayerSpawn(id) {
iNoscope[id] = 0
iNormal[id] = 0
iHighGravity[id] = 0
set_user_gravity(id)
if(is_user_alive(id) && get_pcvar_num(pPlugin)) {
switch(random_num(1, 3)) {
case 1: Cmd_NoScope(id)
case 2: Cmd_Normal(id)
case 3: Cmd_HigherGravity(id)
}
}
}
public Cmd_NoScope(id) {
if(is_user_alive(id)) {
set_task(0.1, "CmdStart", id)
iNoscope[id] = 1
ColorChat(id, GREEN, "[%s]^1 The current round is:^4 No Scope only!", szPrefix)
}
}
public CmdStart(id, Handle) {
if(iNoscope[id] == 1 && is_user_alive(id)) {
static button
button = get_uc(Handle, UC_Buttons)
if (button & IN_ATTACK2) {
button &= ~IN_ATTACK2
}
set_uc(Handle, UC_Buttons, button)
}
}
public Cmd_Normal(id) {
if(is_user_alive(id)) {
ColorChat(id, GREEN, "[%s]^1 The current round is:^4 Normal round!", szPrefix)
iNormal[id] = 1
}
}
public Cmd_HigherGravity(id) {
if(is_user_alive(id)) {
iHighGravity[id] = 1
set_user_gravity(id, 0.2)
ColorChat(id, GREEN, "[%s]^1 The current round is:^4 Higher Gravity!", szPrefix)
}
}
I've made a simple code, but on Cmd_HigherGravity, the gravity doesn't set the asked value, also on the ham_spawn event, i want to set the IN_ATTACK2 back to normal and stop blocking it, how to do that?
__________________