update to latest version
This commit is contained in:
parent
a78558ac2e
commit
80a79eb635
@ -1,11 +1,10 @@
|
|||||||
#pragma semicolon 1
|
|
||||||
|
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <sdkhooks>
|
#include <sdkhooks>
|
||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
#include <multicolors>
|
#include <multicolors>
|
||||||
#include <zombiereloaded>
|
#include <zombiereloaded>
|
||||||
|
|
||||||
|
#pragma semicolon 1
|
||||||
#pragma newdecls required
|
#pragma newdecls required
|
||||||
|
|
||||||
/* CONVARS */
|
/* CONVARS */
|
||||||
@ -29,7 +28,6 @@ bool g_bPreAdminChecked[MAXPLAYERS+1];
|
|||||||
bool g_bResponseFailed[MAXPLAYERS+1];
|
bool g_bResponseFailed[MAXPLAYERS+1];
|
||||||
bool g_bResponsePassed[MAXPLAYERS+1];
|
bool g_bResponsePassed[MAXPLAYERS+1];
|
||||||
|
|
||||||
|
|
||||||
/* INTEGERS */
|
/* INTEGERS */
|
||||||
int g_iCollected[MAXPLAYERS+1];
|
int g_iCollected[MAXPLAYERS+1];
|
||||||
int g_iCounter = 0;
|
int g_iCounter = 0;
|
||||||
@ -42,7 +40,7 @@ public Plugin myinfo =
|
|||||||
name = "UNLOZE Season Event (XMAS)",
|
name = "UNLOZE Season Event (XMAS)",
|
||||||
author = "Neon",
|
author = "Neon",
|
||||||
description = "UNLOZE Season Event (XMAS)",
|
description = "UNLOZE Season Event (XMAS)",
|
||||||
version = "2.0",
|
version = "2.1",
|
||||||
url = "https://steamcommunity.com/id/n3ontm"
|
url = "https://steamcommunity.com/id/n3ontm"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -69,13 +67,6 @@ public void OnPluginStart()
|
|||||||
RegConsoleCmd("sm_highscore", Command_HighScore, "Shows the Present HighScore");
|
RegConsoleCmd("sm_highscore", Command_HighScore, "Shows the Present HighScore");
|
||||||
|
|
||||||
AutoExecConfig();
|
AutoExecConfig();
|
||||||
|
|
||||||
char sError[256];
|
|
||||||
if (SQL_CheckConfig("season"))
|
|
||||||
g_hDatabase = SQL_Connect("season", true, sError, sizeof(sError));
|
|
||||||
|
|
||||||
if (g_hDatabase == null)
|
|
||||||
LogError("Could not connect to database: %s", sError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -242,6 +233,45 @@ public void OnMapStart()
|
|||||||
CreateTimer(fRandomInterval, SpawnCollectable, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
CreateTimer(fRandomInterval, SpawnCollectable, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
public void OnConfigsExecuted()
|
||||||
|
{
|
||||||
|
Database.Connect(SQL_OnDatabaseConnect, "season");
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
public void SQL_OnDatabaseConnect(Database db, const char[] error, any data)
|
||||||
|
{
|
||||||
|
if(!db || strlen(error))
|
||||||
|
{
|
||||||
|
LogError("Database error: %s", error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_hDatabase = db;
|
||||||
|
|
||||||
|
char sQuery[256];
|
||||||
|
Format(sQuery, sizeof(sQuery), "CREATE TABLE IF NOT EXISTS xmas_table (`steam_auth` varchar(64), `name` varchar(256), `collected` int(16), PRIMARY KEY (`steam_auth`), INDEX (`collected`))");
|
||||||
|
|
||||||
|
g_hDatabase.Query(SQL_OnTableCreated, sQuery, _, DBPrio_High);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
public void SQL_OnTableCreated(Database db, DBResultSet results, const char[] error, any data)
|
||||||
|
{
|
||||||
|
if(!db || strlen(error))
|
||||||
|
{
|
||||||
|
LogError("Database error: %s", error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -300,30 +330,35 @@ public void OnClientAuthorized(int client, const char[] sSteamID32)
|
|||||||
char sSteamID[32];
|
char sSteamID[32];
|
||||||
GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));
|
GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));
|
||||||
|
|
||||||
char sQuery[255];
|
char sQuery[256];
|
||||||
Format(sQuery, sizeof(sQuery), "SELECT collected FROM xmas_table WHERE steam_auth = '%s'", sSteamID);
|
Format(sQuery, sizeof(sQuery), "SELECT collected FROM xmas_table WHERE steam_auth = '%s'", sSteamID);
|
||||||
SQL_TQuery(g_hDatabase, TQueryCBConnect, sQuery, GetClientUserId(client));
|
g_hDatabase.Query(SQL_OnQueryCompletedFetch, sQuery, GetClientSerial(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void TQueryCBConnect(Handle owner, Handle rs, const char[] error, any data)
|
public void SQL_OnQueryCompletedFetch(Database db, DBResultSet results, const char[] error, int iSerial)
|
||||||
{
|
{
|
||||||
int client = 0;
|
int client;
|
||||||
|
if ((client = GetClientFromSerial(iSerial)) == 0)
|
||||||
if ((client = GetClientOfUserId(data)) == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (SQL_GetRowCount(rs) > 0)
|
if (!db || strlen(error))
|
||||||
{
|
{
|
||||||
int iField;
|
LogError("Query error: %s", error);
|
||||||
SQL_FetchRow(rs);
|
return;
|
||||||
SQL_FieldNameToNum(rs, "collected", iField);
|
|
||||||
g_iCollected[client] = SQL_FetchInt(rs, iField);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete rs;
|
if (results.RowCount && results.FetchRow())
|
||||||
|
{
|
||||||
|
int iFieldNum;
|
||||||
|
|
||||||
|
results.FieldNameToNum("collected", iFieldNum);
|
||||||
|
g_iCollected[client] = results.FetchInt(iFieldNum);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_iCollected[client] = 0;
|
||||||
|
|
||||||
g_bResponsePassed[client] = true;
|
g_bResponsePassed[client] = true;
|
||||||
if (g_bPreAdminChecked[client])
|
if (g_bPreAdminChecked[client])
|
||||||
@ -357,6 +392,9 @@ public void OnClientPostAdminFilter(int client)
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||||
{
|
{
|
||||||
|
if (!g_hCVar_CollectablesEnabled.BoolValue)
|
||||||
|
return;
|
||||||
|
|
||||||
g_iCounter = 0;
|
g_iCounter = 0;
|
||||||
CreateTimer(10.0, CheckPlayerCount, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
CreateTimer(10.0, CheckPlayerCount, INVALID_HANDLE, TIMER_FLAG_NO_MAPCHANGE);
|
||||||
}
|
}
|
||||||
@ -381,39 +419,44 @@ public Action Command_HighScore(int client, int args)
|
|||||||
{
|
{
|
||||||
char sQuery[255];
|
char sQuery[255];
|
||||||
Format(sQuery, sizeof(sQuery), "SELECT * from xmas_table order by collected desc limit %d", g_hCVar_HighscoreDisplay.IntValue);
|
Format(sQuery, sizeof(sQuery), "SELECT * from xmas_table order by collected desc limit %d", g_hCVar_HighscoreDisplay.IntValue);
|
||||||
SQL_TQuery(g_hDatabase, TQueryCBHighscore, sQuery, GetClientUserId(client));
|
g_hDatabase.Query(SQL_OnQueryCompletedHighscore, sQuery, GetClientSerial(client));
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void TQueryCBHighscore(Handle owner, Handle rs, const char[] error, any data)
|
public void SQL_OnQueryCompletedHighscore(Database db, DBResultSet results, const char[] error, int iSerial)
|
||||||
{
|
{
|
||||||
int client = 0;
|
int client;
|
||||||
|
if ((client = GetClientFromSerial(iSerial)) == 0)
|
||||||
if ((client = GetClientOfUserId(data)) == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!db || strlen(error))
|
||||||
|
{
|
||||||
|
LogError("Query error: %s", error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char sName[MAX_NAME_LENGTH];
|
char sName[MAX_NAME_LENGTH];
|
||||||
char sBuffer[2048] = "{green}[UNLOZE XMAS] {white}TOP COLLECTORS:\n";
|
char sBuffer[2048] = "{green}[UNLOZE XMAS] {white}TOP COLLECTORS:\n";
|
||||||
char sTempBuffer[1024] = "";
|
char sTempBuffer[1024] = "";
|
||||||
|
|
||||||
for(int i = 1; i <= g_hCVar_HighscoreDisplay.IntValue; i++)
|
for(int i = 1; i <= g_hCVar_HighscoreDisplay.IntValue; i++)
|
||||||
{
|
{
|
||||||
int iField;
|
int iFieldNum;
|
||||||
SQL_FetchRow(rs);
|
if (!results.FetchRow())
|
||||||
|
break;
|
||||||
|
|
||||||
SQL_FieldNameToNum(rs, "name", iField);
|
results.FieldNameToNum("name", iFieldNum);
|
||||||
SQL_FetchString(rs, iField, sName, sizeof(sName));
|
results.FetchString(iFieldNum, sName, sizeof(sName));
|
||||||
|
|
||||||
SQL_FieldNameToNum(rs, "collected", iField);
|
results.FieldNameToNum("collected", iFieldNum);
|
||||||
int iCollected = SQL_FetchInt(rs, iField);
|
int iCollected = results.FetchInt(iFieldNum);
|
||||||
|
|
||||||
Format(sTempBuffer, sizeof(sTempBuffer), "{green}%d: %s - {red}%d \n", i, sName, iCollected);
|
Format(sTempBuffer, sizeof(sTempBuffer), "{green}%d: %s - {red}%d \n", i, sName, iCollected);
|
||||||
StrCat(sBuffer, sizeof(sBuffer), sTempBuffer);
|
StrCat(sBuffer, sizeof(sBuffer), sTempBuffer);
|
||||||
}
|
}
|
||||||
delete rs;
|
|
||||||
|
|
||||||
CPrintToChat(client, sBuffer);
|
CPrintToChat(client, sBuffer);
|
||||||
}
|
}
|
||||||
@ -426,34 +469,37 @@ public Action Command_Collected(int client, int args)
|
|||||||
char sSteamID[32];
|
char sSteamID[32];
|
||||||
GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));
|
GetClientAuthId(client, AuthId_Steam2, sSteamID, sizeof(sSteamID));
|
||||||
|
|
||||||
char sQuery[255];
|
char sQuery[256];
|
||||||
Format(sQuery, sizeof(sQuery), "SELECT collected FROM xmas_table WHERE steam_auth = '%s'", sSteamID);
|
Format(sQuery, sizeof(sQuery), "SELECT collected FROM xmas_table WHERE steam_auth = '%s'", sSteamID);
|
||||||
SQL_TQuery(g_hDatabase, TQueryCBCollected, sQuery, GetClientUserId(client));
|
g_hDatabase.Query(SQL_OnQueryCompletedCheck, sQuery, GetClientSerial(client));
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void TQueryCBCollected(Handle owner, Handle rs, const char[] error, any data)
|
public void SQL_OnQueryCompletedCheck(Database db, DBResultSet results, const char[] error, int iSerial)
|
||||||
{
|
{
|
||||||
int client = 0;
|
int client;
|
||||||
|
if ((client = GetClientFromSerial(iSerial)) == 0)
|
||||||
if ((client = GetClientOfUserId(data)) == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (SQL_GetRowCount(rs) > 0)
|
if (!db || strlen(error))
|
||||||
{
|
{
|
||||||
int iField;
|
LogError("Query error: %s", error);
|
||||||
SQL_FetchRow(rs);
|
return;
|
||||||
SQL_FieldNameToNum(rs, "collected", iField);
|
}
|
||||||
g_iCollected[client] = SQL_FetchInt(rs, iField);
|
|
||||||
|
if (results.RowCount && results.FetchRow())
|
||||||
|
{
|
||||||
|
int iFieldNum;
|
||||||
|
|
||||||
|
results.FieldNameToNum("collected", iFieldNum);
|
||||||
|
g_iCollected[client] = results.FetchInt(iFieldNum);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_iCollected[client] = 0;
|
g_iCollected[client] = 0;
|
||||||
|
|
||||||
delete rs;
|
|
||||||
|
|
||||||
CPrintToChat(client, "{green}[UNLOZE XMAS] {white}You have collected {green}%d {white}presents so far.", g_iCollected[client]);
|
CPrintToChat(client, "{green}[UNLOZE XMAS] {white}You have collected {green}%d {white}presents so far.", g_iCollected[client]);
|
||||||
|
|
||||||
if ((g_iCollected[client] > g_hCVar_MilestoneInfection.IntValue) && (g_iCollected[client] > g_hCVar_MilestoneSkin.IntValue))
|
if ((g_iCollected[client] > g_hCVar_MilestoneInfection.IntValue) && (g_iCollected[client] > g_hCVar_MilestoneSkin.IntValue))
|
||||||
@ -497,7 +543,6 @@ public Action SpawnCollectable(Handle timer)
|
|||||||
SetEntityBBox(iRotating, view_as<float>({-10.0, -1.0, -1.0}), view_as<float>({1.0, 1.0, 1.0}));
|
SetEntityBBox(iRotating, view_as<float>({-10.0, -1.0, -1.0}), view_as<float>({1.0, 1.0, 1.0}));
|
||||||
SetEntityProps(iRotating);
|
SetEntityProps(iRotating);
|
||||||
|
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
int iModel = CreateEntityAtOrigin("prop_dynamic_override", fOrigin);
|
int iModel = CreateEntityAtOrigin("prop_dynamic_override", fOrigin);
|
||||||
DispatchKeyFormat(iModel, "targetname", "season_prop_%d", g_iCounter);
|
DispatchKeyFormat(iModel, "targetname", "season_prop_%d", g_iCounter);
|
||||||
@ -645,10 +690,12 @@ public void HookCallback(const char[] output, int caller, int activator, float d
|
|||||||
|
|
||||||
char sName[MAX_NAME_LENGTH];
|
char sName[MAX_NAME_LENGTH];
|
||||||
GetClientName(client, sName, sizeof(sName));
|
GetClientName(client, sName, sizeof(sName));
|
||||||
|
char sSafeName[(2*MAX_NAME_LENGTH)+1];
|
||||||
|
g_hDatabase.Escape(sName, sSafeName, sizeof(sSafeName));
|
||||||
|
|
||||||
char sQuery[255];
|
char sQuery[256];
|
||||||
Format(sQuery, sizeof(sQuery), "INSERT INTO xmas_table (steam_auth,name,collected) VALUES ('%s','%s',1) ON DUPLICATE KEY UPDATE collected=collected+1;", sSteamID, sName);
|
Format(sQuery, sizeof(sQuery), "INSERT INTO xmas_table (steam_auth,name,collected) VALUES ('%s','%s',1) ON DUPLICATE KEY UPDATE collected=collected+1;", sSteamID, sSafeName);
|
||||||
SQL_FastQuery(g_hDatabase, sQuery);
|
g_hDatabase.Query(SQL_OnQueryCompletedUpdate, sQuery);
|
||||||
|
|
||||||
g_iCollected[client] += 1;
|
g_iCollected[client] += 1;
|
||||||
CheckAndAddFlag(client);
|
CheckAndAddFlag(client);
|
||||||
@ -666,12 +713,30 @@ public void HookCallback(const char[] output, int caller, int activator, float d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
public void SQL_OnQueryCompletedUpdate(Database db, DBResultSet results, const char[] error, any data)
|
||||||
|
{
|
||||||
|
if (!db || strlen(error))
|
||||||
|
{
|
||||||
|
LogError("Query error: %s", error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
||||||
{
|
{
|
||||||
|
if (!g_hCVar_InfectionEffectEnabled.BoolValue)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!IsValidClient(attacker))
|
if (!IsValidClient(attacker))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_hCVar_InfectionEffectEnabled.BoolValue && ((g_iCollected[client] >= g_hCVar_MilestoneInfection.IntValue) || g_iCollected[attacker] >= g_hCVar_MilestoneInfection.IntValue))
|
if (g_iCollected[client] >= g_hCVar_MilestoneInfection.IntValue || g_iCollected[attacker] >= g_hCVar_MilestoneInfection.IntValue)
|
||||||
{
|
{
|
||||||
float fInfectionOrigin[3];
|
float fInfectionOrigin[3];
|
||||||
GetClientAbsOrigin(client, fInfectionOrigin);
|
GetClientAbsOrigin(client, fInfectionOrigin);
|
||||||
@ -749,57 +814,60 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo
|
|||||||
|
|
||||||
public void OnEntitySpawned(int Entity, const char[] sClassname)
|
public void OnEntitySpawned(int Entity, const char[] sClassname)
|
||||||
{
|
{
|
||||||
|
if (StrContains(sClassname, "_projectile", false) == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
int iOwner = GetEntPropEnt(Entity, Prop_Data, "m_hOwnerEntity");
|
int iOwner = GetEntPropEnt(Entity, Prop_Data, "m_hOwnerEntity");
|
||||||
if(!IsValidClient(iOwner))
|
if(!IsValidClient(iOwner))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_iCollected[iOwner] >= g_hCVar_MilestoneGrenade.IntValue)
|
if (g_iCollected[iOwner] < g_hCVar_MilestoneGrenade.IntValue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SetEntityRenderMode(Entity, RENDER_NONE);
|
||||||
|
|
||||||
|
float fNadeOrigin[3];
|
||||||
|
GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", fNadeOrigin);
|
||||||
|
|
||||||
|
int iNadeProp = CreateEntityAtOrigin("prop_dynamic_override", fNadeOrigin);
|
||||||
|
DispatchKeyFormat(iNadeProp, "targetname", "season_nade_prop_%d", g_iCounter);
|
||||||
|
DispatchKeyFormat(iNadeProp, "disableshadows", "1");
|
||||||
|
DispatchKeyFormat(iNadeProp, "disablereceiveshadows", "1");
|
||||||
|
DispatchKeyFormat(iNadeProp, "DisableBoneFollowers", "1");
|
||||||
|
|
||||||
|
int iRandomSkin = GetRandomInt(0, 3);
|
||||||
|
if (iRandomSkin == 0)
|
||||||
{
|
{
|
||||||
SetEntityRenderMode(Entity, RENDER_NONE);
|
DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_snowball_thrown.mdl");
|
||||||
|
DispatchKeyFormat(iNadeProp, "modelscale", "3.0");
|
||||||
float fNadeOrigin[3];
|
}
|
||||||
GetEntPropVector(Entity, Prop_Send, "m_vecOrigin", fNadeOrigin);
|
else if (iRandomSkin == 1)
|
||||||
|
{
|
||||||
int iNadeProp = CreateEntityAtOrigin("prop_dynamic_override", fNadeOrigin);
|
DispatchKeyFormat(iNadeProp, "model", "models/zombieden/xmas/giftbox.mdl");
|
||||||
DispatchKeyFormat(iNadeProp, "targetname", "season_nade_prop_%d", g_iCounter);
|
DispatchKeyFormat(iNadeProp, "modelscale", "0.6");
|
||||||
DispatchKeyFormat(iNadeProp, "disableshadows", "1");
|
iRandomSkin = GetRandomInt(0, 1);
|
||||||
DispatchKeyFormat(iNadeProp, "disablereceiveshadows", "1");
|
|
||||||
DispatchKeyFormat(iNadeProp, "DisableBoneFollowers", "1");
|
|
||||||
|
|
||||||
int iRandomSkin = GetRandomInt(0, 3);
|
|
||||||
if (iRandomSkin == 0)
|
if (iRandomSkin == 0)
|
||||||
{
|
{
|
||||||
DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_snowball_thrown.mdl");
|
DispatchKeyFormat(iNadeProp, "skin", "0");
|
||||||
DispatchKeyFormat(iNadeProp, "modelscale", "3.0");
|
|
||||||
}
|
}
|
||||||
else if (iRandomSkin == 1)
|
else if (iRandomSkin == 1)
|
||||||
{
|
{
|
||||||
DispatchKeyFormat(iNadeProp, "model", "models/zombieden/xmas/giftbox.mdl");
|
DispatchKeyFormat(iNadeProp, "skin", "1");
|
||||||
DispatchKeyFormat(iNadeProp, "modelscale", "0.6");
|
|
||||||
iRandomSkin = GetRandomInt(0, 1);
|
|
||||||
if (iRandomSkin == 0)
|
|
||||||
{
|
|
||||||
DispatchKeyFormat(iNadeProp, "skin", "0");
|
|
||||||
}
|
|
||||||
else if (iRandomSkin == 1)
|
|
||||||
{
|
|
||||||
DispatchKeyFormat(iNadeProp, "skin", "1");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (iRandomSkin == 2)
|
|
||||||
{
|
|
||||||
DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_ornament_thrown.mdl");
|
|
||||||
DispatchKeyFormat(iNadeProp, "modelscale", "2.0");
|
|
||||||
}
|
|
||||||
else if (iRandomSkin == 3)
|
|
||||||
{
|
|
||||||
DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_santa_hat_thrown.mdl");
|
|
||||||
DispatchKeyFormat(iNadeProp, "modelscale", "2.3");
|
|
||||||
}
|
|
||||||
|
|
||||||
SpawnAndActivate(iNadeProp);
|
|
||||||
ParentToEntity(iNadeProp, Entity);
|
|
||||||
}
|
}
|
||||||
|
else if (iRandomSkin == 2)
|
||||||
|
{
|
||||||
|
DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_ornament_thrown.mdl");
|
||||||
|
DispatchKeyFormat(iNadeProp, "modelscale", "2.0");
|
||||||
|
}
|
||||||
|
else if (iRandomSkin == 3)
|
||||||
|
{
|
||||||
|
DispatchKeyFormat(iNadeProp, "model", "models/weapons/w_santa_hat_thrown.mdl");
|
||||||
|
DispatchKeyFormat(iNadeProp, "modelscale", "2.3");
|
||||||
|
}
|
||||||
|
|
||||||
|
SpawnAndActivate(iNadeProp);
|
||||||
|
ParentToEntity(iNadeProp, Entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user