Доброе время суток.
1)
Кто может объяснить как сделать все сообщение вот такими:
Пример:
Код
[INFO] This server is running zSpawn to use it say !zspawn.
Я там что то добавил:
Код
^x04[INFO] This server is running zSpawn to use it say !zspawn.
но это не пашет зеленым.
Я так понял тут надо отдельный код под цвета?
2)
Как сделать сообщения тоже типа когда чел покупает zSpawn то пишет за кого.
Пример:
1. За людей 15 ammo pack
2. За зомби 10 ammo pack
Код
И в чат: [INFO] Spawn protect 10 seconds.
Код который нужно переделать:Код
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#define PLUGIN "[ZP] Extra Item : zSpawn"
#define VERSION "1.4.1"
#define AUTHOR "Fry!"
new g_item_name[] = "zSpawn"
new g_itemid_zspawn, g_zspawn_cost, g_zspawn_time, g_delayed_zspawn_time, g_zspawn_protection_time
new bool:g_canzSpawn[33], bool:g_justConnected[33]
new Float:g_gameTime
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("zp_extra_zSpawn",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
g_zspawn_cost = register_cvar("zp_zspawn_cost", "10")
g_zspawn_time = register_cvar("zp_zspawn_time", "2.0")
g_zspawn_protection_time = register_cvar("zp_zspawn_protection_time", "7.0")
g_delayed_zspawn_time = register_cvar("zp_delay_zspawn_time", "15.0")
register_clcmd("respawn", "buy_respawn")
g_itemid_zspawn = zp_register_extra_item(g_item_name, get_pcvar_num(g_zspawn_cost), 0)
register_event("DeathMsg", "Death", "a")
register_logevent("RoundStart", 2, "1=Round_Start")
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
}
public client_connect(id)
{
g_canzSpawn[id] = false
g_justConnected[id] = true
remove_protection(id)
client_print(id, print_chat, "^x04[INFO] This server is running zSpawn to use it say !zspawn")
}
public client_disconnect(id)
{
g_canzSpawn[id] = false
remove_protection(id)
}
public RoundStart()
{
g_gameTime = get_gametime()
}
public Death()
{
new player = read_data( 2 )
if (g_canzSpawn[player])
set_task(get_pcvar_float(g_zspawn_time), "respawn_player", player)
}
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_zspawn)
{
if (is_user_alive(player))
{
g_canzSpawn[player] = false
zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + get_pcvar_num(g_zspawn_cost))
client_print(player, print_chat, "^x04[INFO] Only Dead people can purchase respawn ability")
}
}
}
public buy_respawn(id)
{
new money = zp_get_user_ammo_packs(id)
new cost = get_pcvar_num(g_zspawn_cost)
if (is_user_alive(id))
{
g_canzSpawn[id] = false
client_print(id, print_chat, "^x04[INFO] Only Dead people can purchase respawn ability")
}
else if (g_canzSpawn[id])
{
client_print(id, print_center, "*** You already bought zspawn ***")
}
else if (money < cost)
{
client_print(id, print_chat, "^x04[INFO] You don't have enough ammo packs to buy this ability", cost)
}
else
{
zp_set_user_ammo_packs(id, money - cost)
g_canzSpawn[id] = true
respawn_player(id)
client_print(id, print_chat, "^x04[INFO] You have purchased a respawn ability")
}
return PLUGIN_HANDLED
}
public cmd_delay(id)
{
if (is_user_alive(id))
{
client_print(id, print_chat, "^x04[INFO] Only 'dead' and 'delayed' players can respawn")
return PLUGIN_HANDLED
}
if (g_justConnected[id])
{
set_task(get_pcvar_float(g_delayed_zspawn_time), "HasJoined", id)
g_justConnected[id] = false
client_print(id, print_chat, "^x04[INFO] You will respawn after %d seconds", get_pcvar_num(g_delayed_zspawn_time))
}
return PLUGIN_CONTINUE
}
public HasJoined(id)
{
new Float:gmtm = get_gametime()
if (gmtm - g_gameTime >= get_pcvar_float(g_delayed_zspawn_time) && get_user_team(id) != 3)
{
respawn_player(id)
client_print(id, print_chat, "^x04[INFO] You are now respawn due to delayed.")
}
return PLUGIN_CONTINUE
}
public fw_PlayerSpawn_Post(id)
{
if (!is_user_alive(id) || !is_user_bot(id))
return HAM_IGNORED
if (g_canzSpawn[id] == true)
{
if (get_pcvar_float(g_zspawn_protection_time) > 0.0)
{
set_pev(id, pev_effects, pev(id, pev_effects) | EF_NODRAW)
set_task(get_pcvar_float(g_zspawn_protection_time), "remove_protection", id)
}
}
return HAM_IGNORED
}
public respawn_player(id)
{
ExecuteHamB(Ham_CS_RoundRespawn, id)
g_canzSpawn[id] = false
}
public remove_protection(id)
{
if (!is_user_alive(id) || !is_user_bot(id))
return PLUGIN_HANDLED
g_canzSpawn[id] = false
set_pev(id, pev_effects, pev(id, pev_effects) &~ EF_NODRAW)
return PLUGIN_CONTINUE
}
Заранее спасибо!