Respawn Plugini İstek
Gönderilme zamanı: Pzr Ara 10, 2017 5:35 pm
Servere Girdiğinde Otomatik Respawnlanmasını istiyorum bu pluginin içine eklermisiniz
Kod: Tümünü seç
#include < amxmodx >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta_util >
#include < biohazard >
#include < xs >
#include < fakemeta >
new cvar_respawn, cvar_enf_sec, cvar_godmode, cvar_godmode_timer, g_msgid_bartime
#if defined _colorchat_included
#endinput
#endif
#define _colorchat_included
enum Color
{
NORMAL = 1, // clients scr_concolor cvar color
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}
new TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
if( !get_playersnum() ) return;
new message[256];
switch(type)
{
case NORMAL: // clients scr_concolor cvar color
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}
vformat(message[1], 251, msg, 4);
// Make sure message is not longer than 192 character. Will crash the server.
message[192] = '^0';
new team, ColorChange, index, MSG_Type;
if(id)
{
MSG_Type = MSG_ONE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}
team = get_user_team(index);
ColorChange = ColorSelection(index, MSG_Type, type);
ShowColorMessage(index, MSG_Type, message);
if(ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
}
ShowColorMessage(id, type, message[])
{
static bool:saytext_used;
static get_user_msgid_saytext;
if(!saytext_used)
{
get_user_msgid_saytext = get_user_msgid("SayText");
saytext_used = true;
}
message_begin(type, get_user_msgid_saytext, _, id);
write_byte(id)
write_string(message);
message_end();
}
Team_Info(id, type, team[])
{
static bool:teaminfo_used;
static get_user_msgid_teaminfo;
if(!teaminfo_used)
{
get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
teaminfo_used = true;
}
message_begin(type, get_user_msgid_teaminfo, _, id);
write_byte(id);
write_string(team);
message_end();
return 1;
}
ColorSelection(index, type, Color:Type)
{
switch(Type)
{
case RED:
{
return Team_Info(index, type, TeamName[1]);
}
case BLUE:
{
return Team_Info(index, type, TeamName[2]);
}
case GREY:
{
return Team_Info(index, type, TeamName[0]);
}
}
return 0;
}
FindPlayer()
{
new i = -1;
while(i <= get_maxplayers())
{
if(is_user_connected(++i))
return i;
}
return -1;
}
public plugin_init()
{
register_plugin("[BIO] Oto Respawn","1.4","ViTaLiTy. , Crunch98")
register_event("DeathMsg","olum","a")
register_event("ShowMenu","menusecim","b","4&Team_Select")
register_event("VGUIMenu","menusecim","b","1=2")
register_forward(FM_ClientKill, "kill_komut")
RegisterHam(Ham_Spawn, "player", "Ham_Sspawn", 1)
RegisterHam(Ham_Killed, "player", "killed_player", 1)
cvar_enf_sec = register_cvar("bh_enfeksiyon_tipi", "2")
cvar_respawn = register_cvar("bh_respawn","1")
cvar_godmode = register_cvar("bh_godmode", "1")
cvar_godmode_timer = register_cvar("bh_godmode_timer", "3.0")
g_msgid_bartime = get_user_msgid("BarTime")
// set_task(500.0,"adv",_,_,_,"b")
return PLUGIN_CONTINUE
}
public killed_player(id)
{
set_task(0.05, "countdown", id)
}
public countdown(id)
{
set_task(0.05, "four", id)
set_task(1.0, "three", id)
set_task(2.0, "two", id)
set_task(3.0, "one", id)
}
public four(id)
{
client_print(id, print_center, "-= [4 Saniye Icinde Yeniden Canlanacaksin] =-")
}
public three(id)
{
client_print(id, print_center, "-= [3 Saniye Icinde Yeniden Canlanacaksin] =-")
}
public two(id)
{
client_print(id, print_center, "-= [2 Saniye Icinde Yeniden Canlanacaksin] =-")
}
public one(id)
{
client_print(id, print_center, "-= [1 Saniye Icinde Yeniden Canlanacaksin] =-")
set_task(0.95, "canlandin", id)
}
public canlandin(id)
{
client_print(id, print_center, "-= [Yeniden Canlandin Adamim. Durmak Yok, Oyuna Devam] =-")
}
public kill_komut()
{
if(get_pcvar_num(cvar_respawn))
return FMRES_SUPERCEDE
return FMRES_IGNORED;
}
public olum()
{
if(get_pcvar_num(cvar_respawn))
{
new id = read_data(2)
new o_id[2]
o_id[0] = id
message_begin( MSG_ONE_UNRELIABLE, g_msgid_bartime, {0,0,0}, id );
write_short(4);
message_end();
set_task(4.0,"respawn",0,o_id,2)
}
return PLUGIN_CONTINUE
}
public menusecim(id)
{
if(get_pcvar_num(cvar_respawn))
{
new o_Id[2]
o_Id[0] = id
set_task(10.0,"respawn",0,o_Id,2)
}
return PLUGIN_CONTINUE
}
public respawn(o_id[])
{
new id = o_id[0]
if(get_user_team(id) == 3 || is_user_alive(id))
return PLUGIN_CONTINUE
ExecuteHamB(Ham_CS_RoundRespawn, id)
return PLUGIN_CONTINUE
}
public Ham_Sspawn(id)
{
if(game_started())
{
if(is_user_connected(id))
set_task(0.5, "enfeksiyon_tipi", id)
}
}
public enfeksiyon_tipi(id)
{
if(is_user_connected(id))
{
switch(get_pcvar_num(cvar_enf_sec))
{
case 1: insan(id)
case 2: zombie(id)
case 3:
{
switch(random_num(1,2))
{
case 1: insan(id)
case 2: zombie(id)
}
}
}
if(get_pcvar_num(cvar_godmode))
{
fm_set_user_godmode(id, 1)
set_task(get_pcvar_float(cvar_godmode_timer), "stop_god", id)
ColorChat(id, NORMAL, "^4[ CSAilesi | Biohazard ]^3 Dogdugunuz Ilk^1 3 ^3Saniye Godmode Aktif. Birazdan Bitecek. ")
}
}
}
public stop_god(id)
{
fm_set_user_godmode(id, 0)
ColorChat(id, NORMAL, "[ CSAilesi |Biohazard ]^3 Godmode Bitti.")
}
public zombie(id)
{
if(!is_user_zombie(id))
{
infect_user(id, 0)
cs_set_user_team(id, CS_TEAM_T)
}
}
public insan(id)
{
if(is_user_zombie(id))
{
cure_user(id)
cs_set_user_team(id, CS_TEAM_CT)
}
fm_give_item(id, "weapon_m4a1")
fm_give_item(id, "weapon_deagle")
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_smokegrenade")
fm_give_item(id, "weapon_flashbang")
cs_set_user_bpammo(id, CSW_M4A1, 200)
cs_set_user_bpammo(id, CSW_DEAGLE, 200)
cs_set_user_bpammo(id, CSW_HEGRENADE, 1)
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1)
cs_set_user_bpammo(id, CSW_FLASHBANG, 1)
}
//public adv() client_print(0, print_chat, "[CSAilesi | Biohazard Server] TS3 Baglanmak Icin /ts3 Yazin. TS Gelenlere Slotluk Ucretsizdir. ")
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/