Problem hud text.

Сообщения
39
Реакции
2
Why text "Удачной игры!" appears, but the "Incalzire" text does not appear?

Код:

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <dhudmessage>
#include <hamsandwich>
#define HUD_COLOR_RGB 67, 218, 231
#define HUD_MSG_POS -1.0, 0.90
new Timer
new bool:g_knife = true
new pCvarRespawn, pCvarTime, pCvarPistol
new const AMMOTYPE[][] = { "", "357sig", "", "762nato", "", "buckshot", "", "45acp", "556nato", "", "9mm", "57mm", "45acp",
"556nato", "556nato", "556nato", "45acp", "9mm", "338magnum", "9mm", "556natobox", "buckshot",
"556nato", "9mm", "762nato", "", "50ae", "556nato", "762nato", "", "57mm" }
new const MAXBPAMMO[] = { -1, 104, -1, 180, 1, 64, 1, 200, 180, 1, 240, 200, 200, 180, 180, 180, 200, 240,
60, 240, 400, 64, 180, 240, 180, 2, 70, 180, 180, -1, 200 }
public plugin_init()
{
register_plugin( "Pistols WarmUP" , "1.0", "ill" )
register_event("DeathMsg", "on_death", "a")
register_event( "CurWeapon", "EventCurWeapon", "be", "2!29" )
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
register_clcmd("joinclass", "cmd_joinclass")
register_menucmd(register_menuid("Terrorist_Select", 1), 511, "cmd_joinclass")
register_menucmd(register_menuid("CT_Select", 1), 511, "cmd_joinclass")
pCvarTime = register_cvar("auto_rr_time","29.0")
pCvarRespawn = register_cvar("auto_rr_respawn","1")
pCvarPistol = register_cvar("auto_rr_pistol", "2") // 0 - knife | 1 - usp/glock | 2 - menu
register_menu("Pistol Menu", 1023, "pistol_menu")
server_cmd("sv_gravity 800")
Timer = get_pcvar_num(pCvarTime)
set_task(1.0, "start_rr_timer", _, _, _, "a", Timer)
}
public show_menu_pistol(id)
{
new szMenu[512], iLen, keys
keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
iLen = formatex(szMenu, charsmax(szMenu), "\yВыберите пистолет^n^n")
iLen += formatex(szMenu[iLen], iLen - 511, "\y1. \wUsp^n")
iLen += formatex(szMenu[iLen], iLen - 511, "\y2. \wGlock^n")
iLen += formatex(szMenu[iLen], iLen - 511, "\y3. \wDeagle^n")
show_menu(id, keys, szMenu, -1, "Pistol Menu")
return PLUGIN_HANDLED
}
public pistol_menu(id, key)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
strip_user_weapons(id)
give_item(id, "weapon_knife")
switch(key)
{
case 0: give_item(id, "weapon_usp")
case 1: give_item(id, "weapon_glock18")
case 2: give_item(id, "weapon_deagle")
}
give_bpammo(id)
return PLUGIN_HANDLED
}
public fw_PlayerSpawn_Post(id)
{
if(!is_user_alive(id))
return
if(!g_knife)
return
cs_set_user_money(id, 0)
if(get_pcvar_num(pCvarPistol) == 2)
{
show_menu_pistol(id)
}
}
public cmd_joinclass(id)
{
if(!is_user_connected(id))
return
if(g_knife && get_pcvar_num(pCvarRespawn))
{
set_task(1.0, "fnRevivePlayer", id)
}
}
public on_death()
{
new victim
victim = read_data(2)
if(g_knife && get_pcvar_num(pCvarRespawn))
set_task(1.0, "fnRevivePlayer", victim)
}
public fnRevivePlayer(id)
{
if(!is_user_alive(id) && (get_user_team(id) == 1 || get_user_team(id) == 2))
ExecuteHamB(Ham_CS_RoundRespawn, id)
}
public EventCurWeapon(id)
{
new szWeap[16]
get_pcvar_string(pCvarPistol, szWeap, charsmax(szWeap))
if(g_knife && !get_pcvar_num(pCvarPistol))
{
engclient_cmd(id, "weapon_knife")
}
}
public start_rr_timer()
{
Timer--

set_hudmessage(HUD_COLOR_RGB, HUD_MSG_POS, .effects = 1, .holdtime = 5.0)
show_dhudmessage(0, "Incalzire: #d.", Timer)
if(Timer < 1)
{
for(new id = 1; id <= get_maxplayers(); id++)
show_menu(id, 0, "^n", 1)
server_cmd("sv_restartround 1")
server_cmd("sv_gravity 800")
set_task(3.0, "rr_end")
g_knife = false
}
}
public rr_end()
{
set_hudmessage(HUD_COLOR_RGB, HUD_MSG_POS, .effects = 1, .holdtime = 5.0)
show_hudmessage(0, "Удачной игры!")
}
give_bpammo(id)
{
new weapons[32], num, i, weaponid
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons
if (MAXBPAMMO[weaponid] > 2)
{
ExecuteHamB(Ham_GiveAmmo, id, MAXBPAMMO[weaponid], AMMOTYPE[weaponid], MAXBPAMMO[weaponid])
}
}
}
 
Последнее редактирование модератором:

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу