Reklam gösterimini engelleyici yazılım kullandığınızı görüyoruz.
Sitemizin ayakta kalıp sizlere hizmet edebilmek için en büyük gelir kaynağı sayfamızda gösterilen reklamlardır.
Reklam gösterimde bizim sayfamıza ayrıcalık tanıyarak ayakta kalmamıza destek olmak ister misiniz ?

Silinmiş Konu   | Fakematadan Reapi :D

9
1044

Konu

#1
Arkadaşlar forumda paylaşılan zombi giant modunun csdde çalışması için reapi ile kodlanmış olması gerekiyor yapacak varsa şimdiden teşekkürler


.sma Zombie_giant.sma (Dosya Boyutu: 51.94 KB | İndirme Sayısı: 2)
#3
Son Düzenleme: 11-10-2017, Saat: 22:12, Düzenleyen: ITenGriTR.
@Arge Arge Simdi Bu Plugin Zaten Cs İçin Yazilmiş Bir Plugin

He Bu Are reapi Diye Bir Kodlama Dili Gormedim(Varsada Bilmioyrum) Hani Tam Yapamam Cok Az Biliyorum Ama Calişir Ya Çalişmasa Paylasmazlar

Hem ADam Calişmiycak Plugini Neden Kodlasin Gülücük

Bence Sorun Sende Yaptigin Birşey VS

Hatami Veriyor Ne Oluyor Onu Soylersen Yardim Edebilirim
Mesela Plugini yuklerken Felan

Ve Plugini 1.8.2 De Test Ettim DHudmessage Hatasi Verdi Hudmessageye Çeviridim ve Suan Plugin bende Sorunsuz Gozukuyor
PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <xs>

#define PLUGIN "Zombie Giant (Limited Edition)"
#define VERSION "1.0"
#define AUTHOR "Dias Pendragon"

#define MAX_PLAYERS 32

#define LANG_FILE "zombie_giant.txt"
#define LANG_DEFAULT LANG_SERVER
#define GAMENAME "Zombie Giant"

// Task
#define TASK_COUNTDOWN 15110
#define TASK_ROUNDTIME 15111

// MACROS
#define Get_BitVar(%1,%2) (%1 & (1 << (%2 & 31)))
#define Set_BitVar(%1,%2) %1 |= (1 << (%2 & 31))
#define UnSet_BitVar(%1,%2) %1 &= ~(1 << (%2 & 31))

// HUD
#define HUD_WIN_X -1.0
#define HUD_WIN_Y 0.20
#define HUD_NOTICE_X -1.0
#define HUD_NOTICE_Y 0.25
#define HUD_NOTICE2_X -1.0
#define HUD_NOTICE2_Y 0.70

// Environment
#define ENV_RAIN 0
#define ENV_SNOW 0
#define ENV_FOG 1
#define ENV_FOG_DENSITY "0.0005"
#define ENV_FOG_COLOR "255 212 85"


#if defined _gamemaster_included
    #endinput
#endif
#define _gamemaster_included

#if AMXX_VERSION_NUM >= 175
 #pragma reqlib gamemaster
 #if !defined AMXMODX_NOAUTOLOAD
  #pragma loadlib gamemaster
 #endif
#else
 #pragma library gamemaster
#endif

#if defined _gamemaster_included
#endif
#define _gamemaster_included

#if AMXX_VERSION_NUM >= 175
 #pragma reqlib gamemaster
 #if !defined AMXMODX_NOAUTOLOAD
  #pragma loadlib gamemaster
 #endif
#else
 #pragma library gamemaster
#endif



enum
{
    WINSTATUS_CT 1,
    WINSTATUS_TERRORIST,
    WINSTATUS_DRAW
}

// Round Mangement
native GM_EndRound_Block(bool:Enabled); // true or false only (set only when server starts, except precache)
native GM_TerminateRound(Float:DelayTimeWinningStatus); 

// Changing Model
native GM_Set_PlayerModel(id, const Model[]);
native GM_Reset_PlayerModel(id);
    
// Changing Team
native GM_Set_PlayerTeam(idCsTeams:Team);
    
// Changing Speed
native GM_Set_PlayerSpeed(idFloat:SpeedBlockSpeed);
native GM_Reset_PlayerSpeed(id);

// Running Time
forward GM_Time();


enum
{
    WINSTATUS_CT 1,
    WINSTATUS_TERRORIST,
    WINSTATUS_DRAW
}


// Running Time
forward GM_Time();


new const 
Env_Sky[1][] =
{
    "Des"
}

// Model Config
new const Model_Player[8][] =
{
    "gign",
    "gsg9",
    "urban",
    "sas",
    "arctic",
    "leet",
    "guerilla",
    "terror"
}

// Sound Config
new const Sound_RoundStart[1][] =
{
    "zombie_giant/zombie_select.wav"
}

new const 
Sound_GameStart[1][] =
{
    "zombie_giant/zombie_spawn.wav"
}

new const 
Sound_Ambience[3][] =
{
    "zombie_giant/ambience/Continuing_Suspense.mp3",
    "zombie_giant/ambience/L.O.T.B_The-Fiend.mp3",
    "zombie_giant/ambience/Luminous_Sword.mp3"
}

new const 
Sound_Result[1][] =
{
    "zombie_giant/zombie_result.wav"
}

new const 
Vox_Count[] = "zombie_giant/count/%i.wav"

new const Vox_WinHuman[] = "zombie_giant/win_human.wav"
new const Vox_WinBoss[] = "zombie_giant/win_zombie.wav"

// Next
const PDATA_SAFE 2

enum
{
    TEAM_NONE 0,
    TEAM_ZOMBIE,
    TEAM_HUMAN,
    TEAM_SPECTATOR
}

// Block Round Event
new g_BlockedObj_Forward
new g_BlockedObj[15][32] =
{
        "func_bomb_target",
        "info_bomb_target",
        "info_vip_start",
        "func_vip_safetyzone",
        "func_escapezone",
        "hostage_entity",
        "monster_scientist",
        "func_hostage_rescue",
        "info_hostage_rescue",
        "env_fog",
        "env_rain",
        "env_snow",
        "item_longjump",
        "func_vehicle",
        "func_buyzone"
}

#define CAMERA_CLASSNAME "nikon_d810"
#define CAMERA_MODEL "models/winebottle.mdl"

// Cvars
new g_Cvar_MinPlayerg_Cvar_MapLightg_Cvar_CountTime
new g_Cvar_HumanHealthg_Cvar_HumanArmorg_Cvar_HumanGravity
new g_CvarPointer_RoundTime

// Main Cvars
new g_GameStartedg_RoundStartedg_GameEndedg_MaxPlayersg_Countdowng_CountTime
new g_IsZombieg_JoinedFloat:g_PassedTimeFloat:g_PassedTime2g_MaxHealth[33], g_ViewCamera, 
g_MyCamera
[33], Float:g_CameraOrigin[33][3], g_MyClass[33], g_Has_NightVisiong_UsingNVG
new g_MsgSayTextg_SyncHud_HP[2], g_SyncHud_MPg_MsgScreenFadeg_TotalClassg_MyMana[33]
new 
Float:g_PlayerSpawn_Point[64][3], g_PlayerSpawn_Count
new Float:g_BossSpawn_Point[64][3], g_BossSpawn_Countg_BossSpawnCode

new Array:GiantBaseHP
new const SoundNVG[2][] = { "items/nvg_off.wav""items/nvg_on.wav"}

// Forwards
#define MAX_FORWARD 8

enum
{
    FWD_ROUND_NEW 0,
    FWD_ROUND_START,
    FWD_GAME_START,
    FWD_GAME_END,
    FWD_BECOME_GIANT,
    FWD_USER_KILL,
    FWD_RUNTIME,
    FWD_EQUIP
}

new 
g_Forwards[MAX_FORWARD], g_fwResult

// Safety
new g_HamBot
new g_IsConnectedg_IsAliveg_PlayerWeapon[33]

// =============== Changing Model ===============
#define MODELCHANGE_DELAY 0.1     // Delay between model changes (increase if getting SVC_BAD kicks)
#define ROUNDSTART_DELAY 2.0     // Delay after roundstart (increase if getting kicks at round start)
#define SET_MODELINDEX_OFFSET     // Enable custom hitboxes (experimental, might lag your server badly with some models)

#define MODELNAME_MAXLENGTH 32
#define TASK_CHANGEMODEL 1962

new const DEFAULT_MODELINDEX_T[] = "models/player/terror/terror.mdl"
new const DEFAULT_MODELINDEX_CT[] = "models/player/urban/urban.mdl"

new g_HasCustomModel
new g_HasCustomSpeed
new Float:g_ModelChangeTargetTime
new g_CustomPlayerModel[MAX_PLAYERS+1][MODELNAME_MAXLENGTH]
#if defined SET_MODELINDEX_OFFSET
new g_CustomModelIndex[MAX_PLAYERS+1]
#endif

#define OFFSET_CSTEAMS 114
#define OFFSET_MODELINDEX 491 // Orangutanz
// ==============================================

// =============== Changing Team ================
#define TEAMCHANGE_DELAY 0.1

#define TASK_TEAMMSG 200
#define ID_TEAMMSG (taskid - TASK_TEAMMSG)

// CS Player PData Offsets (win32)
#define PDATA_SAFE 2
#define OFFSET_CSTEAMS 114

new const CS_TEAM_NAMES[][] = { "UNASSIGNED""TERRORIST""CT""SPECTATOR" }

new 
Float:g_TeamMsgTargetTime
new g_MsgTeamInfog_MsgScoreInfo
// ==============================================

// =============== Changing Speed ===============
#define Ham_CS_Player_ResetMaxSpeed Ham_Item_PreFrame 
#define SV_MAXSPEED 999.0


public plugin_init()
{
    register_plugin(PLUGINVERSIONAUTHOR)
    
    register_dictionary
(LANG_FILE)
    Register_SafetyFunc()
    
    
// Event
    register_event("HLTV""Event_NewRound""a""1=0""2=0")
    register_event("TextMsg""Event_GameRestart""a""2=#Game_will_restart_in")
    register_event("DeathMsg""Event_Death""a")
    register_logevent("Event_RoundStart"2"1=Round_Start")
    register_logevent("Event_RoundEnd"2"1=Round_End")    
    
    
// Fakemeta
    unregister_forward(FM_Spawng_BlockedObj_Forward)
    register_forward(FM_StartFrame"fw_StartFrame")
    register_forward(FM_GetGameDescription"fw_GetGameDesc")
    register_forward(FM_SetClientKeyValue"fw_SetClientKeyValue")
    register_forward(FM_AddToFullPack"fw_AddToFullPack_Post"1)
    
    
// Ham
    RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    RegisterHam(Ham_Killed"player""fw_PlayerKilled_Post"1)
    RegisterHam(Ham_TakeDamage"player""fw_PlayerTakeDamage")
    RegisterHam(Ham_Use"func_tank""fw_UseStationary")
    RegisterHam(Ham_Use"func_tankmortar""fw_UseStationary")
    RegisterHam(Ham_Use"func_tankrocket""fw_UseStationary")
    RegisterHam(Ham_Use"func_tanklaser""fw_UseStationary")
    RegisterHam(Ham_Use"func_tank""fw_UseStationary_Post"1)
    RegisterHam(Ham_Use"func_tankmortar""fw_UseStationary_Post"1)
    RegisterHam(Ham_Use"func_tankrocket""fw_UseStationary_Post"1)
    RegisterHam(Ham_Use"func_tanklaser""fw_UseStationary_Post"1)
    RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon")
    RegisterHam(Ham_Touch"armoury_entity""fw_TouchWeapon")
    RegisterHam(Ham_Touch"weapon_shield""fw_TouchWeapon")
    RegisterHam(Ham_CS_Player_ResetMaxSpeed"player""fw_Ham_ResetMaxSpeed")
    
    
// Message
    register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon")
    register_message(get_user_msgid("Health"), "Message_Health")
    register_message(get_user_msgid("ClCorpse"), "Message_ClCorpse")
    
    
// Team Mananger
    register_clcmd("chooseteam""CMD_JoinTeam")
    register_clcmd("jointeam""CMD_JoinTeam")
    register_clcmd("joinclass""CMD_JoinTeam")
    register_clcmd("nightvision""CMD_NightVision")
    
    
// Collect Spawns Point
    collect_spawns_ent("info_player_start")
    collect_spawns_ent2("info_player_deathmatch")
    
    
// Forward
    g_Forwards[FWD_ROUND_NEW] = CreateMultiForward("zg_round_new"ET_IGNORE)
    g_Forwards[FWD_ROUND_START] = CreateMultiForward("zg_round_start"ET_IGNORE)
    g_Forwards[FWD_GAME_START] = CreateMultiForward("zg_game_start"ET_IGNORE)
    g_Forwards[FWD_GAME_END] = CreateMultiForward("zg_game_end"ET_IGNOREFP_CELL)
    g_Forwards[FWD_BECOME_GIANT] = CreateMultiForward("zg_become_giant"ET_IGNOREFP_CELLFP_CELLFP_FLOATFP_FLOATFP_FLOAT)
    g_Forwards[FWD_USER_KILL] = CreateMultiForward("zg_user_kill"ET_IGNOREFP_CELLFP_CELLFP_CELLFP_CELL)
    g_Forwards[FWD_RUNTIME] = CreateMultiForward("zg_runningtime"ET_IGNORE)
    g_Forwards[FWD_EQUIP] = CreateMultiForward("zg_equipment_menu"ET_IGNOREFP_CELL)

    // Vars
    g_MaxPlayers get_maxplayers()
    
    g_CvarPointer_RoundTime 
get_cvar_pointer("mp_roundtime")
    g_Cvar_MinPlayer register_cvar("zg_minplayer""2")
    g_Cvar_MapLight register_cvar("zb_maplight""d")
    g_Cvar_CountTime register_cvar("zg_counttime""12")
    
    g_Cvar_HumanHealth 
register_cvar("zg_human_health""1000")
    g_Cvar_HumanArmor register_cvar("zg_human_armor""100")
    g_Cvar_HumanGravity register_cvar("zg_human_gravity""1.0")
    
    g_MsgTeamInfo 
get_user_msgid("TeamInfo")
    g_MsgScoreInfo get_user_msgid("ScoreInfo")    
    g_MsgSayText 
get_user_msgid("SayText")
    g_MsgScreenFade get_user_msgid("ScreenFade")
    
    g_SyncHud_HP
[0] = CreateHudSyncObj(1)
    g_SyncHud_HP[1] = CreateHudSyncObj(2)
    g_SyncHud_MP CreateHudSyncObj(3)
    
    
// First Setting
    Round_Setting()
    
    
// Patch Round Infinity
    GM_EndRound_Block(true)
}

public 
plugin_precache()
{
    GiantBaseHP ArrayCreate(11)
    
    
// Register Forward
    g_BlockedObj_Forward register_forward(FM_Spawn"fw_BlockedObj_Spawn")    
    
    
// Precache 
    new iBufferB[128]
    
    precache_model
(CAMERA_MODEL)
    
    
for(0sizeof(Sound_RoundStart); i++)
        precache_sound(Sound_RoundStart[i])
    for(0sizeof(Sound_GameStart); i++)
        precache_sound(Sound_GameStart[i])
    for(0sizeof(Sound_Result); i++)
        precache_sound(Sound_Result[i])
    for(0sizeof(Sound_Ambience); i++)
        precache_sound(Sound_Ambience[i])
        
    
for(1<= 10i++)
    {
        formatex(BufferBcharsmax(BufferB), Vox_Counti); 
        engfunc
(EngFunc_PrecacheSoundBufferB); 
    
}        
        
    precache_sound
(Vox_WinHuman)
    precache_sound(Vox_WinBoss)
    
    
// Handle
    Environment_Setting()
}

public 
plugin_natives()
{
    register_native("zg_is_giant""Native_IsGiant"1)
    register_native("zg_get_giantclass""Native_GetClass"1)
    register_native("zg_get_maxhealth""Native_GetMaxHP"1)
    register_native("zg_get_nightvision""Native_GetNVG"1)
    register_native("zg_set_nightvision""Native_SetNVG"1)
    register_native("zg_get_mana""Native_GetMP"1)
    register_native("zg_set_mana""Native_SetMP"1)
    
    register_native
("zg_register_giantclass""Native_RegisterClass"1)
}

public 
plugin_cfg()
{
    server_cmd("mp_roundtime 5")
    server_cmd("mp_freezetime 3")
    server_cmd("mp_flashlight 1")
    server_cmd("mp_friendlyfire 0")
    server_cmd("mp_limitteams 0")
    server_cmd("mp_autoteambalance 0")
    
    set_cvar_num
("sv_maxspeed"999)
    set_cvar_num("sv_skycolor_r"0)
    set_cvar_num("sv_skycolor_g"0)
    set_cvar_num("sv_skycolor_b"0)    
    
    
// Sky
    set_cvar_string("sv_skyname"Env_Sky[random(sizeof(Env_Sky))])
    
    
// New Round
    Event_NewRound()
}

public 
Native_IsGiant(id)
{
    if(!is_connected(id))
        return 0
        
    
return Get_BitVar(g_IsZombieid) ? 0
}

public 
Native_GetClass(id)
{
    if(!is_connected(id))
    {
        server_print("[ZG] Error: Get Class with unconnected User!")
        return -1
    
}
    
    
return g_MyClass[id]
}

public 
Native_GetMaxHP(id)
{
    if(!is_connected(id))
        return 0
        
    
return g_MaxHealth[id]
}

public 
Native_GetNVG(idHaveOn)
{
    if(Have && !On)
    {
        if(Get_BitVar(g_Has_NightVisionid) && !Get_BitVar(g_UsingNVGid))
            return 1
    
} else if(!Have && On) {
        if(!Get_BitVar(g_Has_NightVisionid) && Get_BitVar(g_UsingNVGid))
            return 1
    
} else if(Have && On) {
        if(Get_BitVar(g_Has_NightVisionid) && Get_BitVar(g_UsingNVGid))
            return 1
    
} else if(!Have && !On) {
        if(!Get_BitVar(g_Has_NightVisionid) && !Get_BitVar(g_UsingNVGid))
            return 1
    
}
    
    
return 0
}

public 
Native_SetNVG(idGiveOnSoundIgnoredHad)
{
    if(!is_connected(id))
        return
        
    
if(GiveSet_BitVar(g_Has_NightVisionid)
    set_user_nightvision(idOnSoundIgnoredHad)
}

public 
Native_GetMP(id)
{
    if(!is_connected(id))
        return 0
        
    
return g_MyMana[id]
}

public 
Native_SetMP(idMP)
{
    if(!is_connected(id))
        return
    
    g_MyMana
[id] = MP
}

public 
Native_RegisterClass(BaseHealth)
{
    ArrayPushCell(GiantBaseHPBaseHealth)
    
    g_TotalClass
++
    return g_TotalClass 1
}

public 
fw_BlockedObj_Spawn(ent)
{
    if (!pev_valid(ent))
        return FMRES_IGNORED
    
    
static Ent_Classname[64]
    pev(entpev_classnameEnt_Classnamesizeof(Ent_Classname))
    
    
for(new 0sizeof g_BlockedObji++)
    {
        if (equal(Ent_Classnameg_BlockedObj[i]))
        {
            engfunc(EngFunc_RemoveEntityent)
            return FMRES_SUPERCEDE
        
}
    }
    
    
return FMRES_IGNORED
}

public 
Round_Setting()
{
    g_GameStarted 0
    g_GameEnded 
0
    g_RoundStarted 
0
}

public 
client_putinserver(id)
{
    Safety_Connected(id)
    Reset_Player(id1)
    
    set_task
(0.1"Set_LightStart"id)
    set_task(0.25"Set_NewTeam"id)
    
    remove_task
(id+TASK_CHANGEMODEL)

    UnSet_BitVar(g_HasCustomModelid)
    UnSet_BitVar(g_HasCustomSpeedid)
    
    
if(!g_HamBot && is_user_bot(id))
    {
        g_HamBot 1
        set_task
(0.1"Register_HamBot"id)
    }
}
 
public Register_HamBot(id)
{
    Register_SafetyFuncBot(id)
    
    RegisterHamFromEntity
(Ham_Spawnid"fw_PlayerSpawn_Post"1)
    RegisterHamFromEntity(Ham_Killedid"fw_PlayerKilled_Post"1)
    RegisterHamFromEntity(Ham_TakeDamageid"fw_PlayerTakeDamage")
}
 
public client_disconnected(id)
{
    Safety_Disconnected(id)
    
    
if(pev_valid(g_MyCamera[id])) set_pev(g_MyCamera[id], pev_flagsFL_KILLME)
    
    remove_task
(id+TASK_CHANGEMODEL)
    remove_task(id+TASK_TEAMMSG)
    
    UnSet_BitVar
(g_HasCustomModelid)
    UnSet_BitVar(g_HasCustomSpeedid)
}

public 
Environment_Setting()
{
    new BufferB[128]
    new Enable
    
    
// Weather & Sky
    Enable ENV_RAIN; if(Enableengfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_rain"))
    Enable ENV_SNOW; if(Enable)engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_snow"))    
    Enable 
ENV_FOG; 
    
if(Enable)
    {
        remove_entity_name("env_fog")
        
        
new ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_fog"))
        if (pev_valid(ent))
        {
            fm_set_kvd(ent"density"ENV_FOG_DENSITY"env_fog")
            fm_set_kvd(ent"rendercolor"ENV_FOG_COLOR"env_fog")
        }
    }
    
    
// Sky
    for(new 0sizeof(Env_Sky); i++)
    {
        // Preache custom sky files
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sbk.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sdn.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sft.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%slf.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%srt.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sup.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)        
    
}        
}

public 
Event_Time()
{
    if(!g_GameStartedclient_print(0print_center"%L"LANG_DEFAULT"NOTICE_WAITFORPLAYER")
    if(g_GameStarted && (Get_TotalInPlayer(2) < get_pcvar_num(g_Cvar_MinPlayer)))
    {
        g_GameStarted 0
        g_GameEnded 
0
        g_RoundStarted 
0
    
}
    if(!g_GameStarted && (Get_TotalInPlayer(2) >= get_pcvar_num(g_Cvar_MinPlayer))) // START GAME NOW :D
    {
        g_GameStarted 1
        g_RoundStarted 
0
        
        End_Round
(5.01CS_TEAM_UNASSIGNED)
    }
    
    
// Show HUD
    Show_ScoreHud()
    Show_PlayerHUD()
    
    
// Check Gameplay
    Check_Gameplay()
    
    
// Exe
    ExecuteForward(g_Forwards[FWD_RUNTIME], g_fwResult)
}

public 
Event_Time2()
{
    Show_StatusHud()
}

public 
Check_Gameplay()
{
    if(!g_GameStarted || g_GameEnded || !g_RoundStarted)
        return
        
    
if(Get_PlayerCount(12) <= 0End_Round(5.00CS_TEAM_T)
    else if(Get_ZombieAlive() <= 0End_Round(5.00CS_TEAM_CT)
}

public 
Set_NewTeam(id)
{
    if(!is_connected(id))
        return
    if(is_alive(id))
        return
        
    Set_PlayerTeam
(idCS_TEAM_CT)
}

public 
Show_ScoreHud()
{
    
}

public 
Show_PlayerHUD()
{
    for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(cs_get_user_team(i) != CS_TEAM_T)
            continue
        
        
    
}
}

public 
Show_StatusHud()
{
    static TempText[61]; 
    
    
for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(cs_get_user_team(i) != CS_TEAM_T)
            continue
            
        
if(g_MyMana[i] < 100)
            g_MyMana[i] = min(g_MyMana[i] + 5100)
            
        
if(!g_MaxHealth[i])
            continue
            
        
        
// HP
        set_hudmessage(255000.2250.1000.00.60.00.0)
        ShowSyncHudMsg(ig_SyncHud_HP[0], "____________________________________________________________")

        formatex(TempText60"____________________________________________________________")
        TempText[(60 get_user_health(i)) / g_MaxHealth[i]] = EOS
        
        set_hudmessage
(25525500.2250.1000.00.60.00.0)
        ShowSyncHudMsg(ig_SyncHud_HP[1], TempText)
        
        
// MP
        formatex(TempText60"____________________________________________________________")
        TempText[(60 g_MyMana[i]) / 100] = EOS
    
        set_hudmessage
(025500.2250.1200.00.60.00.0)
        ShowSyncHudMsg(ig_SyncHud_MPTempText)
    }
}

public 
client_PreThink(id)
{
    if(!is_user_alive(id))
        return
        
    
// Handle Camera
    if(g_MyCamera[id] && Get_BitVar(g_ViewCameraid))
    {
        static Float:Origin[3], Float:CamOrigin[3]
        pev(idpev_originOrigin)
        
        
static Float:vAngle[3], Float:Angles[3]
        pev(idpev_anglesAngles)
        pev(idpev_v_anglevAngle)
        
        
static Float:i
        
for(256.0>= 0.0-= 0.1)
        {
            CamOrigin[0] = floatcos(vAngle], degrees) * -i
            CamOrigin
[1] = floatsin(vAngle], degrees) * -i
            CamOrigin
[2] = - (4)
            CamOrigin[0] += Origin[0]
            CamOrigin[1] += Origin[1]
            CamOrigin[2] += Origin[2]
            
            
if(PointContents(CamOrigin) != CONTENTS_SOLID && PointContents(CamOrigin) != CONTENTS_SKY)
                break;
        }
        
        vAngle
[0] = 20.0
        
        set_pev
(g_MyCamera[id], pev_originCamOrigin)
        set_pev(g_MyCamera[id], pev_anglesvAngle)
        set_pev(g_MyCamera[id], pev_v_anglevAngle)
    }
}
    
public Create_Camera(id)
{
    if(pev_valid(g_MyCamera[id]))
        return
    
    
static Float:vAngle[3], Float:Angles[3]
    
    pev
(idpev_origing_CameraOrigin[id])
    pev(idpev_v_anglevAngle)
    pev(idpev_anglesAngles)

    static EntEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    if(!pev_valid(Ent)) return

    set_pev(Entpev_classnameCAMERA_CLASSNAME)

    set_pev(Entpev_solid0)
    set_pev(Entpev_movetypeMOVETYPE_NOCLIP)
    set_pev(Entpev_ownerid)
    
    engfunc
(EngFunc_SetModelEntCAMERA_MODEL)

    static Float:Mins[3], Float:Maxs[3]
    
    Mins
[0] = -1.0
    Mins
[1] = -1.0
    Mins
[2] = -1.0
    Maxs
[0] = 1.0
    Maxs
[1] = 1.0
    Maxs
[2] = 1.0

    entity_set_size
(EntMinsMaxs)

    set_pev(Entpev_origing_CameraOrigin[id])
    set_pev(Entpev_v_anglevAngle)
    set_pev(Entpev_anglesAngles)

    fm_set_rendering(EntkRenderFxGlowShell000kRenderTransAlpha0)
    g_MyCamera[id] = Ent;
}

public 
View_Camera(idReset)
{
    if(!is_valid_ent(g_MyCamera[id]))
        Create_Camera(id)
    
    
if(!Reset) 
    
{
        attach_view(idg_MyCamera[id])
        Set_BitVar(g_ViewCameraid)
    } else {
        attach_view(idid)
        UnSet_BitVar(g_ViewCameraid)
    }
}

public 
Set_PlayerNVG(idGiveOnOnSoundIgnored_HadNVG)
{
    if(GiveSet_BitVar(g_Has_NightVisionid)
    set_user_nightvision(idOnOnSoundIgnored_HadNVG)
}

public 
set_user_nightvision(idOnOnSoundIgnored_HadNVG)
{
    if(!Ignored_HadNVG)
    {
        if(!Get_BitVar(g_Has_NightVisionid))
            return
    }

    if(OnSet_BitVar(g_UsingNVGid)
    else UnSet_BitVar(g_UsingNVGid)
    
    
if(OnSoundPlaySound(idSoundNVG[On])
    set_user_nvision(id)
    
    
return
}

public 
set_user_nvision(id)
{
    
    
static Alpha, Default[2]; get_pcvar_string(g_Cvar_MapLight, Default, 1)
    if(Get_BitVar(g_UsingNVGid)) Alpha 75
    
else Alpha 0
    
    message_begin
(MSG_ONE_UNRELIABLEg_MsgScreenFade_id)
    write_short(0// duration
    write_short(0// hold time
    write_short(0x0004// fade type
    if(!Get_BitVar(g_IsZombieid))
    {
        write_byte(0// r
        write_byte(150// g
        write_byte(0// b
    } else {
        write_byte(85// r
        write_byte(85// g
        write_byte(255// b
    }
    write_byte(Alpha// alpha
    message_end()
    
    
//if(Get_BitVar(g_UsingNVG, id)) SetPlayerLight(id, "#")
    //else SetPlayerLight(id, Default)
}

// ======================== EVENT ========================
// =======================================================
public Event_NewRound()
{
    // Player
    g_ModelChangeTargetTime get_gametime() + ROUNDSTART_DELAY
    
    
for(new 0g_MaxPlayersi++)
    {
        remove_task(i+TASK_TEAMMSG)
        
        
if(task_exists(i+TASK_CHANGEMODEL))
        {
            remove_task(i+TASK_CHANGEMODEL)
            fm_cs_user_model_update(i+TASK_CHANGEMODEL)
        }
        
        UnSet_BitVar
(g_HasCustomSpeedi)
    }
    
    
// System
    remove_task(TASK_ROUNDTIME)
    remove_task(TASK_COUNTDOWN)
    
    g_GameEnded 
0
    g_RoundStarted 
0
    g_Countdown 
0
    
    StopSound
(0)
    
    
// Gameplay Handle
    Check_GameStart()
    ExecuteForward(g_Forwards[FWD_ROUND_NEW], g_fwResult)
}

public 
Event_RoundStart()
{
    if(!g_GameStarted || g_GameEnded)
        return
    
    g_Countdown 
1
    set_task
(get_pcvar_float(g_CvarPointer_RoundTime) * 60.0"Event_TimeUp"TASK_ROUNDTIME)
    
    set_hudmessage
(2551270HUD_NOTICE_XHUD_NOTICE_Y00.15.00.010.5)
    show_hudmessage(0"%L"LANG_DEFAULT"NOTICE_ZOMBIESELECT")
    
    PlaySound
(0Sound_RoundStart[random(sizeof(Sound_RoundStart))])
    ExecuteForward(g_Forwards[FWD_ROUND_START], g_fwResult)
}

public 
Check_GameStart()
{
    if(!g_GameStarted || g_GameEnded)
        return
    
    Start_Countdown
()
}

public 
Event_TimeUp()
{
    if(!g_GameStarted || g_GameEnded)
        return
        
    End_Round
(5.00CS_TEAM_CT)
}

public 
Event_RoundEnd()
{
    g_GameEnded 1
    
    remove_task
(TASK_ROUNDTIME)
    remove_task(TASK_COUNTDOWN)
    
    PlaySound
(0Sound_Result[random(sizeof(Sound_Result))])
}

public 
Event_GameRestart()
{
    Event_RoundEnd()
}

public 
Event_Death()
{
    static AttackerVictimHeadshotWeapon[32], CSW
    
    Attacker 
read_data(1)
    Victim read_data(2)
    Headshot read_data(3)
    read_data(4Weaponsizeof(Weapon))
    
    
if(equal(Weapon"grenade"))
        CSW CSW_HEGRENADE
    
else { 
        
static BukiNoNamae[64];
        formatex(BukiNoNamae63"weapon_%s"Weapon)
        
        CSW 
get_weaponid(BukiNoNamae)
    }
    
    ExecuteForward
(g_Forwards[FWD_USER_KILL], g_fwResultVictimAttackerHeadshotCSW)
}

public 
Start_Countdown()
{
    g_CountTime get_pcvar_num(g_Cvar_CountTime)
    
    remove_task
(TASK_COUNTDOWN)
    CountingDown()
}

public 
CountingDown()
{
    if(!g_GameStarted || g_GameEnded)
        return
    if(g_CountTime  <= 0)
    {
        Start_Game_Now()
        return
    }
    
    client_print
(0print_center"%L"LANG_DEFAULT"NOTICE_COUNTING"g_CountTime)
    
    
if(g_CountTime <= 10)
    {
        static Sound[64]; format(Soundcharsmax(Sound), Vox_Countg_CountTime)
        PlaySound(0Sound)
    } 
    
    
if(g_Countdowng_CountTime--
    set_task(1.0"CountingDown"TASK_COUNTDOWN)
}

public 
Start_Game_Now()
{
    Boss_SpawnInit()
    
    
// Play Sound
    PlaySound(0Sound_GameStart[random(sizeof(Sound_GameStart))])
    
    
static TotalPlayerTotalPlayer Get_TotalInPlayer(1)
    static ZombieNumberZombieNumber clamp(floatround(float(TotalPlayer) / 8.0floatround_ceil), 15)
    
    
static PlayerList[32], PlayerNumPlayerNum 0
    
for(new 0ZombieNumberi++)
    {
        get_players(PlayerListPlayerNum"a")
        Set_PlayerZombie(PlayerList[random(PlayerNum)])
    }
    
    g_RoundStarted 
1
    
    
// Check Team & Show Message: Survival Time
    for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(is_user_zombie(i))
            continue
            
        
// Show Message
        set_hudmessage(0127255HUD_NOTICE_XHUD_NOTICE_Y00.15.00.010.5)
        show_hudmessage(i"%L"LANG_DEFAULT"NOTICE_ZOMBIEAPPEAR")
            
        
// Show Message
        set_hudmessage(8525585HUD_NOTICE2_XHUD_NOTICE2_Y20.13.00.010.5)
        show_hudmessage(i"%L"LANG_DEFAULT"NOTICE_ALIVETIME")

        Make_PlayerShake(i)
        
        
if(cs_get_user_team(i) == CS_TEAM_CT)
            continue
            
        
// Set Team
        Set_PlayerTeam(iCS_TEAM_CT)
    }
    
    
// Ambience
    PlaySound(0Sound_Ambience[random(sizeof(Sound_Ambience))])
    
    
// Exec Forward
    ExecuteForward(g_Forwards[FWD_GAME_START], g_fwResult)
}

public 
Set_PlayerZombie(id)
{
    static CodeTitan; if(CodeTitan >= g_TotalClassCodeTitan 0
    
static Float:StartOrigin[3]; pev(idpev_originStartOrigin)
    
    
// Set Info
    Set_BitVar(g_IsZombieid)    
    Set_PlayerTeam
(idCS_TEAM_T)
    Set_PlayerNVG(id1100)
    
    g_MyMana
[id] = 100
    g_MyClass
[id] = CodeTitan
    
    
// Player Origin
    if(g_BossSpawnCode >= g_BossSpawn_Count)
        g_BossSpawnCode 0
    
    Recheck_HumanPosition
(g_BossSpawn_Point[g_BossSpawnCode])
    StartOrigin g_BossSpawn_Point[g_BossSpawnCode]
    
    g_BossSpawnCode
++
    
    
// Handle Player
    fm_strip_user_weapons(id)
    fm_give_item(id"weapon_knife")
    
    set_pev
(idpev_solidSOLID_NOT)
    set_pev(idpev_movetypeMOVETYPE_NOCLIP)
    fm_set_rendering(idkRenderFxGlowShell000kRenderTransAlpha0)
    
    
// HP
    static HPHP ArrayGetCell(GiantBaseHPCodeTitan)
    static PlayerNumPlayerNum clamp(Get_TotalInPlayer(1), 132)
    
    HP 
*= PlayerNum
    SetPlayerHealth
(idHP1)
    
    
// Camera
    Create_Camera(id)
    View_Camera(id0)
    
    set_task
(0.1"Second_Strip"id)
    ExecuteForward(g_Forwards[FWD_BECOME_GIANT], g_fwResultidCodeTitanStartOrigin[0], StartOrigin[1], StartOrigin[2])
    
    CodeTitan
++
}

public 
Boss_SpawnInit()
{
    g_BossSpawnCode random(g_BossSpawn_Count)
}

public 
Second_Strip(idfm_strip_user_weapons(id)

// ====================== FAKEMETA =======================
// =======================================================
public fw_GetGameDesc()
{
    forward_return(FMV_STRINGGAMENAME)
    return FMRES_SUPERCEDE
}

public 
fw_StartFrame()
{
    static Float:TimeTime get_gametime()
    
    
if(Time 1.0 g_PassedTime)
    {
        Event_Time()
        g_PassedTime Time
    
}
    if(Time 0.5 g_PassedTime2)
    {
        Event_Time2()
        g_PassedTime2 Time
    
}
}

public 
fw_SetClientKeyValue(id, const infobuffer[], const key[], const value[])
{
    if (Get_BitVar(g_HasCustomModelid) && equal(key"model"))
    {
        static currentmodel[MODELNAME_MAXLENGTH]
        fm_cs_get_user_model(idcurrentmodelcharsmax(currentmodel))
        
        
if (!equal(currentmodelg_CustomPlayerModel[id]) && !task_exists(id+TASK_CHANGEMODEL))
            fm_cs_set_user_model(id+TASK_CHANGEMODEL)
        
#if defined SET_MODELINDEX_OFFSET
        fm_cs_set_user_model_index(id)
#endif
        
        
return FMRES_SUPERCEDE;
    }
    
    
return FMRES_IGNORED;
}

public 
fw_AddToFullPack_Post(eseenthosthostflagsplayerpSet)
{
    if(!player)
        return FMRES_IGNORED
    
if(!is_alive(ent) || !is_alive(host))
        return FMRES_IGNORED
    
if(is_user_zombie(ent) || !is_user_zombie(host))
        return FMRES_IGNORED
        
    
static Float:CurHealthFloat:MaxHealth
    
static Float:PercentPercent2RealPercent
    
    pev
(entpev_healthCurHealth)
    MaxHealth float(g_MaxHealth[ent])
    
    Percent 
= (CurHealth MaxHealth) * 100.0
    Percent2 
floatround(Percent)
    RealPercent clamp(Percent21100)
    
    
static Color[3]
    
    
switch(RealPercent)
    {
        case 1..49Color = {7500}
        case 50..79Color = {75750}
        case 80..100Color = {0750}
    }
    
    set_es
(esES_RenderFxkRenderFxGlowShell)
    set_es(esES_RenderModekRenderNormal)
    set_es(esES_RenderColorColor)
    set_es(esES_RenderAmt16)
    
    
return FMRES_HANDLED
}

// ===================== HAMSANDWICH =====================
// =======================================================
public fw_PlayerSpawn_Post(id)
{
    if(!is_user_alive(id)) return
    
    Set_BitVar
(g_Joinedid)
    
    Reset_Player
(id0)
    View_Camera(id1)
    
    
// Set Human
    Do_RandomSpawn(id)
    
    set_task
(0.01"Set_LightStart"id)
    fm_set_user_rendering(id)
    set_user_nightvision(id000)
    
    Set_PlayerTeam
(idCS_TEAM_CT)
    SetPlayerHealth(idget_pcvar_num(g_Cvar_HumanHealth), 1)
    cs_set_user_armor(idget_pcvar_num(g_Cvar_HumanArmor), CS_ARMOR_KEVLAR)
    set_pev(idpev_gravityget_pcvar_float(g_Cvar_HumanGravity))
    
    Reset_PlayerSpeed
(id)
    
    
// Start Weapon
    fm_strip_user_weapons(id)
    fm_give_item(id"weapon_knife")
    fm_give_item(id"weapon_usp")
    give_ammo(id1CSW_USP)
    give_ammo(id1CSW_USP)

    Set_PlayerModel(idModel_Player[random(sizeof(Model_Player))])
    
    
// Show Info
    static String[64]; formatex(Stringsizeof(String), "!g****[%s (%s)] by [%s]****!n"GAMENAMEVERSIONAUTHOR)
    client_printc(idString)
    
    
// Exec
    ExecuteForward(g_Forwards[FWD_EQUIP], g_fwResultid)
}

public 
fw_PlayerKilled_Post(VictimAttacker)
{
    
    
    
// Check Gameplay
    Check_Gameplay()
}

public 
fw_UseStationary(entitycalleractivatoruse_type)
{
    if (use_type == && is_alive(caller) && is_user_zombie(caller))
        return HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
fw_UseStationary_Post(entitycalleractivatoruse_type)
{
    if(use_type == && is_alive(caller) && is_user_zombie(caller))
    {
        /*
        // Reset Claws
        static Claw[64], Claw2[64];
        
        if(Get_BitVar(g_IsZombie, caller)) ArrayGetString(ZombieClawModel, g_ZombieClass[caller], Claw, sizeof(Claw))
        //else if(Get_BitVar(g_IsNightStalker, caller)) Claw = g_HiddenClawModel
        
        formatex(Claw2, sizeof(Claw2), "models/%s/%s", GAME_FOLDER, Claw)
        
        set_pev(caller, pev_viewmodel2, Claw2)
        set_pev(caller, pev_weaponmodel2, "")*/
    }
}

public 
fw_TouchWeapon(weaponid)
{
    if(!is_connected(id))
        return HAM_IGNORED
    
if(is_user_zombie(id))
        return HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
fw_PlayerTakeDamage(VictimInflictorAttackerFloat:DamageDamageBits)
{
    if(!g_GameStarted || g_GameEnded || !g_RoundStarted)
        return HAM_SUPERCEDE
    
if(Victim == Attacker || !is_connected(Attacker))
        return HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
fw_Ham_ResetMaxSpeed(id)
{
    return ( Get_BitVar(g_HasCustomSpeedid) ) ? HAM_SUPERCEDE HAM_IGNORED;
}
  

public Make_PlayerShake(id)
{
    static MSG; if(!MSGMSG get_user_msgid("ScreenShake")
    
    
if(!id) 
    
{
        message_begin(MSG_BROADCASTMSG)
        write_short(8<<12)
        write_short(5<<12)
        write_short(4<<12)
        message_end()
    } else {
        if(!is_user_connected(id))
            return
            
        message_begin
(MSG_BROADCASTMSG_id)
        write_short(8<<12)
        write_short(5<<12)
        write_short(4<<12)
        message_end()
    }
}

// ===================== MESSAGES ========================
// =======================================================
public Message_StatusIcon(msg_idmsg_destmsg_entity)
{
    static szMsg[8];
    get_msg_arg_string(2szMsg ,7)
    
    
if(equal(szMsg"buyzone") && get_msg_arg_int(1))
    {
        if(pev_valid(msg_entity) != PDATA_SAFE)
            return  PLUGIN_CONTINUE;
    
        set_pdata_int
(msg_entity235get_pdata_int(msg_entity235) & ~(1<<0))
        return PLUGIN_HANDLED;
    }
    
    
return PLUGIN_CONTINUE;
}

public 
Message_Health(msg_idmsg_destid)
{
    // Get player's health
    static health
    health 
get_user_health(id)
    
    
// Don't bother
    if(health 1) 
        
return
    
    
static Float:NewHealthRealHealthHealth
    
    NewHealth 
= (float(health) / float(g_MaxHealth[id])) * 100.0; 
    RealHealth 
floatround(NewHealth)
    Health clamp(RealHealth1255)

    set_msg_arg_int(1get_msg_argtype(1), Health)
}

public 
Message_ClCorpse()
{
    static idid get_msg_arg_int(12)
    set_msg_arg_string(1g_CustomPlayerModel[id])

    return PLUGIN_CONTINUE
}

// ====================== COMMAND ========================
// =======================================================
public CMD_JoinTeam(id)
{
    if(!Get_BitVar(g_Joinedid))
        return PLUGIN_CONTINUE
        
    
return PLUGIN_HANDLED
}

public 
CMD_NightVision(id)
{
    if(!Get_BitVar(g_Has_NightVisionid))
        return PLUGIN_HANDLED

    
if(!Get_BitVar(g_UsingNVGid)) set_user_nightvision(id110)
    else set_user_nightvision(id010)
    
    
return PLUGIN_HANDLED;
}

// ======================== OTHER ========================
// =======================================================
public Reset_Player(idNewPlayer)
{
    UnSet_BitVar(g_IsZombieid)
    UnSet_BitVar(g_Has_NightVisionid)
    UnSet_BitVar(g_UsingNVGid)
}

public 
Set_PlayerModel(id, const Model[])
{
    if(!is_connected(id))
        return false
    
    remove_task
(id+TASK_CHANGEMODEL)
    Set_BitVar(g_HasCustomModelid)
    
    copy
(g_CustomPlayerModel[id], charsmax(g_CustomPlayerModel[]), Model)
    
    
#if defined SET_MODELINDEX_OFFSET    
    new modelpath[32+(2*MODELNAME_MAXLENGTH)]
    formatex(modelpathcharsmax(modelpath), "models/player/%s/%s.mdl"ModelModel)
    g_CustomModelIndex[id] = engfunc(EngFunc_ModelIndexmodelpath)
    #endif
    
    
new currentmodel[MODELNAME_MAXLENGTH]
    fm_cs_get_user_model(idcurrentmodelcharsmax(currentmodel))
    
    
if (!equal(currentmodelModel))
        fm_cs_user_model_update(id+TASK_CHANGEMODEL)
    
    
return true;
}

public 
Reset_PlayerModel(id)
{
    if(!is_connected(id))
        return false;
    
    
// Player doesn't have a custom model, no need to reset
    if(!Get_BitVar(g_HasCustomModelid))
        return true;
    
    remove_task
(id+TASK_CHANGEMODEL)
    UnSet_BitVar(g_HasCustomModelid)
    fm_cs_reset_user_model(id)
    
    
return true;    
}

public 
Set_PlayerTeam(idCsTeams:Team)
{
    if(!is_connected(id))
        return
    
    
if(pev_valid(id) != PDATA_SAFE)
        return
    //if(cs_get_user_team(id) == Team)
    //    return

    // Remove previous team message task
    remove_task(id+TASK_TEAMMSG)
    
    
// Set team offset
    set_pdata_int(idOFFSET_CSTEAMS_:Team)
    
    
// Send message to update team?
    fm_user_team_update(id)    
}

public 
Set_PlayerSpeed(idFloat:SpeedBlockChange)
{
    if(!is_alive(id))
        return
        
    
if(BlockChangeSet_BitVar(g_HasCustomSpeedid)
    else UnSet_BitVar(g_HasCustomSpeedid)
        
    set_pev
(idpev_maxspeedSpeed)
}

public 
Reset_PlayerSpeed(id)
{
    if(!is_alive(id))
        return
        
    UnSet_BitVar
(g_HasCustomSpeedid)
    ExecuteHamB(Ham_CS_Player_ResetMaxSpeedid)
}

public 
give_ammo(idsilentCSWID)
{
    static AmountName[32]
        
    
switch(CSWID)
    {
        case CSW_P228: {Amount 13formatex(Namesizeof(Name), "357sig");}
        case CSW_SCOUT: {Amount 30formatex(Namesizeof(Name), "762nato");}
        case CSW_XM1014: {Amount 8formatex(Namesizeof(Name), "buckshot");}
        case CSW_MAC10: {Amount 12formatex(Namesizeof(Name), "45acp");}
        case CSW_AUG: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_ELITE: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_FIVESEVEN: {Amount 50formatex(Namesizeof(Name), "57mm");}
        case CSW_UMP45: {Amount 12formatex(Namesizeof(Name), "45acp");}
        case CSW_SG550: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_GALIL: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_FAMAS: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_USP: {Amount 12formatex(Namesizeof(Name), "45acp");}
        case CSW_GLOCK18: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_AWP: {Amount 10formatex(Namesizeof(Name), "338magnum");}
        case CSW_MP5NAVY: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_M249: {Amount 30formatex(Namesizeof(Name), "556natobox");}
        case CSW_M3: {Amount 8formatex(Namesizeof(Name), "buckshot");}
        case CSW_M4A1: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_TMP: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_G3SG1: {Amount 30formatex(Namesizeof(Name), "762nato");}
        case CSW_DEAGLE: {Amount 7formatex(Namesizeof(Name), "50ae");}
        case CSW_SG552: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_AK47: {Amount 30formatex(Namesizeof(Name), "762nato");}
        case CSW_P90: {Amount 50formatex(Namesizeof(Name), "57mm");}
    }
    
    
if(!silentemit_sound(idCHAN_ITEM"items/9mmclip1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
    ExecuteHamB(Ham_GiveAmmoidAmountName254)
}

public 
Do_RandomSpawn(id)
{
    if (!g_PlayerSpawn_Count)
        return;    
    
    
static hullsp_indexi
    
    hull 
= (pev(idpev_flags) & FL_DUCKING) ? HULL_HEAD HULL_HUMAN
    sp_index 
random_num(0g_PlayerSpawn_Count 1)
    
    
for (sp_index 1/*no condition*/i++)
    {
        if(>= g_PlayerSpawn_Count0
        
        
if(is_hull_vacant(g_PlayerSpawn_Point[i], hull))
        {
            engfunc(EngFunc_SetOriginidg_PlayerSpawn_Point[i])
            break
        }

        if (== sp_index) break
    }
}

public 
Recheck_HumanPosition(Float:Origin[3])
{
    static Float:MyOrigin[3]
    for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(is_user_zombie(i))
            continue
        pev(ipev_originMyOrigin)
        if(get_distance_f(OriginMyOrigin) > 480.0)
            continue
            
        Do_RandomSpawn
(i)
    }
}

public 
SetPlayerHealth(idHealthFullHealth)
{
    fm_set_user_health(idHealth)
    if(FullHealth) 
    
{
        g_MaxHealth[id] = Health
        set_pev
(idpev_max_healthfloat(Health))
    }
}

public 
Set_LightStart(id)
{
    static Light[2]; get_pcvar_string(g_Cvar_MapLightLight1)
    SetPlayerLight(idLight)
}

public 
End_Round(Float:EndTimeRoundDrawCsTeams:Team)
// RoundDraw: Draw or Team Win
// Team: 1 - T | 2 - CT
{
    if(g_GameEnded) return
    if(RoundDraw) 
    
{
        GM_TerminateRound(EndTimeWINSTATUS_DRAW)
        ExecuteForward(g_Forwards[FWD_GAME_END], g_fwResultCS_TEAM_UNASSIGNED)
    
        client_print
(0print_center"%L"LANG_DEFAULT"NOTICE_GAMESTART")
    } else {
        if(Team == CS_TEAM_T) 
        
{
            GM_TerminateRound(6.0WINSTATUS_TERRORIST)
            ExecuteForward(g_Forwards[FWD_GAME_END], g_fwResultCS_TEAM_T)
            
            PlaySound
(0Vox_WinBoss)
            
            set_hudmessage
(20000HUD_WIN_XHUD_WIN_Y06.06.00.01.5)
            show_hudmessage(0"%L"LANG_DEFAULT"NOTICE_WINZOMBIE")
        } else if(Team == CS_TEAM_CT) {
            
            GM_TerminateRound
(6.0WINSTATUS_CT)
            ExecuteForward(g_Forwards[FWD_GAME_END], g_fwResultCS_TEAM_CT)
            
            PlaySound
(0Vox_WinHuman)
        
            set_hudmessage
(02000HUD_WIN_XHUD_WIN_Y06.06.00.01.5)
            show_hudmessage(0"%L"LANG_DEFAULT"NOTICE_WINHUMAN")
        }
    }
    
    g_GameEnded 
1
    Event_RoundEnd
()
}

public 
is_user_zombie(id)
{
    if(!is_connected(id))
        return 0
    
    
return Get_BitVar(g_IsZombieid) ? 0
}

stock Get_ZombieAlive()
{
    new Count
    
for(new 0g_MaxPlayersi++)
    {
        if(!is_connected(i))
            continue
        if(is_alive(i) && is_user_zombie(i))
            Count++
    }
    
    
return Count
}

stock SetPlayerLight(id, const LightStyle[])
{
    if(id != 0)
    {
        message_begin(MSG_ONE_UNRELIABLESVC_LIGHTSTYLE, .player id)
        write_byte(0)
        write_string(LightStyle)
        message_end()        
    
} else {
        message_begin(MSG_BROADCASTSVC_LIGHTSTYLE)
        write_byte(0)
        write_string(LightStyle)
        message_end()    
    
}
}

stock Get_PlayerCount(AliveTeam)
// Alive: 0 - Dead | 1 - Alive | 2 - Both
// Team: 1 - T | 2 - CT
{
    new Flag[4], Flag2[12]
    new Players[32], PlayerNum

    
if(!Aliveformatex(Flagsizeof(Flag), "%sb"Flag)
    else if(Alive == 1formatex(Flagsizeof(Flag), "%sa"Flag)
    
    
if(Team == 1) 
    
{
        formatex(Flagsizeof(Flag), "%se"Flag)
        formatex(Flag2sizeof(Flag2), "TERRORIST"Flag)
    } else if(Team == 2) 
    
{
        formatex(Flagsizeof(Flag), "%se"Flag)
        formatex(Flag2sizeof(Flag2), "CT"Flag)
    }
    
    get_players
(PlayersPlayerNumFlagFlag2)
    
    
return PlayerNum
}

stock Get_TotalInPlayer(Alive)
{
    return Get_PlayerCount(Alive1) + Get_PlayerCount(Alive2)
}

stock is_hull_vacant(Float:Origin[3], hull)
{
    engfunc(EngFunc_TraceHullOriginOrigin0hull00)
    
    
if (!get_tr2(0TR_StartSolid) && !get_tr2(0TR_AllSolid) && get_tr2(0TR_InOpen))
        return true
    
    
return false
}

stock collect_spawns_ent(const classname[])
{
    static entent = -1
    
while ((ent engfunc(EngFunc_FindEntityByStringent"classname"classname)) != 0)
    {
        // get origin
        static Float:originF[3]
        pev(entpev_originoriginF)
        
        g_PlayerSpawn_Point
[g_PlayerSpawn_Count][0] = originF[0]
        g_PlayerSpawn_Point[g_PlayerSpawn_Count][1] = originF[1]
        g_PlayerSpawn_Point[g_PlayerSpawn_Count][2] = originF[2]
        
        
// increase spawn count
        g_PlayerSpawn_Count++
        if(g_PlayerSpawn_Count >= sizeof g_PlayerSpawn_Point) break;
    }
}

stock collect_spawns_ent2(const classname[])
{
    static entent = -1
    
while ((ent engfunc(EngFunc_FindEntityByStringent"classname"classname)) != 0)
    {
        // get origin
        static Float:originF[3]
        pev(entpev_originoriginF)
        
        g_BossSpawn_Point
[g_BossSpawn_Count][0] = originF[0]
        g_BossSpawn_Point[g_BossSpawn_Count][1] = originF[1]
        g_BossSpawn_Point[g_BossSpawn_Count][2] = originF[2]
        
        
// increase spawn count
        g_BossSpawn_Count++
        if(g_BossSpawn_Count >= sizeof g_BossSpawn_Point) break;
    }
}

stock Get_RandomArray(Array:ArrayName)
{
    return random_num(0ArraySize(ArrayName) - 1)
}

stock PlaySound(id, const sound[])
{
    if(equal(sound[strlen(sound)-4], ".mp3")) client_cmd(id"mp3 play ^"sound/%s^""sound)
    else client_cmd(id"spk ^"%s^""sound)
}

stock StopSound(idclient_cmd(id"mp3 stop; stopsound")
stock EmitSound(idChannel, const Sound[]) emit_sound(idChannelSoundVOL_NORMATTN_NORM0PITCH_NORM)
stock client_printc(index, const text[], any:...)
{
    static szMsg[128]; vformat(szMsgsizeof(szMsg) - 1text3)

    replace_all(szMsgsizeof(szMsg) - 1"!g""^x04")
    replace_all(szMsgsizeof(szMsg) - 1"!n""^x01")
    replace_all(szMsgsizeof(szMsg) - 1"!t""^x03")

    if(!index)
    {
        for(new 0g_MaxPlayersi++)
        {
            if(!is_connected(i))
                continue
                
            message_begin
(MSG_ONE_UNRELIABLEg_MsgSayText_i);
            write_byte(i);
            write_string(szMsg);
            message_end();    
        
}        
    
} else {
        message_begin(MSG_ONE_UNRELIABLEg_MsgSayText_index);
        write_byte(index);
        write_string(szMsg);
        message_end();
    }
}
 

public fm_cs_set_user_model(taskid)
{
    static idid taskid TASK_CHANGEMODEL
    set_user_info
(id"model"g_CustomPlayerModel[id])
}

stock fm_cs_set_user_model_index(id)
{
    if (pev_valid(id) != PDATA_SAFE)
        return;
    
    set_pdata_int
(idOFFSET_MODELINDEXg_CustomModelIndex[id])
}

stock fm_cs_reset_user_model_index(id)
{
    if (pev_valid(id) != PDATA_SAFE)
        return;
    
    
switch(cs_get_user_team(id))
    {
        case CS_TEAM_Tset_pdata_int(idOFFSET_MODELINDEXengfunc(EngFunc_ModelIndexDEFAULT_MODELINDEX_T))
        case CS_TEAM_CTset_pdata_int(idOFFSET_MODELINDEXengfunc(EngFunc_ModelIndexDEFAULT_MODELINDEX_CT))
    }
}

stock fm_cs_get_user_model(idmodel[], len)
{
    get_user_info(id"model"modellen)
}

stock fm_cs_reset_user_model(id)
{
    // Set some generic model and let CS automatically reset player model to default
    copy(g_CustomPlayerModel[id], charsmax(g_CustomPlayerModel[]), "gordon")
    fm_cs_user_model_update(id+TASK_CHANGEMODEL)
#if defined SET_MODELINDEX_OFFSET
    fm_cs_reset_user_model_index(id)
#endif
}

stock fm_cs_user_model_update(taskid)
{
    new Float:current_time
    current_time 
get_gametime()
    
    
if(current_time g_ModelChangeTargetTime >= MODELCHANGE_DELAY)
    {
        fm_cs_set_user_model(taskid)
        g_ModelChangeTargetTime current_time
    
} else {
        set_task((g_ModelChangeTargetTime MODELCHANGE_DELAY) - current_time"fm_cs_set_user_model"taskid)
        g_ModelChangeTargetTime g_ModelChangeTargetTime MODELCHANGE_DELAY
    
}
}


// Send User Team Message (Note: this next message can be received by other plugins)
public fm_cs_set_user_team_msg(taskid)
{
    // Tell everyone my new team
    emessage_begin(MSG_ALLg_MsgTeamInfo)
    ewrite_byte(ID_TEAMMSG// player
    ewrite_string(CS_TEAM_NAMES[_:cs_get_user_team(ID_TEAMMSG)]) // team
    emessage_end()
    
    
// Fix for AMXX/CZ bots which update team paramater from ScoreInfo message
    emessage_begin(MSG_BROADCASTg_MsgScoreInfo)
    ewrite_byte(ID_TEAMMSG// id
    ewrite_short(pev(ID_TEAMMSGpev_frags)) // frags
    ewrite_short(cs_get_user_deaths(ID_TEAMMSG)) // deaths
    ewrite_short(0// class?
    ewrite_short(_:cs_get_user_team(ID_TEAMMSG)) // team
    emessage_end()
}

// Update Player's Team on all clients (adding needed delays)
stock fm_user_team_update(id)
{
    
    
new Float:current_time
    current_time 
get_gametime()
    
    
if (current_time g_TeamMsgTargetTime >= TEAMCHANGE_DELAY)
    {
        set_task(0.1"fm_cs_set_user_team_msg"id+TASK_TEAMMSG)
        g_TeamMsgTargetTime current_time TEAMCHANGE_DELAY
    
}
    else
    {
        set_task((g_TeamMsgTargetTime TEAMCHANGE_DELAY) - current_time"fm_cs_set_user_team_msg"id+TASK_TEAMMSG)
        g_TeamMsgTargetTime g_TeamMsgTargetTime TEAMCHANGE_DELAY
    
}
}


/* ===============================
------------- SAFETY -------------
=================================*/
public Register_SafetyFunc()
{
    register_event("CurWeapon""Safety_CurWeapon""be""1=1")
    
    RegisterHam
(Ham_Spawn"player""fw_Safety_Spawn_Post"1)
    RegisterHam(Ham_Killed"player""fw_Safety_Killed_Post"1)
}

public 
Register_SafetyFuncBot(id)
{
    RegisterHamFromEntity(Ham_Spawnid"fw_Safety_Spawn_Post"1)
    RegisterHamFromEntity(Ham_Killedid"fw_Safety_Killed_Post"1)
}

public 
Safety_Connected(id)
{
    Set_BitVar(g_IsConnectedid)
    UnSet_BitVar(g_IsAliveid)
    
    g_PlayerWeapon
[id] = 0
}

public 
Safety_Disconnected(id)
{
    UnSet_BitVar(g_IsConnectedid)
    UnSet_BitVar(g_IsAliveid)
    
    g_PlayerWeapon
[id] = 0
}

public 
Safety_CurWeapon(id)
{
    if(!is_alive(id))
        return
        
    
static CSWCSW read_data(2)
    if(g_PlayerWeapon[id] != CSWg_PlayerWeapon[id] = CSW
}

public 
fw_Safety_Spawn_Post(id)
{
    if(!is_user_alive(id))
        return
        
    Set_BitVar
(g_IsAliveid)
}

public 
fw_Safety_Killed_Post(id)
{
    UnSet_BitVar(g_IsAliveid)
}

public 
is_connected(id)
{
    if(!(<= id <= 32))
        return 0
    
if(!Get_BitVar(g_IsConnectedid))
        return 0

    
return 1
}

public 
is_alive(id)
{
    if(!is_connected(id))
        return 0
    
if(!Get_BitVar(g_IsAliveid))
        return 0
        
    
return 1
}

public 
get_player_weapon(id)
{
    if(!is_alive(id))
        return 0
    
    
return g_PlayerWeapon[id]
}

/* ===============================
--------- END OF SAFETY  ---------
=================================*/ 




#4
(11-10-2017, Saat: 22:07)!berk! Adlı Kullanıcıdan Alıntı: @Arge Arge Simdi Bu Plugin Zaten Cs İçin Yazilmiş Bir Plugin

He Bu Are reapi Diye Bir Kodlama Dili Gormedim(Varsada Bilmioyrum) Hani Tam Yapamam Cok Az Biliyorum Ama Calişir Ya Çalişmasa Paylasmazlar

Hem ADam Calişmiycak Plugini Neden Kodlasin Gülücük

Bence Sorun Sende Yaptigin Birşey VS

Hatami Veriyor Ne Oluyor Onu Soylersen Yardim Edebilirim
Mesela Plugini yuklerken Felan

Ve Plugini 1.8.2 De Test Ettim DHudmessage Hatasi Verdi Hudmessageye Çeviridim ve Suan Plugin bende Sorunsuz Gozukuyor
PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <xs>

#define PLUGIN "Zombie Giant (Limited Edition)"
#define VERSION "1.0"
#define AUTHOR "Dias Pendragon"

#define MAX_PLAYERS 32

#define LANG_FILE "zombie_giant.txt"
#define LANG_DEFAULT LANG_SERVER
#define GAMENAME "Zombie Giant"

// Task
#define TASK_COUNTDOWN 15110
#define TASK_ROUNDTIME 15111

// MACROS
#define Get_BitVar(%1,%2) (%1 & (1 << (%2 & 31)))
#define Set_BitVar(%1,%2) %1 |= (1 << (%2 & 31))
#define UnSet_BitVar(%1,%2) %1 &= ~(1 << (%2 & 31))

// HUD
#define HUD_WIN_X -1.0
#define HUD_WIN_Y 0.20
#define HUD_NOTICE_X -1.0
#define HUD_NOTICE_Y 0.25
#define HUD_NOTICE2_X -1.0
#define HUD_NOTICE2_Y 0.70

// Environment
#define ENV_RAIN 0
#define ENV_SNOW 0
#define ENV_FOG 1
#define ENV_FOG_DENSITY "0.0005"
#define ENV_FOG_COLOR "255 212 85"


#if defined _gamemaster_included
    #endinput
#endif
#define _gamemaster_included

#if AMXX_VERSION_NUM >= 175
 #pragma reqlib gamemaster
 #if !defined AMXMODX_NOAUTOLOAD
  #pragma loadlib gamemaster
 #endif
#else
 #pragma library gamemaster
#endif

#if defined _gamemaster_included
#endif
#define _gamemaster_included

#if AMXX_VERSION_NUM >= 175
 #pragma reqlib gamemaster
 #if !defined AMXMODX_NOAUTOLOAD
  #pragma loadlib gamemaster
 #endif
#else
 #pragma library gamemaster
#endif



enum
{
    WINSTATUS_CT 1,
    WINSTATUS_TERRORIST,
    WINSTATUS_DRAW
}

// Round Mangement
native GM_EndRound_Block(bool:Enabled); // true or false only (set only when server starts, except precache)
native GM_TerminateRound(Float:DelayTimeWinningStatus); 

// Changing Model
native GM_Set_PlayerModel(id, const Model[]);
native GM_Reset_PlayerModel(id);
    
// Changing Team
native GM_Set_PlayerTeam(idCsTeams:Team);
    
// Changing Speed
native GM_Set_PlayerSpeed(idFloat:SpeedBlockSpeed);
native GM_Reset_PlayerSpeed(id);

// Running Time
forward GM_Time();


enum
{
    WINSTATUS_CT 1,
    WINSTATUS_TERRORIST,
    WINSTATUS_DRAW
}


// Running Time
forward GM_Time();


new const 
Env_Sky[1][] =
{
    "Des"
}

// Model Config
new const Model_Player[8][] =
{
    "gign",
    "gsg9",
    "urban",
    "sas",
    "arctic",
    "leet",
    "guerilla",
    "terror"
}

// Sound Config
new const Sound_RoundStart[1][] =
{
    "zombie_giant/zombie_select.wav"
}

new const 
Sound_GameStart[1][] =
{
    "zombie_giant/zombie_spawn.wav"
}

new const 
Sound_Ambience[3][] =
{
    "zombie_giant/ambience/Continuing_Suspense.mp3",
    "zombie_giant/ambience/L.O.T.B_The-Fiend.mp3",
    "zombie_giant/ambience/Luminous_Sword.mp3"
}

new const 
Sound_Result[1][] =
{
    "zombie_giant/zombie_result.wav"
}

new const 
Vox_Count[] = "zombie_giant/count/%i.wav"

new const Vox_WinHuman[] = "zombie_giant/win_human.wav"
new const Vox_WinBoss[] = "zombie_giant/win_zombie.wav"

// Next
const PDATA_SAFE 2

enum
{
    TEAM_NONE 0,
    TEAM_ZOMBIE,
    TEAM_HUMAN,
    TEAM_SPECTATOR
}

// Block Round Event
new g_BlockedObj_Forward
new g_BlockedObj[15][32] =
{
        "func_bomb_target",
        "info_bomb_target",
        "info_vip_start",
        "func_vip_safetyzone",
        "func_escapezone",
        "hostage_entity",
        "monster_scientist",
        "func_hostage_rescue",
        "info_hostage_rescue",
        "env_fog",
        "env_rain",
        "env_snow",
        "item_longjump",
        "func_vehicle",
        "func_buyzone"
}

#define CAMERA_CLASSNAME "nikon_d810"
#define CAMERA_MODEL "models/winebottle.mdl"

// Cvars
new g_Cvar_MinPlayerg_Cvar_MapLightg_Cvar_CountTime
new g_Cvar_HumanHealthg_Cvar_HumanArmorg_Cvar_HumanGravity
new g_CvarPointer_RoundTime

// Main Cvars
new g_GameStartedg_RoundStartedg_GameEndedg_MaxPlayersg_Countdowng_CountTime
new g_IsZombieg_JoinedFloat:g_PassedTimeFloat:g_PassedTime2g_MaxHealth[33], g_ViewCamera, 
g_MyCamera
[33], Float:g_CameraOrigin[33][3], g_MyClass[33], g_Has_NightVisiong_UsingNVG
new g_MsgSayTextg_SyncHud_HP[2], g_SyncHud_MPg_MsgScreenFadeg_TotalClassg_MyMana[33]
new 
Float:g_PlayerSpawn_Point[64][3], g_PlayerSpawn_Count
new Float:g_BossSpawn_Point[64][3], g_BossSpawn_Countg_BossSpawnCode

new Array:GiantBaseHP
new const SoundNVG[2][] = { "items/nvg_off.wav""items/nvg_on.wav"}

// Forwards
#define MAX_FORWARD 8

enum
{
    FWD_ROUND_NEW 0,
    FWD_ROUND_START,
    FWD_GAME_START,
    FWD_GAME_END,
    FWD_BECOME_GIANT,
    FWD_USER_KILL,
    FWD_RUNTIME,
    FWD_EQUIP
}

new 
g_Forwards[MAX_FORWARD], g_fwResult

// Safety
new g_HamBot
new g_IsConnectedg_IsAliveg_PlayerWeapon[33]

// =============== Changing Model ===============
#define MODELCHANGE_DELAY 0.1     // Delay between model changes (increase if getting SVC_BAD kicks)
#define ROUNDSTART_DELAY 2.0     // Delay after roundstart (increase if getting kicks at round start)
#define SET_MODELINDEX_OFFSET     // Enable custom hitboxes (experimental, might lag your server badly with some models)

#define MODELNAME_MAXLENGTH 32
#define TASK_CHANGEMODEL 1962

new const DEFAULT_MODELINDEX_T[] = "models/player/terror/terror.mdl"
new const DEFAULT_MODELINDEX_CT[] = "models/player/urban/urban.mdl"

new g_HasCustomModel
new g_HasCustomSpeed
new Float:g_ModelChangeTargetTime
new g_CustomPlayerModel[MAX_PLAYERS+1][MODELNAME_MAXLENGTH]
#if defined SET_MODELINDEX_OFFSET
new g_CustomModelIndex[MAX_PLAYERS+1]
#endif

#define OFFSET_CSTEAMS 114
#define OFFSET_MODELINDEX 491 // Orangutanz
// ==============================================

// =============== Changing Team ================
#define TEAMCHANGE_DELAY 0.1

#define TASK_TEAMMSG 200
#define ID_TEAMMSG (taskid - TASK_TEAMMSG)

// CS Player PData Offsets (win32)
#define PDATA_SAFE 2
#define OFFSET_CSTEAMS 114

new const CS_TEAM_NAMES[][] = { "UNASSIGNED""TERRORIST""CT""SPECTATOR" }

new 
Float:g_TeamMsgTargetTime
new g_MsgTeamInfog_MsgScoreInfo
// ==============================================

// =============== Changing Speed ===============
#define Ham_CS_Player_ResetMaxSpeed Ham_Item_PreFrame 
#define SV_MAXSPEED 999.0


public plugin_init()
{
    register_plugin(PLUGINVERSIONAUTHOR)
    
    register_dictionary
(LANG_FILE)
    Register_SafetyFunc()
    
    
// Event
    register_event("HLTV""Event_NewRound""a""1=0""2=0")
    register_event("TextMsg""Event_GameRestart""a""2=#Game_will_restart_in")
    register_event("DeathMsg""Event_Death""a")
    register_logevent("Event_RoundStart"2"1=Round_Start")
    register_logevent("Event_RoundEnd"2"1=Round_End")    
    
    
// Fakemeta
    unregister_forward(FM_Spawng_BlockedObj_Forward)
    register_forward(FM_StartFrame"fw_StartFrame")
    register_forward(FM_GetGameDescription"fw_GetGameDesc")
    register_forward(FM_SetClientKeyValue"fw_SetClientKeyValue")
    register_forward(FM_AddToFullPack"fw_AddToFullPack_Post"1)
    
    
// Ham
    RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    RegisterHam(Ham_Killed"player""fw_PlayerKilled_Post"1)
    RegisterHam(Ham_TakeDamage"player""fw_PlayerTakeDamage")
    RegisterHam(Ham_Use"func_tank""fw_UseStationary")
    RegisterHam(Ham_Use"func_tankmortar""fw_UseStationary")
    RegisterHam(Ham_Use"func_tankrocket""fw_UseStationary")
    RegisterHam(Ham_Use"func_tanklaser""fw_UseStationary")
    RegisterHam(Ham_Use"func_tank""fw_UseStationary_Post"1)
    RegisterHam(Ham_Use"func_tankmortar""fw_UseStationary_Post"1)
    RegisterHam(Ham_Use"func_tankrocket""fw_UseStationary_Post"1)
    RegisterHam(Ham_Use"func_tanklaser""fw_UseStationary_Post"1)
    RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon")
    RegisterHam(Ham_Touch"armoury_entity""fw_TouchWeapon")
    RegisterHam(Ham_Touch"weapon_shield""fw_TouchWeapon")
    RegisterHam(Ham_CS_Player_ResetMaxSpeed"player""fw_Ham_ResetMaxSpeed")
    
    
// Message
    register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon")
    register_message(get_user_msgid("Health"), "Message_Health")
    register_message(get_user_msgid("ClCorpse"), "Message_ClCorpse")
    
    
// Team Mananger
    register_clcmd("chooseteam""CMD_JoinTeam")
    register_clcmd("jointeam""CMD_JoinTeam")
    register_clcmd("joinclass""CMD_JoinTeam")
    register_clcmd("nightvision""CMD_NightVision")
    
    
// Collect Spawns Point
    collect_spawns_ent("info_player_start")
    collect_spawns_ent2("info_player_deathmatch")
    
    
// Forward
    g_Forwards[FWD_ROUND_NEW] = CreateMultiForward("zg_round_new"ET_IGNORE)
    g_Forwards[FWD_ROUND_START] = CreateMultiForward("zg_round_start"ET_IGNORE)
    g_Forwards[FWD_GAME_START] = CreateMultiForward("zg_game_start"ET_IGNORE)
    g_Forwards[FWD_GAME_END] = CreateMultiForward("zg_game_end"ET_IGNOREFP_CELL)
    g_Forwards[FWD_BECOME_GIANT] = CreateMultiForward("zg_become_giant"ET_IGNOREFP_CELLFP_CELLFP_FLOATFP_FLOATFP_FLOAT)
    g_Forwards[FWD_USER_KILL] = CreateMultiForward("zg_user_kill"ET_IGNOREFP_CELLFP_CELLFP_CELLFP_CELL)
    g_Forwards[FWD_RUNTIME] = CreateMultiForward("zg_runningtime"ET_IGNORE)
    g_Forwards[FWD_EQUIP] = CreateMultiForward("zg_equipment_menu"ET_IGNOREFP_CELL)

    // Vars
    g_MaxPlayers get_maxplayers()
    
    g_CvarPointer_RoundTime 
get_cvar_pointer("mp_roundtime")
    g_Cvar_MinPlayer register_cvar("zg_minplayer""2")
    g_Cvar_MapLight register_cvar("zb_maplight""d")
    g_Cvar_CountTime register_cvar("zg_counttime""12")
    
    g_Cvar_HumanHealth 
register_cvar("zg_human_health""1000")
    g_Cvar_HumanArmor register_cvar("zg_human_armor""100")
    g_Cvar_HumanGravity register_cvar("zg_human_gravity""1.0")
    
    g_MsgTeamInfo 
get_user_msgid("TeamInfo")
    g_MsgScoreInfo get_user_msgid("ScoreInfo")    
    g_MsgSayText 
get_user_msgid("SayText")
    g_MsgScreenFade get_user_msgid("ScreenFade")
    
    g_SyncHud_HP
[0] = CreateHudSyncObj(1)
    g_SyncHud_HP[1] = CreateHudSyncObj(2)
    g_SyncHud_MP CreateHudSyncObj(3)
    
    
// First Setting
    Round_Setting()
    
    
// Patch Round Infinity
    GM_EndRound_Block(true)
}

public 
plugin_precache()
{
    GiantBaseHP ArrayCreate(11)
    
    
// Register Forward
    g_BlockedObj_Forward register_forward(FM_Spawn"fw_BlockedObj_Spawn")    
    
    
// Precache 
    new iBufferB[128]
    
    precache_model
(CAMERA_MODEL)
    
    
for(0sizeof(Sound_RoundStart); i++)
        precache_sound(Sound_RoundStart[i])
    for(0sizeof(Sound_GameStart); i++)
        precache_sound(Sound_GameStart[i])
    for(0sizeof(Sound_Result); i++)
        precache_sound(Sound_Result[i])
    for(0sizeof(Sound_Ambience); i++)
        precache_sound(Sound_Ambience[i])
        
    
for(1<= 10i++)
    {
        formatex(BufferBcharsmax(BufferB), Vox_Counti); 
        engfunc
(EngFunc_PrecacheSoundBufferB); 
    
}        
        
    precache_sound
(Vox_WinHuman)
    precache_sound(Vox_WinBoss)
    
    
// Handle
    Environment_Setting()
}

public 
plugin_natives()
{
    register_native("zg_is_giant""Native_IsGiant"1)
    register_native("zg_get_giantclass""Native_GetClass"1)
    register_native("zg_get_maxhealth""Native_GetMaxHP"1)
    register_native("zg_get_nightvision""Native_GetNVG"1)
    register_native("zg_set_nightvision""Native_SetNVG"1)
    register_native("zg_get_mana""Native_GetMP"1)
    register_native("zg_set_mana""Native_SetMP"1)
    
    register_native
("zg_register_giantclass""Native_RegisterClass"1)
}

public 
plugin_cfg()
{
    server_cmd("mp_roundtime 5")
    server_cmd("mp_freezetime 3")
    server_cmd("mp_flashlight 1")
    server_cmd("mp_friendlyfire 0")
    server_cmd("mp_limitteams 0")
    server_cmd("mp_autoteambalance 0")
    
    set_cvar_num
("sv_maxspeed"999)
    set_cvar_num("sv_skycolor_r"0)
    set_cvar_num("sv_skycolor_g"0)
    set_cvar_num("sv_skycolor_b"0)    
    
    
// Sky
    set_cvar_string("sv_skyname"Env_Sky[random(sizeof(Env_Sky))])
    
    
// New Round
    Event_NewRound()
}

public 
Native_IsGiant(id)
{
    if(!is_connected(id))
        return 0
        
    
return Get_BitVar(g_IsZombieid) ? 0
}

public 
Native_GetClass(id)
{
    if(!is_connected(id))
    {
        server_print("[ZG] Error: Get Class with unconnected User!")
        return -1
    
}
    
    
return g_MyClass[id]
}

public 
Native_GetMaxHP(id)
{
    if(!is_connected(id))
        return 0
        
    
return g_MaxHealth[id]
}

public 
Native_GetNVG(idHaveOn)
{
    if(Have && !On)
    {
        if(Get_BitVar(g_Has_NightVisionid) && !Get_BitVar(g_UsingNVGid))
            return 1
    
} else if(!Have && On) {
        if(!Get_BitVar(g_Has_NightVisionid) && Get_BitVar(g_UsingNVGid))
            return 1
    
} else if(Have && On) {
        if(Get_BitVar(g_Has_NightVisionid) && Get_BitVar(g_UsingNVGid))
            return 1
    
} else if(!Have && !On) {
        if(!Get_BitVar(g_Has_NightVisionid) && !Get_BitVar(g_UsingNVGid))
            return 1
    
}
    
    
return 0
}

public 
Native_SetNVG(idGiveOnSoundIgnoredHad)
{
    if(!is_connected(id))
        return
        
    
if(GiveSet_BitVar(g_Has_NightVisionid)
    set_user_nightvision(idOnSoundIgnoredHad)
}

public 
Native_GetMP(id)
{
    if(!is_connected(id))
        return 0
        
    
return g_MyMana[id]
}

public 
Native_SetMP(idMP)
{
    if(!is_connected(id))
        return
    
    g_MyMana
[id] = MP
}

public 
Native_RegisterClass(BaseHealth)
{
    ArrayPushCell(GiantBaseHPBaseHealth)
    
    g_TotalClass
++
    return g_TotalClass 1
}

public 
fw_BlockedObj_Spawn(ent)
{
    if (!pev_valid(ent))
        return FMRES_IGNORED
    
    
static Ent_Classname[64]
    pev(entpev_classnameEnt_Classnamesizeof(Ent_Classname))
    
    
for(new 0sizeof g_BlockedObji++)
    {
        if (equal(Ent_Classnameg_BlockedObj[i]))
        {
            engfunc(EngFunc_RemoveEntityent)
            return FMRES_SUPERCEDE
        
}
    }
    
    
return FMRES_IGNORED
}

public 
Round_Setting()
{
    g_GameStarted 0
    g_GameEnded 
0
    g_RoundStarted 
0
}

public 
client_putinserver(id)
{
    Safety_Connected(id)
    Reset_Player(id1)
    
    set_task
(0.1"Set_LightStart"id)
    set_task(0.25"Set_NewTeam"id)
    
    remove_task
(id+TASK_CHANGEMODEL)

    UnSet_BitVar(g_HasCustomModelid)
    UnSet_BitVar(g_HasCustomSpeedid)
    
    
if(!g_HamBot && is_user_bot(id))
    {
        g_HamBot 1
        set_task
(0.1"Register_HamBot"id)
    }
}
 
public Register_HamBot(id)
{
    Register_SafetyFuncBot(id)
    
    RegisterHamFromEntity
(Ham_Spawnid"fw_PlayerSpawn_Post"1)
    RegisterHamFromEntity(Ham_Killedid"fw_PlayerKilled_Post"1)
    RegisterHamFromEntity(Ham_TakeDamageid"fw_PlayerTakeDamage")
}
 
public client_disconnected(id)
{
    Safety_Disconnected(id)
    
    
if(pev_valid(g_MyCamera[id])) set_pev(g_MyCamera[id], pev_flagsFL_KILLME)
    
    remove_task
(id+TASK_CHANGEMODEL)
    remove_task(id+TASK_TEAMMSG)
    
    UnSet_BitVar
(g_HasCustomModelid)
    UnSet_BitVar(g_HasCustomSpeedid)
}

public 
Environment_Setting()
{
    new BufferB[128]
    new Enable
    
    
// Weather & Sky
    Enable ENV_RAIN; if(Enableengfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_rain"))
    Enable ENV_SNOW; if(Enable)engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_snow"))    
    Enable 
ENV_FOG; 
    
if(Enable)
    {
        remove_entity_name("env_fog")
        
        
new ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_fog"))
        if (pev_valid(ent))
        {
            fm_set_kvd(ent"density"ENV_FOG_DENSITY"env_fog")
            fm_set_kvd(ent"rendercolor"ENV_FOG_COLOR"env_fog")
        }
    }
    
    
// Sky
    for(new 0sizeof(Env_Sky); i++)
    {
        // Preache custom sky files
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sbk.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sdn.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sft.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%slf.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%srt.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)
        formatex(BufferBcharsmax(BufferB), "gfx/env/%sup.tga"Env_Sky[i]); engfunc(EngFunc_PrecacheGenericBufferB)        
    
}        
}

public 
Event_Time()
{
    if(!g_GameStartedclient_print(0print_center"%L"LANG_DEFAULT"NOTICE_WAITFORPLAYER")
    if(g_GameStarted && (Get_TotalInPlayer(2) < get_pcvar_num(g_Cvar_MinPlayer)))
    {
        g_GameStarted 0
        g_GameEnded 
0
        g_RoundStarted 
0
    
}
    if(!g_GameStarted && (Get_TotalInPlayer(2) >= get_pcvar_num(g_Cvar_MinPlayer))) // START GAME NOW :D
    {
        g_GameStarted 1
        g_RoundStarted 
0
        
        End_Round
(5.01CS_TEAM_UNASSIGNED)
    }
    
    
// Show HUD
    Show_ScoreHud()
    Show_PlayerHUD()
    
    
// Check Gameplay
    Check_Gameplay()
    
    
// Exe
    ExecuteForward(g_Forwards[FWD_RUNTIME], g_fwResult)
}

public 
Event_Time2()
{
    Show_StatusHud()
}

public 
Check_Gameplay()
{
    if(!g_GameStarted || g_GameEnded || !g_RoundStarted)
        return
        
    
if(Get_PlayerCount(12) <= 0End_Round(5.00CS_TEAM_T)
    else if(Get_ZombieAlive() <= 0End_Round(5.00CS_TEAM_CT)
}

public 
Set_NewTeam(id)
{
    if(!is_connected(id))
        return
    if(is_alive(id))
        return
        
    Set_PlayerTeam
(idCS_TEAM_CT)
}

public 
Show_ScoreHud()
{
    
}

public 
Show_PlayerHUD()
{
    for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(cs_get_user_team(i) != CS_TEAM_T)
            continue
        
        
    
}
}

public 
Show_StatusHud()
{
    static TempText[61]; 
    
    
for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(cs_get_user_team(i) != CS_TEAM_T)
            continue
            
        
if(g_MyMana[i] < 100)
            g_MyMana[i] = min(g_MyMana[i] + 5100)
            
        
if(!g_MaxHealth[i])
            continue
            
        
        
// HP
        set_hudmessage(255000.2250.1000.00.60.00.0)
        ShowSyncHudMsg(ig_SyncHud_HP[0], "____________________________________________________________")

        formatex(TempText60"____________________________________________________________")
        TempText[(60 get_user_health(i)) / g_MaxHealth[i]] = EOS
        
        set_hudmessage
(25525500.2250.1000.00.60.00.0)
        ShowSyncHudMsg(ig_SyncHud_HP[1], TempText)
        
        
// MP
        formatex(TempText60"____________________________________________________________")
        TempText[(60 g_MyMana[i]) / 100] = EOS
    
        set_hudmessage
(025500.2250.1200.00.60.00.0)
        ShowSyncHudMsg(ig_SyncHud_MPTempText)
    }
}

public 
client_PreThink(id)
{
    if(!is_user_alive(id))
        return
        
    
// Handle Camera
    if(g_MyCamera[id] && Get_BitVar(g_ViewCameraid))
    {
        static Float:Origin[3], Float:CamOrigin[3]
        pev(idpev_originOrigin)
        
        
static Float:vAngle[3], Float:Angles[3]
        pev(idpev_anglesAngles)
        pev(idpev_v_anglevAngle)
        
        
static Float:i
        
for(256.0>= 0.0-= 0.1)
        {
            CamOrigin[0] = floatcos(vAngle], degrees) * -i
            CamOrigin
[1] = floatsin(vAngle], degrees) * -i
            CamOrigin
[2] = - (4)
            CamOrigin[0] += Origin[0]
            CamOrigin[1] += Origin[1]
            CamOrigin[2] += Origin[2]
            
            
if(PointContents(CamOrigin) != CONTENTS_SOLID && PointContents(CamOrigin) != CONTENTS_SKY)
                break;
        }
        
        vAngle
[0] = 20.0
        
        set_pev
(g_MyCamera[id], pev_originCamOrigin)
        set_pev(g_MyCamera[id], pev_anglesvAngle)
        set_pev(g_MyCamera[id], pev_v_anglevAngle)
    }
}
    
public Create_Camera(id)
{
    if(pev_valid(g_MyCamera[id]))
        return
    
    
static Float:vAngle[3], Float:Angles[3]
    
    pev
(idpev_origing_CameraOrigin[id])
    pev(idpev_v_anglevAngle)
    pev(idpev_anglesAngles)

    static EntEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    if(!pev_valid(Ent)) return

    set_pev(Entpev_classnameCAMERA_CLASSNAME)

    set_pev(Entpev_solid0)
    set_pev(Entpev_movetypeMOVETYPE_NOCLIP)
    set_pev(Entpev_ownerid)
    
    engfunc
(EngFunc_SetModelEntCAMERA_MODEL)

    static Float:Mins[3], Float:Maxs[3]
    
    Mins
[0] = -1.0
    Mins
[1] = -1.0
    Mins
[2] = -1.0
    Maxs
[0] = 1.0
    Maxs
[1] = 1.0
    Maxs
[2] = 1.0

    entity_set_size
(EntMinsMaxs)

    set_pev(Entpev_origing_CameraOrigin[id])
    set_pev(Entpev_v_anglevAngle)
    set_pev(Entpev_anglesAngles)

    fm_set_rendering(EntkRenderFxGlowShell000kRenderTransAlpha0)
    g_MyCamera[id] = Ent;
}

public 
View_Camera(idReset)
{
    if(!is_valid_ent(g_MyCamera[id]))
        Create_Camera(id)
    
    
if(!Reset) 
    
{
        attach_view(idg_MyCamera[id])
        Set_BitVar(g_ViewCameraid)
    } else {
        attach_view(idid)
        UnSet_BitVar(g_ViewCameraid)
    }
}

public 
Set_PlayerNVG(idGiveOnOnSoundIgnored_HadNVG)
{
    if(GiveSet_BitVar(g_Has_NightVisionid)
    set_user_nightvision(idOnOnSoundIgnored_HadNVG)
}

public 
set_user_nightvision(idOnOnSoundIgnored_HadNVG)
{
    if(!Ignored_HadNVG)
    {
        if(!Get_BitVar(g_Has_NightVisionid))
            return
    }

    if(OnSet_BitVar(g_UsingNVGid)
    else UnSet_BitVar(g_UsingNVGid)
    
    
if(OnSoundPlaySound(idSoundNVG[On])
    set_user_nvision(id)
    
    
return
}

public 
set_user_nvision(id)
{
    
    
static Alpha, Default[2]; get_pcvar_string(g_Cvar_MapLight, Default, 1)
    if(Get_BitVar(g_UsingNVGid)) Alpha 75
    
else Alpha 0
    
    message_begin
(MSG_ONE_UNRELIABLEg_MsgScreenFade_id)
    write_short(0// duration
    write_short(0// hold time
    write_short(0x0004// fade type
    if(!Get_BitVar(g_IsZombieid))
    {
        write_byte(0// r
        write_byte(150// g
        write_byte(0// b
    } else {
        write_byte(85// r
        write_byte(85// g
        write_byte(255// b
    }
    write_byte(Alpha// alpha
    message_end()
    
    
//if(Get_BitVar(g_UsingNVG, id)) SetPlayerLight(id, "#")
    //else SetPlayerLight(id, Default)
}

// ======================== EVENT ========================
// =======================================================
public Event_NewRound()
{
    // Player
    g_ModelChangeTargetTime get_gametime() + ROUNDSTART_DELAY
    
    
for(new 0g_MaxPlayersi++)
    {
        remove_task(i+TASK_TEAMMSG)
        
        
if(task_exists(i+TASK_CHANGEMODEL))
        {
            remove_task(i+TASK_CHANGEMODEL)
            fm_cs_user_model_update(i+TASK_CHANGEMODEL)
        }
        
        UnSet_BitVar
(g_HasCustomSpeedi)
    }
    
    
// System
    remove_task(TASK_ROUNDTIME)
    remove_task(TASK_COUNTDOWN)
    
    g_GameEnded 
0
    g_RoundStarted 
0
    g_Countdown 
0
    
    StopSound
(0)
    
    
// Gameplay Handle
    Check_GameStart()
    ExecuteForward(g_Forwards[FWD_ROUND_NEW], g_fwResult)
}

public 
Event_RoundStart()
{
    if(!g_GameStarted || g_GameEnded)
        return
    
    g_Countdown 
1
    set_task
(get_pcvar_float(g_CvarPointer_RoundTime) * 60.0"Event_TimeUp"TASK_ROUNDTIME)
    
    set_hudmessage
(2551270HUD_NOTICE_XHUD_NOTICE_Y00.15.00.010.5)
    show_hudmessage(0"%L"LANG_DEFAULT"NOTICE_ZOMBIESELECT")
    
    PlaySound
(0Sound_RoundStart[random(sizeof(Sound_RoundStart))])
    ExecuteForward(g_Forwards[FWD_ROUND_START], g_fwResult)
}

public 
Check_GameStart()
{
    if(!g_GameStarted || g_GameEnded)
        return
    
    Start_Countdown
()
}

public 
Event_TimeUp()
{
    if(!g_GameStarted || g_GameEnded)
        return
        
    End_Round
(5.00CS_TEAM_CT)
}

public 
Event_RoundEnd()
{
    g_GameEnded 1
    
    remove_task
(TASK_ROUNDTIME)
    remove_task(TASK_COUNTDOWN)
    
    PlaySound
(0Sound_Result[random(sizeof(Sound_Result))])
}

public 
Event_GameRestart()
{
    Event_RoundEnd()
}

public 
Event_Death()
{
    static AttackerVictimHeadshotWeapon[32], CSW
    
    Attacker 
read_data(1)
    Victim read_data(2)
    Headshot read_data(3)
    read_data(4Weaponsizeof(Weapon))
    
    
if(equal(Weapon"grenade"))
        CSW CSW_HEGRENADE
    
else { 
        
static BukiNoNamae[64];
        formatex(BukiNoNamae63"weapon_%s"Weapon)
        
        CSW 
get_weaponid(BukiNoNamae)
    }
    
    ExecuteForward
(g_Forwards[FWD_USER_KILL], g_fwResultVictimAttackerHeadshotCSW)
}

public 
Start_Countdown()
{
    g_CountTime get_pcvar_num(g_Cvar_CountTime)
    
    remove_task
(TASK_COUNTDOWN)
    CountingDown()
}

public 
CountingDown()
{
    if(!g_GameStarted || g_GameEnded)
        return
    if(g_CountTime  <= 0)
    {
        Start_Game_Now()
        return
    }
    
    client_print
(0print_center"%L"LANG_DEFAULT"NOTICE_COUNTING"g_CountTime)
    
    
if(g_CountTime <= 10)
    {
        static Sound[64]; format(Soundcharsmax(Sound), Vox_Countg_CountTime)
        PlaySound(0Sound)
    } 
    
    
if(g_Countdowng_CountTime--
    set_task(1.0"CountingDown"TASK_COUNTDOWN)
}

public 
Start_Game_Now()
{
    Boss_SpawnInit()
    
    
// Play Sound
    PlaySound(0Sound_GameStart[random(sizeof(Sound_GameStart))])
    
    
static TotalPlayerTotalPlayer Get_TotalInPlayer(1)
    static ZombieNumberZombieNumber clamp(floatround(float(TotalPlayer) / 8.0floatround_ceil), 15)
    
    
static PlayerList[32], PlayerNumPlayerNum 0
    
for(new 0ZombieNumberi++)
    {
        get_players(PlayerListPlayerNum"a")
        Set_PlayerZombie(PlayerList[random(PlayerNum)])
    }
    
    g_RoundStarted 
1
    
    
// Check Team & Show Message: Survival Time
    for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(is_user_zombie(i))
            continue
            
        
// Show Message
        set_hudmessage(0127255HUD_NOTICE_XHUD_NOTICE_Y00.15.00.010.5)
        show_hudmessage(i"%L"LANG_DEFAULT"NOTICE_ZOMBIEAPPEAR")
            
        
// Show Message
        set_hudmessage(8525585HUD_NOTICE2_XHUD_NOTICE2_Y20.13.00.010.5)
        show_hudmessage(i"%L"LANG_DEFAULT"NOTICE_ALIVETIME")

        Make_PlayerShake(i)
        
        
if(cs_get_user_team(i) == CS_TEAM_CT)
            continue
            
        
// Set Team
        Set_PlayerTeam(iCS_TEAM_CT)
    }
    
    
// Ambience
    PlaySound(0Sound_Ambience[random(sizeof(Sound_Ambience))])
    
    
// Exec Forward
    ExecuteForward(g_Forwards[FWD_GAME_START], g_fwResult)
}

public 
Set_PlayerZombie(id)
{
    static CodeTitan; if(CodeTitan >= g_TotalClassCodeTitan 0
    
static Float:StartOrigin[3]; pev(idpev_originStartOrigin)
    
    
// Set Info
    Set_BitVar(g_IsZombieid)    
    Set_PlayerTeam
(idCS_TEAM_T)
    Set_PlayerNVG(id1100)
    
    g_MyMana
[id] = 100
    g_MyClass
[id] = CodeTitan
    
    
// Player Origin
    if(g_BossSpawnCode >= g_BossSpawn_Count)
        g_BossSpawnCode 0
    
    Recheck_HumanPosition
(g_BossSpawn_Point[g_BossSpawnCode])
    StartOrigin g_BossSpawn_Point[g_BossSpawnCode]
    
    g_BossSpawnCode
++
    
    
// Handle Player
    fm_strip_user_weapons(id)
    fm_give_item(id"weapon_knife")
    
    set_pev
(idpev_solidSOLID_NOT)
    set_pev(idpev_movetypeMOVETYPE_NOCLIP)
    fm_set_rendering(idkRenderFxGlowShell000kRenderTransAlpha0)
    
    
// HP
    static HPHP ArrayGetCell(GiantBaseHPCodeTitan)
    static PlayerNumPlayerNum clamp(Get_TotalInPlayer(1), 132)
    
    HP 
*= PlayerNum
    SetPlayerHealth
(idHP1)
    
    
// Camera
    Create_Camera(id)
    View_Camera(id0)
    
    set_task
(0.1"Second_Strip"id)
    ExecuteForward(g_Forwards[FWD_BECOME_GIANT], g_fwResultidCodeTitanStartOrigin[0], StartOrigin[1], StartOrigin[2])
    
    CodeTitan
++
}

public 
Boss_SpawnInit()
{
    g_BossSpawnCode random(g_BossSpawn_Count)
}

public 
Second_Strip(idfm_strip_user_weapons(id)

// ====================== FAKEMETA =======================
// =======================================================
public fw_GetGameDesc()
{
    forward_return(FMV_STRINGGAMENAME)
    return FMRES_SUPERCEDE
}

public 
fw_StartFrame()
{
    static Float:TimeTime get_gametime()
    
    
if(Time 1.0 g_PassedTime)
    {
        Event_Time()
        g_PassedTime Time
    
}
    if(Time 0.5 g_PassedTime2)
    {
        Event_Time2()
        g_PassedTime2 Time
    
}
}

public 
fw_SetClientKeyValue(id, const infobuffer[], const key[], const value[])
{
    if (Get_BitVar(g_HasCustomModelid) && equal(key"model"))
    {
        static currentmodel[MODELNAME_MAXLENGTH]
        fm_cs_get_user_model(idcurrentmodelcharsmax(currentmodel))
        
        
if (!equal(currentmodelg_CustomPlayerModel[id]) && !task_exists(id+TASK_CHANGEMODEL))
            fm_cs_set_user_model(id+TASK_CHANGEMODEL)
        
#if defined SET_MODELINDEX_OFFSET
        fm_cs_set_user_model_index(id)
#endif
        
        
return FMRES_SUPERCEDE;
    }
    
    
return FMRES_IGNORED;
}

public 
fw_AddToFullPack_Post(eseenthosthostflagsplayerpSet)
{
    if(!player)
        return FMRES_IGNORED
    
if(!is_alive(ent) || !is_alive(host))
        return FMRES_IGNORED
    
if(is_user_zombie(ent) || !is_user_zombie(host))
        return FMRES_IGNORED
        
    
static Float:CurHealthFloat:MaxHealth
    
static Float:PercentPercent2RealPercent
    
    pev
(entpev_healthCurHealth)
    MaxHealth float(g_MaxHealth[ent])
    
    Percent 
= (CurHealth MaxHealth) * 100.0
    Percent2 
floatround(Percent)
    RealPercent clamp(Percent21100)
    
    
static Color[3]
    
    
switch(RealPercent)
    {
        case 1..49Color = {7500}
        case 50..79Color = {75750}
        case 80..100Color = {0750}
    }
    
    set_es
(esES_RenderFxkRenderFxGlowShell)
    set_es(esES_RenderModekRenderNormal)
    set_es(esES_RenderColorColor)
    set_es(esES_RenderAmt16)
    
    
return FMRES_HANDLED
}

// ===================== HAMSANDWICH =====================
// =======================================================
public fw_PlayerSpawn_Post(id)
{
    if(!is_user_alive(id)) return
    
    Set_BitVar
(g_Joinedid)
    
    Reset_Player
(id0)
    View_Camera(id1)
    
    
// Set Human
    Do_RandomSpawn(id)
    
    set_task
(0.01"Set_LightStart"id)
    fm_set_user_rendering(id)
    set_user_nightvision(id000)
    
    Set_PlayerTeam
(idCS_TEAM_CT)
    SetPlayerHealth(idget_pcvar_num(g_Cvar_HumanHealth), 1)
    cs_set_user_armor(idget_pcvar_num(g_Cvar_HumanArmor), CS_ARMOR_KEVLAR)
    set_pev(idpev_gravityget_pcvar_float(g_Cvar_HumanGravity))
    
    Reset_PlayerSpeed
(id)
    
    
// Start Weapon
    fm_strip_user_weapons(id)
    fm_give_item(id"weapon_knife")
    fm_give_item(id"weapon_usp")
    give_ammo(id1CSW_USP)
    give_ammo(id1CSW_USP)

    Set_PlayerModel(idModel_Player[random(sizeof(Model_Player))])
    
    
// Show Info
    static String[64]; formatex(Stringsizeof(String), "!g****[%s (%s)] by [%s]****!n"GAMENAMEVERSIONAUTHOR)
    client_printc(idString)
    
    
// Exec
    ExecuteForward(g_Forwards[FWD_EQUIP], g_fwResultid)
}

public 
fw_PlayerKilled_Post(VictimAttacker)
{
    
    
    
// Check Gameplay
    Check_Gameplay()
}

public 
fw_UseStationary(entitycalleractivatoruse_type)
{
    if (use_type == && is_alive(caller) && is_user_zombie(caller))
        return HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
fw_UseStationary_Post(entitycalleractivatoruse_type)
{
    if(use_type == && is_alive(caller) && is_user_zombie(caller))
    {
        /*
        // Reset Claws
        static Claw[64], Claw2[64];
        
        if(Get_BitVar(g_IsZombie, caller)) ArrayGetString(ZombieClawModel, g_ZombieClass[caller], Claw, sizeof(Claw))
        //else if(Get_BitVar(g_IsNightStalker, caller)) Claw = g_HiddenClawModel
        
        formatex(Claw2, sizeof(Claw2), "models/%s/%s", GAME_FOLDER, Claw)
        
        set_pev(caller, pev_viewmodel2, Claw2)
        set_pev(caller, pev_weaponmodel2, "")*/
    }
}

public 
fw_TouchWeapon(weaponid)
{
    if(!is_connected(id))
        return HAM_IGNORED
    
if(is_user_zombie(id))
        return HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
fw_PlayerTakeDamage(VictimInflictorAttackerFloat:DamageDamageBits)
{
    if(!g_GameStarted || g_GameEnded || !g_RoundStarted)
        return HAM_SUPERCEDE
    
if(Victim == Attacker || !is_connected(Attacker))
        return HAM_SUPERCEDE
    
    
return HAM_IGNORED
}

public 
fw_Ham_ResetMaxSpeed(id)
{
    return ( Get_BitVar(g_HasCustomSpeedid) ) ? HAM_SUPERCEDE HAM_IGNORED;
}
  

public Make_PlayerShake(id)
{
    static MSG; if(!MSGMSG get_user_msgid("ScreenShake")
    
    
if(!id) 
    
{
        message_begin(MSG_BROADCASTMSG)
        write_short(8<<12)
        write_short(5<<12)
        write_short(4<<12)
        message_end()
    } else {
        if(!is_user_connected(id))
            return
            
        message_begin
(MSG_BROADCASTMSG_id)
        write_short(8<<12)
        write_short(5<<12)
        write_short(4<<12)
        message_end()
    }
}

// ===================== MESSAGES ========================
// =======================================================
public Message_StatusIcon(msg_idmsg_destmsg_entity)
{
    static szMsg[8];
    get_msg_arg_string(2szMsg ,7)
    
    
if(equal(szMsg"buyzone") && get_msg_arg_int(1))
    {
        if(pev_valid(msg_entity) != PDATA_SAFE)
            return  PLUGIN_CONTINUE;
    
        set_pdata_int
(msg_entity235get_pdata_int(msg_entity235) & ~(1<<0))
        return PLUGIN_HANDLED;
    }
    
    
return PLUGIN_CONTINUE;
}

public 
Message_Health(msg_idmsg_destid)
{
    // Get player's health
    static health
    health 
get_user_health(id)
    
    
// Don't bother
    if(health 1) 
        
return
    
    
static Float:NewHealthRealHealthHealth
    
    NewHealth 
= (float(health) / float(g_MaxHealth[id])) * 100.0; 
    RealHealth 
floatround(NewHealth)
    Health clamp(RealHealth1255)

    set_msg_arg_int(1get_msg_argtype(1), Health)
}

public 
Message_ClCorpse()
{
    static idid get_msg_arg_int(12)
    set_msg_arg_string(1g_CustomPlayerModel[id])

    return PLUGIN_CONTINUE
}

// ====================== COMMAND ========================
// =======================================================
public CMD_JoinTeam(id)
{
    if(!Get_BitVar(g_Joinedid))
        return PLUGIN_CONTINUE
        
    
return PLUGIN_HANDLED
}

public 
CMD_NightVision(id)
{
    if(!Get_BitVar(g_Has_NightVisionid))
        return PLUGIN_HANDLED

    
if(!Get_BitVar(g_UsingNVGid)) set_user_nightvision(id110)
    else set_user_nightvision(id010)
    
    
return PLUGIN_HANDLED;
}

// ======================== OTHER ========================
// =======================================================
public Reset_Player(idNewPlayer)
{
    UnSet_BitVar(g_IsZombieid)
    UnSet_BitVar(g_Has_NightVisionid)
    UnSet_BitVar(g_UsingNVGid)
}

public 
Set_PlayerModel(id, const Model[])
{
    if(!is_connected(id))
        return false
    
    remove_task
(id+TASK_CHANGEMODEL)
    Set_BitVar(g_HasCustomModelid)
    
    copy
(g_CustomPlayerModel[id], charsmax(g_CustomPlayerModel[]), Model)
    
    
#if defined SET_MODELINDEX_OFFSET    
    new modelpath[32+(2*MODELNAME_MAXLENGTH)]
    formatex(modelpathcharsmax(modelpath), "models/player/%s/%s.mdl"ModelModel)
    g_CustomModelIndex[id] = engfunc(EngFunc_ModelIndexmodelpath)
    #endif
    
    
new currentmodel[MODELNAME_MAXLENGTH]
    fm_cs_get_user_model(idcurrentmodelcharsmax(currentmodel))
    
    
if (!equal(currentmodelModel))
        fm_cs_user_model_update(id+TASK_CHANGEMODEL)
    
    
return true;
}

public 
Reset_PlayerModel(id)
{
    if(!is_connected(id))
        return false;
    
    
// Player doesn't have a custom model, no need to reset
    if(!Get_BitVar(g_HasCustomModelid))
        return true;
    
    remove_task
(id+TASK_CHANGEMODEL)
    UnSet_BitVar(g_HasCustomModelid)
    fm_cs_reset_user_model(id)
    
    
return true;    
}

public 
Set_PlayerTeam(idCsTeams:Team)
{
    if(!is_connected(id))
        return
    
    
if(pev_valid(id) != PDATA_SAFE)
        return
    //if(cs_get_user_team(id) == Team)
    //    return

    // Remove previous team message task
    remove_task(id+TASK_TEAMMSG)
    
    
// Set team offset
    set_pdata_int(idOFFSET_CSTEAMS_:Team)
    
    
// Send message to update team?
    fm_user_team_update(id)    
}

public 
Set_PlayerSpeed(idFloat:SpeedBlockChange)
{
    if(!is_alive(id))
        return
        
    
if(BlockChangeSet_BitVar(g_HasCustomSpeedid)
    else UnSet_BitVar(g_HasCustomSpeedid)
        
    set_pev
(idpev_maxspeedSpeed)
}

public 
Reset_PlayerSpeed(id)
{
    if(!is_alive(id))
        return
        
    UnSet_BitVar
(g_HasCustomSpeedid)
    ExecuteHamB(Ham_CS_Player_ResetMaxSpeedid)
}

public 
give_ammo(idsilentCSWID)
{
    static AmountName[32]
        
    
switch(CSWID)
    {
        case CSW_P228: {Amount 13formatex(Namesizeof(Name), "357sig");}
        case CSW_SCOUT: {Amount 30formatex(Namesizeof(Name), "762nato");}
        case CSW_XM1014: {Amount 8formatex(Namesizeof(Name), "buckshot");}
        case CSW_MAC10: {Amount 12formatex(Namesizeof(Name), "45acp");}
        case CSW_AUG: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_ELITE: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_FIVESEVEN: {Amount 50formatex(Namesizeof(Name), "57mm");}
        case CSW_UMP45: {Amount 12formatex(Namesizeof(Name), "45acp");}
        case CSW_SG550: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_GALIL: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_FAMAS: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_USP: {Amount 12formatex(Namesizeof(Name), "45acp");}
        case CSW_GLOCK18: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_AWP: {Amount 10formatex(Namesizeof(Name), "338magnum");}
        case CSW_MP5NAVY: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_M249: {Amount 30formatex(Namesizeof(Name), "556natobox");}
        case CSW_M3: {Amount 8formatex(Namesizeof(Name), "buckshot");}
        case CSW_M4A1: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_TMP: {Amount 30formatex(Namesizeof(Name), "9mm");}
        case CSW_G3SG1: {Amount 30formatex(Namesizeof(Name), "762nato");}
        case CSW_DEAGLE: {Amount 7formatex(Namesizeof(Name), "50ae");}
        case CSW_SG552: {Amount 30formatex(Namesizeof(Name), "556nato");}
        case CSW_AK47: {Amount 30formatex(Namesizeof(Name), "762nato");}
        case CSW_P90: {Amount 50formatex(Namesizeof(Name), "57mm");}
    }
    
    
if(!silentemit_sound(idCHAN_ITEM"items/9mmclip1.wav"VOL_NORMATTN_NORM0PITCH_NORM)
    ExecuteHamB(Ham_GiveAmmoidAmountName254)
}

public 
Do_RandomSpawn(id)
{
    if (!g_PlayerSpawn_Count)
        return;    
    
    
static hullsp_indexi
    
    hull 
= (pev(idpev_flags) & FL_DUCKING) ? HULL_HEAD HULL_HUMAN
    sp_index 
random_num(0g_PlayerSpawn_Count 1)
    
    
for (sp_index 1/*no condition*/i++)
    {
        if(>= g_PlayerSpawn_Count0
        
        
if(is_hull_vacant(g_PlayerSpawn_Point[i], hull))
        {
            engfunc(EngFunc_SetOriginidg_PlayerSpawn_Point[i])
            break
        }

        if (== sp_index) break
    }
}

public 
Recheck_HumanPosition(Float:Origin[3])
{
    static Float:MyOrigin[3]
    for(new 0g_MaxPlayersi++)
    {
        if(!is_alive(i))
            continue
        if(is_user_zombie(i))
            continue
        pev(ipev_originMyOrigin)
        if(get_distance_f(OriginMyOrigin) > 480.0)
            continue
            
        Do_RandomSpawn
(i)
    }
}

public 
SetPlayerHealth(idHealthFullHealth)
{
    fm_set_user_health(idHealth)
    if(FullHealth) 
    
{
        g_MaxHealth[id] = Health
        set_pev
(idpev_max_healthfloat(Health))
    }
}

public 
Set_LightStart(id)
{
    static Light[2]; get_pcvar_string(g_Cvar_MapLightLight1)
    SetPlayerLight(idLight)
}

public 
End_Round(Float:EndTimeRoundDrawCsTeams:Team)
// RoundDraw: Draw or Team Win
// Team: 1 - T | 2 - CT
{
    if(g_GameEnded) return
    if(RoundDraw) 
    
{
        GM_TerminateRound(EndTimeWINSTATUS_DRAW)
        ExecuteForward(g_Forwards[FWD_GAME_END], g_fwResultCS_TEAM_UNASSIGNED)
    
        client_print
(0print_center"%L"LANG_DEFAULT"NOTICE_GAMESTART")
    } else {
        if(Team == CS_TEAM_T) 
        
{
            GM_TerminateRound(6.0WINSTATUS_TERRORIST)
            ExecuteForward(g_Forwards[FWD_GAME_END], g_fwResultCS_TEAM_T)
            
            PlaySound
(0Vox_WinBoss)
            
            set_hudmessage
(20000HUD_WIN_XHUD_WIN_Y06.06.00.01.5)
            show_hudmessage(0"%L"LANG_DEFAULT"NOTICE_WINZOMBIE")
        } else if(Team == CS_TEAM_CT) {
            
            GM_TerminateRound
(6.0WINSTATUS_CT)
            ExecuteForward(g_Forwards[FWD_GAME_END], g_fwResultCS_TEAM_CT)
            
            PlaySound
(0Vox_WinHuman)
        
            set_hudmessage
(02000HUD_WIN_XHUD_WIN_Y06.06.00.01.5)
            show_hudmessage(0"%L"LANG_DEFAULT"NOTICE_WINHUMAN")
        }
    }
    
    g_GameEnded 
1
    Event_RoundEnd
()
}

public 
is_user_zombie(id)
{
    if(!is_connected(id))
        return 0
    
    
return Get_BitVar(g_IsZombieid) ? 0
}

stock Get_ZombieAlive()
{
    new Count
    
for(new 0g_MaxPlayersi++)
    {
        if(!is_connected(i))
            continue
        if(is_alive(i) && is_user_zombie(i))
            Count++
    }
    
    
return Count
}

stock SetPlayerLight(id, const LightStyle[])
{
    if(id != 0)
    {
        message_begin(MSG_ONE_UNRELIABLESVC_LIGHTSTYLE, .player id)
        write_byte(0)
        write_string(LightStyle)
        message_end()        
    
} else {
        message_begin(MSG_BROADCASTSVC_LIGHTSTYLE)
        write_byte(0)
        write_string(LightStyle)
        message_end()    
    
}
}

stock Get_PlayerCount(AliveTeam)
// Alive: 0 - Dead | 1 - Alive | 2 - Both
// Team: 1 - T | 2 - CT
{
    new Flag[4], Flag2[12]
    new Players[32], PlayerNum

    
if(!Aliveformatex(Flagsizeof(Flag), "%sb"Flag)
    else if(Alive == 1formatex(Flagsizeof(Flag), "%sa"Flag)
    
    
if(Team == 1) 
    
{
        formatex(Flagsizeof(Flag), "%se"Flag)
        formatex(Flag2sizeof(Flag2), "TERRORIST"Flag)
    } else if(Team == 2) 
    
{
        formatex(Flagsizeof(Flag), "%se"Flag)
        formatex(Flag2sizeof(Flag2), "CT"Flag)
    }
    
    get_players
(PlayersPlayerNumFlagFlag2)
    
    
return PlayerNum
}

stock Get_TotalInPlayer(Alive)
{
    return Get_PlayerCount(Alive1) + Get_PlayerCount(Alive2)
}

stock is_hull_vacant(Float:Origin[3], hull)
{
    engfunc(EngFunc_TraceHullOriginOrigin0hull00)
    
    
if (!get_tr2(0TR_StartSolid) && !get_tr2(0TR_AllSolid) && get_tr2(0TR_InOpen))
        return true
    
    
return false
}

stock collect_spawns_ent(const classname[])
{
    static entent = -1
    
while ((ent engfunc(EngFunc_FindEntityByStringent"classname"classname)) != 0)
    {
        // get origin
        static Float:originF[3]
        pev(entpev_originoriginF)
        
        g_PlayerSpawn_Point
[g_PlayerSpawn_Count][0] = originF[0]
        g_PlayerSpawn_Point[g_PlayerSpawn_Count][1] = originF[1]
        g_PlayerSpawn_Point[g_PlayerSpawn_Count][2] = originF[2]
        
        
// increase spawn count
        g_PlayerSpawn_Count++
        if(g_PlayerSpawn_Count >= sizeof g_PlayerSpawn_Point) break;
    }
}

stock collect_spawns_ent2(const classname[])
{
    static entent = -1
    
while ((ent engfunc(EngFunc_FindEntityByStringent"classname"classname)) != 0)
    {
        // get origin
        static Float:originF[3]
        pev(entpev_originoriginF)
        
        g_BossSpawn_Point
[g_BossSpawn_Count][0] = originF[0]
        g_BossSpawn_Point[g_BossSpawn_Count][1] = originF[1]
        g_BossSpawn_Point[g_BossSpawn_Count][2] = originF[2]
        
        
// increase spawn count
        g_BossSpawn_Count++
        if(g_BossSpawn_Count >= sizeof g_BossSpawn_Point) break;
    }
}

stock Get_RandomArray(Array:ArrayName)
{
    return random_num(0ArraySize(ArrayName) - 1)
}

stock PlaySound(id, const sound[])
{
    if(equal(sound[strlen(sound)-4], ".mp3")) client_cmd(id"mp3 play ^"sound/%s^""sound)
    else client_cmd(id"spk ^"%s^""sound)
}

stock StopSound(idclient_cmd(id"mp3 stop; stopsound")
stock EmitSound(idChannel, const Sound[]) emit_sound(idChannelSoundVOL_NORMATTN_NORM0PITCH_NORM)
stock client_printc(index, const text[], any:...)
{
    static szMsg[128]; vformat(szMsgsizeof(szMsg) - 1text3)

    replace_all(szMsgsizeof(szMsg) - 1"!g""^x04")
    replace_all(szMsgsizeof(szMsg) - 1"!n""^x01")
    replace_all(szMsgsizeof(szMsg) - 1"!t""^x03")

    if(!index)
    {
        for(new 0g_MaxPlayersi++)
        {
            if(!is_connected(i))
                continue
                
            message_begin
(MSG_ONE_UNRELIABLEg_MsgSayText_i);
            write_byte(i);
            write_string(szMsg);
            message_end();    
        
}        
    
} else {
        message_begin(MSG_ONE_UNRELIABLEg_MsgSayText_index);
        write_byte(index);
        write_string(szMsg);
        message_end();
    }
}
 

public fm_cs_set_user_model(taskid)
{
    static idid taskid TASK_CHANGEMODEL
    set_user_info
(id"model"g_CustomPlayerModel[id])
}

stock fm_cs_set_user_model_index(id)
{
    if (pev_valid(id) != PDATA_SAFE)
        return;
    
    set_pdata_int
(idOFFSET_MODELINDEXg_CustomModelIndex[id])
}

stock fm_cs_reset_user_model_index(id)
{
    if (pev_valid(id) != PDATA_SAFE)
        return;
    
    
switch(cs_get_user_team(id))
    {
        case CS_TEAM_Tset_pdata_int(idOFFSET_MODELINDEXengfunc(EngFunc_ModelIndexDEFAULT_MODELINDEX_T))
        case CS_TEAM_CTset_pdata_int(idOFFSET_MODELINDEXengfunc(EngFunc_ModelIndexDEFAULT_MODELINDEX_CT))
    }
}

stock fm_cs_get_user_model(idmodel[], len)
{
    get_user_info(id"model"modellen)
}

stock fm_cs_reset_user_model(id)
{
    // Set some generic model and let CS automatically reset player model to default
    copy(g_CustomPlayerModel[id], charsmax(g_CustomPlayerModel[]), "gordon")
    fm_cs_user_model_update(id+TASK_CHANGEMODEL)
#if defined SET_MODELINDEX_OFFSET
    fm_cs_reset_user_model_index(id)
#endif
}

stock fm_cs_user_model_update(taskid)
{
    new Float:current_time
    current_time 
get_gametime()
    
    
if(current_time g_ModelChangeTargetTime >= MODELCHANGE_DELAY)
    {
        fm_cs_set_user_model(taskid)
        g_ModelChangeTargetTime current_time
    
} else {
        set_task((g_ModelChangeTargetTime MODELCHANGE_DELAY) - current_time"fm_cs_set_user_model"taskid)
        g_ModelChangeTargetTime g_ModelChangeTargetTime MODELCHANGE_DELAY
    
}
}


// Send User Team Message (Note: this next message can be received by other plugins)
public fm_cs_set_user_team_msg(taskid)
{
    // Tell everyone my new team
    emessage_begin(MSG_ALLg_MsgTeamInfo)
    ewrite_byte(ID_TEAMMSG// player
    ewrite_string(CS_TEAM_NAMES[_:cs_get_user_team(ID_TEAMMSG)]) // team
    emessage_end()
    
    
// Fix for AMXX/CZ bots which update team paramater from ScoreInfo message
    emessage_begin(MSG_BROADCASTg_MsgScoreInfo)
    ewrite_byte(ID_TEAMMSG// id
    ewrite_short(pev(ID_TEAMMSGpev_frags)) // frags
    ewrite_short(cs_get_user_deaths(ID_TEAMMSG)) // deaths
    ewrite_short(0// class?
    ewrite_short(_:cs_get_user_team(ID_TEAMMSG)) // team
    emessage_end()
}

// Update Player's Team on all clients (adding needed delays)
stock fm_user_team_update(id)
{
    
    
new Float:current_time
    current_time 
get_gametime()
    
    
if (current_time g_TeamMsgTargetTime >= TEAMCHANGE_DELAY)
    {
        set_task(0.1"fm_cs_set_user_team_msg"id+TASK_TEAMMSG)
        g_TeamMsgTargetTime current_time TEAMCHANGE_DELAY
    
}
    else
    {
        set_task((g_TeamMsgTargetTime TEAMCHANGE_DELAY) - current_time"fm_cs_set_user_team_msg"id+TASK_TEAMMSG)
        g_TeamMsgTargetTime g_TeamMsgTargetTime TEAMCHANGE_DELAY
    
}
}


/* ===============================
------------- SAFETY -------------
=================================*/
public Register_SafetyFunc()
{
    register_event("CurWeapon""Safety_CurWeapon""be""1=1")
    
    RegisterHam
(Ham_Spawn"player""fw_Safety_Spawn_Post"1)
    RegisterHam(Ham_Killed"player""fw_Safety_Killed_Post"1)
}

public 
Register_SafetyFuncBot(id)
{
    RegisterHamFromEntity(Ham_Spawnid"fw_Safety_Spawn_Post"1)
    RegisterHamFromEntity(Ham_Killedid"fw_Safety_Killed_Post"1)
}

public 
Safety_Connected(id)
{
    Set_BitVar(g_IsConnectedid)
    UnSet_BitVar(g_IsAliveid)
    
    g_PlayerWeapon
[id] = 0
}

public 
Safety_Disconnected(id)
{
    UnSet_BitVar(g_IsConnectedid)
    UnSet_BitVar(g_IsAliveid)
    
    g_PlayerWeapon
[id] = 0
}

public 
Safety_CurWeapon(id)
{
    if(!is_alive(id))
        return
        
    
static CSWCSW read_data(2)
    if(g_PlayerWeapon[id] != CSWg_PlayerWeapon[id] = CSW
}

public 
fw_Safety_Spawn_Post(id)
{
    if(!is_user_alive(id))
        return
        
    Set_BitVar
(g_IsAliveid)
}

public 
fw_Safety_Killed_Post(id)
{
    UnSet_BitVar(g_IsAliveid)
}

public 
is_connected(id)
{
    if(!(<= id <= 32))
        return 0
    
if(!Get_BitVar(g_IsConnectedid))
        return 0

    
return 1
}

public 
is_alive(id)
{
    if(!is_connected(id))
        return 0
    
if(!Get_BitVar(g_IsAliveid))
        return 0
        
    
return 1
}

public 
get_player_weapon(id)
{
    if(!is_alive(id))
        return 0
    
    
return g_PlayerWeapon[id]
}

/* ===============================
--------- END OF SAFETY  ---------
=================================*/ 
çalışmama sebebi csduragında moduleleri kullanıcılar yükleyemiyor başka bir forumdada reapiye dönüştürülürse çalışılacagı yazılmış ve çözülmüş isteklere taşınmıs


#5
@Arge Hmm Anladim Ama Onu Reapie Donusturcek ADam O Kutuphaneyi Baya İyi Bİlmesi Lazim Ve Ben O Kutuphaneyi Cok Az Biliyorum



#7
Yinede teşekkürler


#9
(11-10-2017, Saat: 22:50)!berk! Adlı Kullanıcıdan Alıntı: @AKINCI İnsallah Ogrenicegim
@Arge Ben Degil Ama Bunu Yapabilecek Cek Fena Koderler Var Forumumuzda @By.Dehset @Anil Can @Krito @ penguen
o zaman onları bekleyelim illaki vardır yapabilen Gülmekten Ölüyorum




Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
Silinmiş Konu   | (Reapi) Haritaya göre Oyun Adı Değiştirme (GameNameChangerMaps) SKYNLEXX* 8 477 01-04-2019, Saat: 09:39
Son Yorum: MawiLarq
Silinmiş Konu   | [REAPI] VTC Fonksiyonları amad.trgg 9 594 11-08-2018, Saat: 16:34
Son Yorum: ITenGriTR

Task