I see you edited your post, that were some good models but whatever.
I had the same idea some time ago but i stopped working on it early because of the goldsrc limitations. The scripting part ain't big deal but what i stumbled on is the map design and things as models 'n stuff. It's just a lot of work and doesn't really worth it after all in my opinion but i'm willing to help if you can at least create one complete map.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <xs>
new const PluginAuthor[] = "Icebeam"
#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)));
#define HUD_HIDE_RHA (1<<3)
#define HUD_HIDE_TIMER (1<<4)
#define HUD_HIDE_MONEY (1<<5)
stock const INGAME_JOIN_MSG_SPEC[] = "#IG_Team_Select_Spect"
const iMaxLen = sizeof(INGAME_JOIN_MSG_SPEC);
new gBitAlive
new CTCount, TCount, g_MaxPlayers, g_MsgShowMenu, g_MsgScreenFade, g_msgHideWeapon, g_msgBarTime
new g_IsKiller, g_IsSurvivor
new Float:gflLauchGameTime[32 + 1];
new Float:gflTimeToReachPosition;
new Float:gfPlayerViewAngles[32 + 1][3]
new g_GameStart, g_RoundEnd, g_HuntingStart
new g_SyncHudGameInfo;
public plugin_init()
{
register_plugin("Dead By Daylight [ENGINE]", "1.0", PluginAuthor);
register_clcmd("say /startgame", "Players_Ready_Check");
register_clcmd("chooseteam", "Jointeam")
register_clcmd("jointeam", "Jointeam")
register_clcmd("joinclass", "Jointeam")
RegisterHam(Ham_Spawn, "player", "Player_Spawn", 1)
// RegisterHam(Ham_Player_Jump, "player", "Player_Jump")
register_forward(FM_GetGameDescription, "Game_Description");
register_think("PlayerCamera", "Rotating_Cam_Think");
register_message(get_user_msgid("ShowMenu"), "Message_ShowMenu")
register_message(get_user_msgid("VGUIMenu"), "Message_VGUIMenu")
register_message(get_user_msgid("HideWeapon"), "Message_HideWeapon")
register_message(get_user_msgid("MOTD"), "Message_MOTD");
g_MaxPlayers = get_maxplayers()
g_MsgShowMenu = get_user_msgid("ShowMenu");
g_MsgScreenFade = get_user_msgid("ScreenFade")
g_msgHideWeapon = get_user_msgid("HideWeapon")
g_msgBarTime = get_user_msgid("BarTime")
register_event("ResetHUD", "Reset_HUD", "b")
g_SyncHudGameInfo = CreateHudSyncObj();
// [ GOLDEN EYE ]
gflTimeToReachPosition = ((1.5 * 3.14) / (2 * 1.41));
}
public client_putinserver(id)
{
}
public plugin_precache()
{
create_entity( "env_rain" );
new iEntity = create_entity("env_fog");
DispatchKeyValue(iEntity, "density", "0.009");
DispatchKeyValue(iEntity, "rendercolor", "128 128 128");
/*
iEntity = create_entity("ambient_generic");
entity_set_float(iEntity, EV_FL_health, 10.0);
entity_set_string(iEntity, EV_SZ_message, "ambience/rain.wav");
entity_set_int(iEntity, EV_INT_spawnflags, (1 << 0));
DispatchSpawn(iEntity);
*/
}
public plugin_cfg()
{
server_cmd("sv_maxspeed 999.9")
server_cmd("sv_velocity 999.9")
server_cmd("sv_airaccelerate 10.0")
server_cmd("sv_buytime 9999.9")
server_cmd("mp_freezetime 0")
server_cmd("mp_timelimit 0")
server_cmd("mp_flashlights 1")
server_cmd("mp_roundtime 0")
server_cmd("mp_footsteps 0")
server_cmd("mp_round_infinite 1")
server_cmd("sv_alltalk 1")
set_cvar_num("mp_autokick", 0);
set_cvar_string("sv_skyname", "DrkG")
}
public client_disconnected(id)
{
UnSet_BitVar(g_IsKiller, id)
UnSet_BitVar(g_IsSurvivor, id)
}
public Game_Description()
{
static szGameName[32];
format(szGameName, charsmax(szGameName), "Dead By Daylight(beta)");
forward_return(FMV_STRING, szGameName);
return FMRES_SUPERCEDE;
}
public Players_Ready_Check()
{
g_HuntingStart = 0
set_hudmessage(0, 255, 0, 0.06, 0.63, 1, 1.0, 1.1, 0.2, 0.2, 3)
ShowSyncHudMsg(0, g_SyncHudGameInfo, "Game will be started in 5 seconds...");
set_task(5.0, "Start_Game");
}
public Start_Game()
{
g_HuntingStart = 1
client_print(0, print_chat, "Game Started");
for(new i = 0; i < g_MaxPlayers; i++)
{
set_dhudmessage(128, 128, 128, 0.05, 0.65, 0, 0.0, 6.0, 2.0, 1.0);
show_dhudmessage(i, " Dead by Daylight^n_______________^n Shelter Woods");
if(is_user_survivor(i))
{
PlayerRespawn(i)
SurvivorStuff(i)
}
if(is_user_killer(i))
{
PlayerRespawn(i)
KillerStuff(i)
}
}
}
public Player_Spawn(id)
{
if(!is_user_connected(id) || !is_user_alive(id)) return;
switch(cs_get_user_team(id))
{
case CS_TEAM_T : set_task(0.3, "KillerStuff", id)
case CS_TEAM_CT : set_task(0.3, "SurvivorStuff", id)
}
}
/*
public Player_Jump(id)
{
static iOldbuttons ; iOldbuttons = entity_get_int(id, EV_INT_oldbuttons)
if(!(iOldbuttons & IN_JUMP))
{
entity_set_int(id, EV_INT_oldbuttons, iOldbuttons | IN_JUMP)
return HAM_HANDLED
}
return HAM_IGNORED
}
*/
/* Gameplay Stuff */
public KillerStuff(id)
{
Set_BitVar(g_IsKiller, id)
if(!g_HuntingStart)
{
strip_user_weapons(id);
set_task(0.01, "Set_LightStart", id)
}
else
{
give_item(id, "weapon_knife")
engfunc(EngFunc_SetClientMaxspeed, id, 250.0)
PlayerScreenFade(id)
set_task(2.5, "PlayerScreenRotate", id)
}
cs_set_user_money(id, 0);
set_user_footsteps(id, 1)
set_user_godmode(id, 1)
//cs_set_user_model(id, "slenderman")
}
public SurvivorStuff(id)
{
Set_BitVar(g_IsSurvivor, id)
if(!g_HuntingStart)
{
set_task(0.01, "Set_LightStart", id)
}
else
{
PlayerScreenFade(id)
set_task(2.5, "PlayerScreenRotate", id)
}
strip_user_weapons(id);
cs_set_user_money(id, 0);
set_user_footsteps(id, 0)
set_user_godmode(id, 0)
cs_set_user_model(id, "gsg9")
}
public Rotating_Cam_Think(iEnt)
{
static iOwner;
iOwner = entity_get_edict(iEnt, EV_ENT_owner);
if (!is_user_alive(iOwner))
{
remove_entity(iEnt);
return PLUGIN_CONTINUE;
}
static Float:flOriginCamera[3], Float:flOriginPlayer[3], Float:flVelocity[3], Float:flAddVelocity[3], Float:flOffset[3], iHeightCheck;
entity_get_vector(iEnt, EV_VEC_origin, flOriginCamera);
flOffset[0] = 10.0;
get_offset_origin(iOwner, flOffset, flOriginPlayer);
if(floatsqroot(floatpower((flOriginPlayer[0] - flOriginCamera[0]), 2.0) + floatpower((flOriginPlayer[1] - flOriginCamera[1]), 2.0)) <= 10.0)
{
remove_entity(iEnt);
attach_view(iOwner, iOwner);
return PLUGIN_CONTINUE;
}
flVelocity[0] = ((flOriginCamera[1] - flOriginPlayer[1]) * 0.5);
flVelocity[1] = ((flOriginPlayer[0] - flOriginCamera[0]) * 0.5);
entity_get_vector(iEnt, EV_VEC_velocity, flAddVelocity);
flAddVelocity[0] = flAddVelocity[1] = 0.0;
if(!(iHeightCheck = (-0.25 <= (flOriginCamera[2] - (flOriginPlayer[2] + 18.0)) <= 0.25 )) && (flAddVelocity[2] == 0.0))
{
flAddVelocity[2] = ((flOriginPlayer[2] - flOriginCamera[2]) * 0.5);
xs_vec_add(flVelocity, flAddVelocity, flVelocity);
}
else if(iHeightCheck)
{
flVelocity[2] = 0.0;
}
flAddVelocity[2] = 0.0;
if (gflLauchGameTime[iOwner] <= get_gametime())
{
flAddVelocity[0] = ((flOriginPlayer[0] - flOriginCamera[0]) * 0.5);
flAddVelocity[1] = ((flOriginPlayer[1] - flOriginCamera[1]) * 0.5);
xs_vec_add(flVelocity, flAddVelocity, flVelocity);
}
entity_set_vector(iEnt, EV_VEC_velocity, flVelocity);
flOriginPlayer[2] += 18.0;
entity_set_aim(iEnt, flOriginCamera, flOriginPlayer);
entity_set_float(iEnt, EV_FL_nextthink, get_gametime());
return PLUGIN_CONTINUE;
}
public Message_MOTD(msgid, dest, id)
{
if(get_msg_arg_int(1) == 1)
{
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public Message_ShowMenu(iMsgid, iDest, id)
{
static sMenuCode[iMaxLen];
get_msg_arg_string(4, sMenuCode, sizeof(sMenuCode) - 1)
if(equal(sMenuCode, "#Team_Select") || equal(sMenuCode, "#Team_Select_Spect"))
{
Show_Team_Menu(id)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE;
}
public Message_VGUIMenu(iMsgid, iDest, id)
{
if(get_msg_arg_int(1) != 2)
{
return PLUGIN_CONTINUE;
}
Show_Team_Menu(id)
return PLUGIN_HANDLED;
}
public Show_Team_Menu(id)
{
static menu
menu = menu_create("Dead by Daylight^n\dsteamcommunity.com/id/_icebeam^n", "Team_Choice")
if(TCount < 1)
{
menu_additem(menu, "\rPlay as Killer", "1", 0)
}
else
menu_additem(menu, "\dPlay as Killer (Already Selected)", "1", 1<<31)
menu_additem(menu, "\yPlay as Survivor", "2", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER);
menu_display(id, menu)
return PLUGIN_HANDLED
}
public Team_Choice(id, menu, item)
{
static dst[32], data[5], access, callback
static restore, vgui, msgblock
restore = get_pdata_int(id, 510)
vgui = restore & (1<<0)
if(vgui)
{
set_pdata_int(id, 510, restore & ~(1<<0))
}
menu_item_getinfo(menu, item, access, data, charsmax(data), dst, charsmax(dst), callback)
menu_destroy(menu)
switch(data[0])
{
case('1'):
{
Count_Teams()
if(TCount < 1)
{
msgblock = get_msg_block(g_MsgShowMenu)
set_msg_block(g_MsgShowMenu, BLOCK_ONCE)
engclient_cmd(id, "jointeam", "1")
engclient_cmd(id, "joinclass", "1")
set_msg_block(g_MsgShowMenu, msgblock)
client_print(0, print_chat, "you are a killer!")
}
else
{
msgblock = get_msg_block(g_MsgShowMenu)
set_msg_block(g_MsgShowMenu, BLOCK_ONCE)
engclient_cmd(id, "jointeam", "2")
engclient_cmd(id, "joinclass", "2")
set_msg_block(g_MsgShowMenu, msgblock)
client_print(0, print_chat, "already a killer!")
}
}
case('2'):
{
msgblock = get_msg_block(g_MsgShowMenu)
set_msg_block(g_MsgShowMenu, BLOCK_ONCE)
engclient_cmd(id, "jointeam", "2")
engclient_cmd(id, "joinclass", "2")
set_msg_block(g_MsgShowMenu, msgblock)
client_print(0, print_chat, "you are a survivor!")
}
}
if(vgui)
{
set_pdata_int(id, 510, restore)
}
return PLUGIN_HANDLED
}
public Count_Teams()
{
CTCount = 0
TCount = 0
new Players[32]
new playerCount, i
get_players(Players, playerCount, "")
for(i=0; i < playerCount; i++)
{
if(is_user_connected(Players[i]))
{
if(cs_get_user_team(Players[i]) == CS_TEAM_CT) CTCount++
if(cs_get_user_team(Players[i]) == CS_TEAM_T) TCount++
}
}
}
public Jointeam(id) return PLUGIN_HANDLED;
public PlayerRespawn(id) ExecuteHamB(Ham_CS_RoundRespawn, id);
public Reset_HUD(id)
{
new iHideFlags = GetHudHideFlags()
if(iHideFlags)
{
message_begin(MSG_ONE, g_msgHideWeapon, _, id)
write_byte(iHideFlags)
message_end()
}
}
public Message_HideWeapon()
{
new iHideFlags = GetHudHideFlags()
if(iHideFlags)
set_msg_arg_int(1, ARG_BYTE, get_msg_arg_int(1) | iHideFlags)
}
GetHudHideFlags()
{
new iFlags
iFlags |= HUD_HIDE_RHA
iFlags |= HUD_HIDE_TIMER
iFlags |= HUD_HIDE_MONEY
return iFlags
}
public PlayerScreenRotate(id)
{
gflLauchGameTime[id] = (get_gametime() + gflTimeToReachPosition);
new iEnt = create_entity("info_target");
if(is_valid_ent(iEnt))
{
new Float:flOrigin[3], Float:flOffset[3];
flOffset[1] = 75.0;
flOffset[2] = 25.0;
entity_set_string(iEnt, EV_SZ_classname, "PlayerCamera");
entity_set_model(iEnt, "models/w_usp.mdl");
entity_set_byte(iEnt, EV_INT_solid, SOLID_NOT);
entity_set_int(iEnt, EV_INT_movetype, MOVETYPE_NOCLIP);
entity_set_edict(iEnt, EV_ENT_owner, id);
get_offset_origin(id, flOffset, flOrigin);
entity_set_vector(iEnt, EV_VEC_origin, flOrigin);
entity_set_int(iEnt, EV_INT_rendermode, kRenderTransTexture);
entity_set_float(iEnt, EV_FL_renderamt, 0.0);
attach_view(id, iEnt);
entity_set_float(iEnt, EV_FL_nextthink, get_gametime());
}
set_task(8.0, "PlayerResetSpeed", id);
}
public PlayerScreenFade(id)
{
message_begin(MSG_ONE_UNRELIABLE, g_MsgScreenFade, {0,0,0}, id)
write_short(FixedUnsigned16(2.5, 1<<12))
write_short(FixedUnsigned16(2.5, 1<<12))
write_short((0x0000))
write_byte(0)
write_byte(0)
write_byte(0)
write_byte(255)
message_end()
SetPlayerLight(id, "b")
set_pev(id, pev_maxspeed, 1.0)
}
public PlayerResetSpeed(id)
{
switch(cs_get_user_team(id))
{
case CS_TEAM_T : engfunc(EngFunc_SetClientMaxspeed, id, 130.0)
case CS_TEAM_CT : engfunc(EngFunc_SetClientMaxspeed, id, 150.0)
}
}
public is_user_killer(id) return Get_BitVar(g_IsKiller, id)
public is_user_survivor(id) return Get_BitVar(g_IsSurvivor, id)
// test map light
public Set_LightStart(id)
{
SetPlayerLight(id, "h")
set_lights("b")
}
stock SetPlayerLight(id, const LightStyle[])
{
if(id != 0)
{
message_begin(MSG_ONE_UNRELIABLE, SVC_LIGHTSTYLE, .player = id)
write_byte(0)
write_string(LightStyle)
message_end()
} else {
message_begin(MSG_BROADCAST, SVC_LIGHTSTYLE)
write_byte(0)
write_string(LightStyle)
message_end()
}
}
stock FixedUnsigned16(Float:flValue, iScale)
{
new iOutput;
iOutput = floatround(flValue * iScale);
if ( iOutput < 0 )
iOutput = 0;
if ( iOutput > 0xFFFF )
iOutput = 0xFFFF;
return iOutput;
}
get_offset_origin( iEnt, const Float:flOffset[ 3 ], Float:flOrigin[ 3 ] )
{
if ( is_valid_ent( iEnt ) )
{
new Float:flAngle[ 3 ];
entity_get_vector( iEnt, EV_VEC_origin, flOrigin );
entity_get_vector( iEnt, EV_VEC_angles, flAngle );
flOrigin[ 0 ] += floatcos( flAngle[ 1 ], degrees ) * flOffset[ 0 ];
flOrigin[ 1 ] += floatsin( flAngle[ 1 ], degrees ) * flOffset[ 0 ];
flOrigin[ 2 ] += floatsin( flAngle[ 0 ], degrees ) * flOffset[ 0 ];
flOrigin[ 0 ] += floatcos( flAngle[ 0 ], degrees ) * flOffset[ 0 ];
flOrigin[ 1 ] += floatcos( flAngle[ 1 ], degrees ) * flOffset[ 1 ];
flOrigin[ 0 ] -= floatsin( flAngle[ 1 ], degrees ) * flOffset[ 1 ];
flOrigin[ 2 ] += floatsin( flAngle[ 2 ], degrees ) * flOffset[ 1 ];
flOrigin[ 1 ] += floatcos( flAngle[ 2 ], degrees ) * flOffset[ 1 ];
flOrigin[ 2 ] += floatcos( flAngle[ 2 ], degrees ) * flOffset[ 2 ];
flOrigin[ 1 ] -= floatsin( flAngle[ 2 ], degrees ) * flOffset[ 2 ];
flOrigin[ 2 ] += floatcos( flAngle[ 0 ], degrees ) * flOffset[ 2 ];
flOrigin[ 0 ] -= floatsin( flAngle[ 0 ], degrees ) * flOffset[ 2 ];
flOrigin[ 0 ] -= flOffset[ 0 ];
flOrigin[ 1 ] -= flOffset[ 1 ];
flOrigin[ 2 ] -= flOffset[ 2 ];
}
}
entity_set_aim( iEnt, const Float:flEntOrigin[ 3 ], const Float:flOrigin2[ 3 ] )
{
if ( is_valid_ent( iEnt ) )
{
static Float:flOrigin[ 3 ], Float:flVectorLength, Float:flAimVector[ 3 ], Float:flNewAngles[ 3 ];
flOrigin[ 0 ] = flOrigin2[ 0 ];
flOrigin[ 1 ] = flOrigin2[ 1 ];
flOrigin[ 2 ] = flOrigin2[ 2 ];
flOrigin[ 0 ] -= flEntOrigin[ 0 ];
flOrigin[ 1 ] -= flEntOrigin[ 1 ];
flOrigin[ 2 ] -= flEntOrigin[ 2 ];
flVectorLength = vector_length( flOrigin );
flAimVector[ 0 ] = flOrigin[ 0 ] / flVectorLength;
flAimVector[ 1 ] = flOrigin[ 1 ] / flVectorLength;
flAimVector[ 2 ] = flOrigin[ 2 ] / flVectorLength;
vector_to_angle( flAimVector, flNewAngles );
flNewAngles[ 0 ] *= -1;
if ( flNewAngles[ 1 ] > 180.0 )
{
flNewAngles[ 1 ] -= 360;
}
if ( flNewAngles[ 1 ] < -180.0 )
{
flNewAngles[ 1 ] += 360;
}
if ( flNewAngles[ 1 ] == 180.0 || flNewAngles[ 1 ] == -180.0 )
{
flNewAngles[ 1 ] = -179.999999;
}
entity_set_vector( iEnt, EV_VEC_angles, flNewAngles );
entity_set_int( iEnt, EV_INT_fixangle, 1 );
}
}