Kod php:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "JailBreak: Basic Info"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
#define USERTASK 921
#define UPDATEDELAY 1.0
new static reasons[][] = {
"gwalt",
"narkotyki",
"zabojstwo",
"alkohol",
"molestowanie",
"pobicie babci",
"napad na monopolowy",
"dziesione"
}
new static dayname[][] = {
"",
"poniedzialek",
"wtorek",
"sroda",
"czwartek",
"piatek",
"sobota",
"niedziela"
}
new userreason[33]
new rounds, hudhandler
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TextMsg","restart_roundsnum","a","2&#Game_C","2&#Game_w")
register_logevent("round_end", 2, "1=Round_End")
RegisterHam(Ham_Spawn, "player", "client_spawn", 1)
hudhandler = CreateHudSyncObj()
}
public round_end()
{
rounds ++
if(rounds > 7)
rounds = 1
}
public restart_roundsnum()
{
rounds = 0
}
public client_disconnect(id)
{
userreason[id] = -1
if(task_exists(id + USERTASK))
{
remove_task(id + USERTASK)
}
}
public client_spawn(id)
{
if(!is_user_alive(id))
return
if(task_exists(id + USERTASK))
{
remove_task(id + USERTASK)
}
if(cs_get_user_team(id) == CS_TEAM_T)
{
userreason[id] = random_num(0, sizeof reasons - 1)
}
set_task(UPDATEDELAY, "client_jailinfo", id + USERTASK, _, _, "b")
}
public client_jailinfo(TASKID)
{
if(!rounds)
return
static id
id = TASKID - USERTASK
set_hudmessage(0, 255, 0, 0.8, 0.1, 0, 6.0, 12.0)
(cs_get_user_team(id) == CS_TEAM_T) ? ShowSyncHudMsg(id, hudhandler, "Dzis jest %s | Siedzisz za %s.", dayname[rounds], reasons[userreason[id]]) : ShowSyncHudMsg(id, hudhandler, "Dzis jest %s", dayname[rounds])
}
Kod podany wyżej.