Plagin : Rembo
Help that with this code not so? It does not want to be completed
Wanted to make that it was possible to include a mode of a current through 5 rounds , Help to correct a plug-in
Here an error screenshot
http://fotohosting.org/thumb.php?id=E790_4E820CC6
Code
Code:
#pragma tabsize 0
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>
#include <fun>
#include <dhudmessage>
#define PLUGIN "Rembo"
#define VERSION "1.0"
#define AUTHOR "ArhangeL"
#define Max_ROUNDS "5"
new bool:Rembo
new g_buttons
new Players[32]
new Count, i, t
new INT_Rounds = 0
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "eventRoundStart", "a", "1=0", "2=0")
register_clcmd("/rembo", "cmdRembo")
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
RegisterHam(Ham_Use, "func_button", "key")
}
new const bg_free[] = "jbcos/bg_free.wav";
public plugin_precache()
{
engfunc(EngFunc_PrecacheSound, bg_free);
}
public EventRoundStart(id)
{
INT_Rounds = INT_Rounds+1;
g_buttons = false
Rembo = false
server_cmd("dr_free 1")
server_cmd("dr_invis 1")
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")
replace_all(msg, 190, "!team2", "^0")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
public cmdRembo(id)
{
if(INT_Rounds % Max_ROUNDS == 0)
{
new players[32], plNum
get_players(players, plNum, "ace", "Тест")
server_cmd("dr_free 0")
server_cmd("dr_invis 0")
server_cmd("deathrun_mode REMBO")
g_buttons = true
Rembo = true
client_cmd(0, "spk sound/jbcos/bg_free.wav")
if(cs_get_user_team(id)!=CS_TEAM_T)
{
ChatColor(id, "%L",0,"только террорист может использовать это", id)
return
}
new i
get_players(players, plNum, "ah")
for (i = 0; i < plNum; i++) {
fm_strip_user_weapons(players[i])
give_item(players[i], "weapon_knife")
give_item(players[i], "weapon_shield")
give_item(players[i], "weapon_glock18")
cs_set_user_bpammo(players[i], CSW_GLOCK18, 220)
set_user_health( id, get_user_health( id ) + 200)
}
if(cs_get_user_team(id)!=CS_TEAM_CT)
{
fm_strip_user_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_m249")
cs_set_user_bpammo(id, CSW_M249, 250)
set_user_gravity(id, 0.9)
set_user_maxspeed(id, 500.0)
}
set_dhudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), 0.01, 0.50, 0, 6.0, 8.0, 1.0, 1.5);
show_dhudmessage(0, "Террорист - Рэмбо")
}
else
{
client_print(id,print_center,"Можно использовать раз в 5 раундов!")
}
public player_spawn(id)
{
if(!Rembo)
{
return PLUGIN_CONTINUE
}
if(get_user_team(id) == 2)
{
set_task(1.0, "weapons", id + 4431) //если все равно будет выдаваться, увеличивай 1.0
}
return PLUGIN_CONTINUE
}
public weapons(tid)
{
new id = tid - 4431
if(is_user_alive(id))
{
fm_strip_user_weapons(id)
give_item(id, "weapon_knife")
give_item(id, "weapon_shield")
give_item(id, "weapon_glock18")
cs_set_user_bpammo(id, CSW_GLOCK18, 7)
set_user_gravity(id, 0.9)
set_user_maxspeed(id, 500.0)
}
return PLUGIN_CONTINUE
}
public key(ent, idcaller, idactivator, use_type, Float:value)
{
if (is_user_alive(idactivator) && g_buttons && get_user_team(idactivator) == 1) {
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
|