Member
Join Date: Jul 2014
Location: China
|
10-29-2016
, 09:58
Re: [CSGO]This is the model error or plug-in error?
|
#3
|
I successfully repaired it .
PHP Code:
/****************************************************
ANY THING TO DO WITH THE MENU IS PUT INTO THIS FILE!
****************************************************/
new Handle:MainMenu = INVALID_HANDLE;
new Handle:HumanSkinsMenu = INVALID_HANDLE;
new Handle:ZombieSkinsMenu = INVALID_HANDLE;
new Handle:AmbienceMenu = INVALID_HANDLE;
new String:human_skin[MAXPLAYERS+1];
new String:zombie_skin[MAXPLAYERS+1];
new String:zombie_chose[MAXPLAYERS+1];
new String:human_chose[MAXPLAYERS+1];
new String:Ambience_enabled[MAXPLAYERS+1];
void Precache()
{
PrecacheModel("models/player/zh/zh_zombie003.mdl"); //
PrecacheModel("models/player/avp/csgo_predator.mdl"); //
PrecacheModel("models/player/monster/grim/grim.mdl"); //
PrecacheModel("models/player/monster/witch/witch.mdl"); //
PrecacheModel("models/player/deathstroke/deathstroke.mdl"); //
PrecacheModel("models/player/resident/sheva_alomar/sheva_alomar.mdl"); //
PrecacheModel("models/player/resident/sherry6/sherry6.mdl"); //
PrecacheModel("models/player/kuristaja/duke/duke.mdl"); //
PrecacheModel("models/player/resident/piers6/piers6.mdl"); //
PrecacheModel("models/player/resident/helena6/helena6.mdl"); //
PrecacheModel("models/player/deathstroke/deathstroke2.mdl"); //
PrecacheModel("models/player/kuristaja/re6/ada/adav2.mdl"); //
}
// Perks
//static const String:ctperks[3][] = {"Citizen","Burned","Corpse"};
//static const String:tperks[3][] = {"none","Infected","Marked","Respawn","Speed"};
// Names of the skins
static const String:ctskins[8][] = {"Death Stroke","Sheva Alomar","Sherry Birkin","Duke Nukem","Piers Nivans","Helena Harper","Solid Snake","Ada Wong"};
static const String:tskins[4][] = {"Csgo_Zombie","Csgo_Predator","Grim","Witch"};
// mdl file locations for the skins
static const String:tmodels[4][] = {"models/player/zh/zh_zombie003.mdl","models/player/avp/csgo_predator.mdl","models/player/monster/grim/grim.mdl","models/player/monster/witch/witch.mdl"};
static const String:ctmodels[8][] = {"models/player/deathstroke/deathstroke.mdl","models/player/resident/sheva_alomar/sheva_alomar.mdl","models/player/resident/sherry6/sherry6.mdl","models/player/kuristaja/duke/duke.mdl","models/player/resident/piers6/piers6.mdl","models/player/resident/helena6/helena6.mdl","models/player/deathstroke/deathstroke2.mdl","models/player/kuristaja/re6/ada/adav2.mdl"};
public Action:zhrmenustart(Handle:timer)
{
MainMenu = CreateMenu(MainMenuHandler1);
SetMenuTitle(MainMenu, "ZHR Menu");
AddMenuItem(MainMenu, "hskins", "Human Skins");
AddMenuItem(MainMenu, "zskins", "Zombie Skins");
AddMenuItem(MainMenu, "sounds", "Ambience");
// AddMenuItem(MainMenu, "hperks", "Human Perks");
// AddMenuItem(MainMenu, "zperks", "Zombie Perks");
// Human skins menu
HumanSkinsMenu = CreateMenu(HSkinMenuHandler2);
SetMenuTitle(HumanSkinsMenu, "Choose your skin");
for (new i = 0; i < 8; i++)
AddMenuItem(HumanSkinsMenu, ctskins[i], ctskins[i]);
// Zombie skins menu
ZombieSkinsMenu = CreateMenu(ZSkinMenuHandler2);
SetMenuTitle(ZombieSkinsMenu, "Choose your skin");
for (new i = 0; i < 4; i++)
AddMenuItem(ZombieSkinsMenu, tskins[i], tskins[i]);
/*
// Human perks
HumanPerksMenu = CreateMenu(HPerksMenuHandler3);
SetMenuTitle(HumanperksMenu, "Choose your Perk");
// zombie perks
ZombiePerksMenu = CreateMenu(ZPerksMenuHandler3);
SetMenuTitle(ZombieperksMenu, "Choose your Perk");
*/
// sounds menu
AmbienceMenu = CreateMenu(AmbienceMenuHandler4);
SetMenuTitle(AmbienceMenu, "Ambience Menu");
AddMenuItem(AmbienceMenu, "on", "On");
AddMenuItem(AmbienceMenu, "off", "Off");
// Hooks to do with menu
HookEvent("player_spawn", Menuspawn);
RegConsoleCmd("sm_zhr", zhr);
}
// Menu Handlers
public MainMenuHandler1(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select)
{
switch (param2)
{
case 0:
DisplayMenu(HumanSkinsMenu, param1, 60);
case 1:
DisplayMenu(ZombieSkinsMenu, param1, 60);
case 2:
DisplayMenu(AmbienceMenu, param1, 60);
/*
case 3:
DisplayMenu(HumanPerksMenu, param1, 60);
case 4:
DisplayMenu(ZombiePerksMenu, param1, 60);
*/
}
}
}
public HSkinMenuHandler2(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select)
{
switch (param2)
{
case 0,1,2,3,4,5,6,7:
{
human_skin[param1] = param2;
human_chose[param1] = 1;
}
}
}
}
public ZSkinMenuHandler2(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select)
{
switch (param2)
{
case 0,1,2,3:
{
zombie_skin[param1] = param2;
zombie_chose[param1] = 1;
}
}
}
}
public AmbienceMenuHandler4(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select)
{
switch (param2)
{
case 0:
Ambience_enabled[param1] = 0;
case 1:
Ambience_enabled[param1] = 1;
}
}
}
public Action:zhr(client, args)
{
DisplayMenu(MainMenu, client, 60);
return Plugin_Handled;
}
/*********************************************************************************
FROM HERE WILL HAVE ALL THE ACTIONS LIKE SPAWNING THAT ARE CONNECTED TO THE MENU
*********************************************************************************/
public Action:Menuspawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event,"userid"));
//Plays Ambience Sound
if (Ambience_enabled[client] != 0)
PrintToChat(client, "You have disabled the ambience sound!");
else
EmitSoundToClient(client, "zh/ambience/ambience.mp3");
// Sets player model on spawn
if ( GetClientTeam( client ) == CS_TEAM_CT )
{
if (human_chose[client] == 1)
{
SetEntityModel(client, ctmodels[human_skin[client]]);
SetEntityRenderColor(client, 255, 255, 255, 255);
}
else
{
new random2 = GetRandomInt(0, 7);
SetEntityModel(client, ctmodels[random2]);
SetEntityRenderColor(client, 255, 255, 255, 255);
}
}
else if ( GetClientTeam( client ) == CS_TEAM_T )
{
if (zombie_chose[client] == 1)
{
SetEntityModel(client, tmodels[zombie_skin[client]]);
SetEntityRenderColor(client, 255, 255, 255, 255);
}
else
{
new random = GetRandomInt(0, 3);
SetEntityModel(client, tmodels[random]);
SetEntityRenderColor(client, 255, 255, 255, 255);
}
}
}
And I also found this code is zhr.sp
PHP Code:
/public OnMapStart()
{
// Resets alot of things like counters so they do not carry on from last map
g_iCount = 0;
g_round = 0;
g_score_t = 0;
g_score_ct = 0;
IsSwap = false;
// runs precached and download tables
InitPrecache();
// Somethings for some code i copied
g_team_side = CS_TEAM_T;
for(new i=0;i<=MAXPLAYERS;i++)
IsBlockSwitchTeam[i] = false;
// Runs zhr.cfg in the cfg/sourcemod folder
AutoExecConfig(true, "zhr","sourcemod");
// Darkness
SetLightStyle(0, "b");
// If disabled in zhr.cfg this will be over written at end of warmup just sets HS only in warmup
ServerCommand("zhr_headshotonly_enabled 1");
// Warmup timer-start
CreateTimer(1.0, warmuptimer);
// Advert timers-start
CreateTimer(180.0, advert, _, TIMER_REPEAT);
// One off timer for first round
CreateTimer(60.0, advert);
}
__________________
Last edited by 2389736818; 10-29-2016 at 10:08.
|
|