tu mam kod, tylko że jak ct wpisze /free to zabiera broń.
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta_util>
#include <fun>
#define PLUGIN "FreeRun"
#define VERSION "0.1.0"
#define AUTHOR "PomanoB" // with add ~Free*.*KILL~ <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/haha.gif' class='bbc_emoticon' alt='xD' />
new g_free
new g_cvar_t_only
new bool:timer[33] = false
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_cvar_t_only = register_cvar("dh_free_run_t_only", "7")
register_clcmd("say free", "cmdFree")
register_clcmd("say /free", "cmdFree")
register_clcmd("say /invis", "cmdInvis")
register_event("HLTV", "eventRoundStart", "a", "1=0", "2=0")
RegisterHam(Ham_Touch, "armoury_entity", "fwdTouch")
RegisterHam(Ham_Touch, "weaponbox", "fwdTouch")
RegisterHam(Ham_Use, "func_button", "fwdUse")
}
public eventRoundStart(id) {
g_free = false
new i
new maxplayers = get_maxplayers()
for(i=1;i<= maxplayers;i++) {
if(is_user_connected(i)) {
set_task(25.0, "functask", i)
timer[i] = false
}
}
}
public cmdFree(id) {
if(timer[id] == false) {
if (get_pcvar_num(g_cvar_t_only) && get_user_team(id) != 1) {
client_print(id, print_center, "")
return
}
new players[32], plNum
get_players(players, plNum, "ace", "TERRORIST")
g_free = true
set_hudmessage(0, 255, 0, 0.02, -1.0, 0, 6.0, 12.0, 0.1, 0.2, 4)
show_hudmessage(0, "Free and knife 1 on 1!")
new i
get_players(players, plNum, "ah")
for (i = 0; i < plNum; i++) {
fm_strip_user_weapons(players[i])
fm_give_item(players[i], "weapon_knife")
}
}
else {
client_print(id,print_chat, "?????? ???? ???????‚ ?????? ? ?????? 25 ?????? ????? ??????? FREE")
client_print(0,print_chat, "???? ? ??? ?? ??????? ????????, ?????? ??? ????????????.")
}
}
public cmdInvis(id) {
if(timer[id] == false) {
if (get_pcvar_num(g_cvar_t_only) && get_user_team(id) != 1) {
client_print(id, print_center, "")
return
}
new players[32], plNum
get_players(players, plNum, "ace", "TERRORIST")
g_free = true
set_hudmessage(0, 255, 0, 0.02, -1.0, 0, 6.0, 12.0, 0.1, 0.2, 4)
show_hudmessage(0, "Free and knife 1 on 1!")
set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0 )
set_user_health( id, get_user_health( id ) + 150 )
new i
get_players(players, plNum, "ah")
for (i = 0; i < plNum; i++) {
fm_give_item( id, "ammo_45acp" )
}
}
else {
client_print(id,print_chat, "?????? ???? ???????‚ ?????? ? ?????? 25 ?????? ????? ??????? FREE")
client_print(0,print_chat, "???? ? ??? ?? ??????? ????????, ?????? ??? ????????????.")
}
}
public fwdTouch(ent, id) {
if (is_user_alive(id) && g_free)
return HAM_SUPERCEDE
return HAM_IGNORED
}
public fwdUse(ent, idcaller, idactivator, use_type, Float:value) {
if (is_user_alive(idactivator) && g_free && get_user_team(idactivator) == 1) {
client_print(idactivator, print_center, "?? ??????? FreeRun!")
return HAM_SUPERCEDE
}
return HAM_IGNORED
}
public functask(id) {
timer[id] = true
}
Użytkownik szwingel edytował ten post 31.01.2011 14:04


Dodatki SourceMod



Temat jest zamknięty







