Veteran Member
Join Date: Feb 2016
Location: brazil
|
04-15-2024
, 08:04
Re: Simple WarmUp
|
#8
|
for some reason the plugin is not working, the plugin is running, i can see the HUD msg but its just a normal round, everyone can use any weapons and its not restarting, i set up 30 seconds round until restart but it doesnt work
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#define PLUGIN "Simple Knife Warump"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 300.0
new hudtimer, cvar, hudhandler, mp_freezetime, value
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_message(get_user_msgid("TextMsg") ,"message_TextMsg")
register_event("CurWeapon","switchweapon","be","1=1","2!29")
register_dictionary("simple_warmup.txt")
cvar = register_cvar("warmup_timer", "30")
hudhandler = CreateHudSyncObj()
RegisterHam(Ham_Spawn, "player", "fw_spawn", 1)
}
public plugin_cfg()
{
mp_freezetime = get_cvar_pointer("mp_freezetime")
set_task(10.0, "read_vars")
}
public fw_spawn(id) {
if(task_exists(TASKID)) {
set_user_health(0, PLAYER_HEALTH)
set_user_maxspeed(0, MAX_SPEED)
}
}
public read_vars()
{
value = get_pcvar_num(mp_freezetime)
}
public message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{
static message[64]
get_msg_arg_string(2, message, charsmax(message))
if(equal(message, "#Game_Commencing"))
{
hudtimer = get_pcvar_num(cvar)
if(hudtimer == -1)
return
formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_START")
set_msg_arg_string(2, message)
set_user_health(0, PLAYER_HEALTH)
set_user_maxspeed(0, MAX_SPEED)
set_task(1.0, "restart", TASKID, _, _, "b")
set_pcvar_num(mp_freezetime, 0)
}
if(equal(message, "#Game_will_restart_in"))
{
formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_END")
set_msg_arg_string(2, message)
}
}
public restart()
{
if(hudtimer <= 0)
{
remove_task(TASKID)
set_cvar_num("sv_restartround", 1)
set_pcvar_num(mp_freezetime, value)
}
else
{
set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2)
ShowSyncHudMsg(0, hudhandler, "%L", LANG_PLAYER, "COUNTING", hudtimer)
}
hudtimer--
}
public switchweapon(id)
{
if(task_exists(TASKID))
{
engclient_cmd(id, "weapon_knife")
}
}
|
|