Skip to content
Permalink
Browse files

CreateDataTimer to CreateTimer

  • Loading branch information...
Bara committed Jul 14, 2018
1 parent c4f6765 commit 8a9f28fb38b638d33f4bc3651db9b3d8b9ad580b
@@ -752,23 +752,23 @@ stock int TTT_IsValidRole(int client, int role)

stock bool TTT_IsPrimaryWeapon(int weapon)
{
if (IsValidEntity(weapon))
if (IsValidEdict(weapon))
{
char sClass[32];
GetEntityClassname(weapon, sClass, sizeof(sClass));

if ((StrContains(sClass, "ak47", false) != -1) || (StrContains(sClass, "m4a1", false) != -1) ||
(StrContains(sClass, "m4a1_silencer", false) != -1) || (StrContains(sClass, "awp", false) != -1) ||
(StrContains(sClass, "p90", false) != -1) || (StrContains(sClass, "sg556", false) != -1) ||
(StrContains(sClass, "aug", false) != -1) || (StrContains(sClass, "galilar", false) != -1) ||
(StrContains(sClass, "famas", false) != -1) || (StrContains(sClass, "ssg08", false) != -1) ||
(StrContains(sClass, "g3sg1", false) != -1) || (StrContains(sClass, "scar20", false) != -1) ||
(StrContains(sClass, "m249", false) != -1) || (StrContains(sClass, "negev", false) != -1) ||
(StrContains(sClass, "nova", false) != -1) || (StrContains(sClass, "xm1014", false) != -1) ||
(StrContains(sClass, "sawedoff", false) != -1) || (StrContains(sClass, "mag7", false) != -1) ||
(StrContains(sClass, "mac10", false) != -1) || (StrContains(sClass, "mp9", false) != -1) ||
(StrContains(sClass, "mp7", false) != -1) || (StrContains(sClass, "ump45", false) != -1) ||
(StrContains(sClass, "bizon", false) != -1))
GetEdictClassname(weapon, sClass, sizeof(sClass));

if ((StrEqual(sClass, "weapon_ak47", false)) || (StrEqual(sClass, "weapon_m4a1", false)) ||
(StrEqual(sClass, "weapon_m4a1_silencer", false)) || (StrEqual(sClass, "weapon_awp", false)) ||
(StrEqual(sClass, "weapon_p90", false)) || (StrEqual(sClass, "weapon_sg556", false)) ||
(StrEqual(sClass, "weapon_aug", false)) || (StrEqual(sClass, "weapon_galilar", false)) ||
(StrEqual(sClass, "weapon_famas", false)) || (StrEqual(sClass, "weapon_ssg08", false)) ||
(StrEqual(sClass, "weapon_g3sg1", false)) || (StrEqual(sClass, "weapon_scar20", false)) ||
(StrEqual(sClass, "weapon_m249", false)) || (StrEqual(sClass, "weapon_negev", false)) ||
(StrEqual(sClass, "weapon_nova", false)) || (StrEqual(sClass, "weapon_xm1014", false)) ||
(StrEqual(sClass, "weapon_sawedoff", false)) || (StrEqual(sClass, "weapon_mag7", false)) ||
(StrEqual(sClass, "weapon_mac10", false)) || (StrEqual(sClass, "weapon_mp9", false)) ||
(StrEqual(sClass, "weapon_mp7", false)) || (StrEqual(sClass, "weapon_ump45", false)) ||
(StrEqual(sClass, "weapon_bizon", false)))
{
return true;
}
@@ -88,7 +88,7 @@ stock bool WebFix_OpenUrl(int client, const char[] title, const char[] url, bool
ShowMOTDPanel(client, "WebFix", "http://invaliddomain.invalidtld", MOTDPANEL_TYPE_URL);

DataPack pack;
CreateDataTimer(1.0, WebFix_OpenUrl_OpenTarget, pack);
CreateTimer(1.0, WebFix_OpenUrl_OpenTarget, pack);
pack.WriteCell(EntIndexToEntRef(client));
pack.WriteString(title);
pack.WriteString(sUrlencode);
@@ -813,14 +813,14 @@ stock float plantBomb(int client, float time)
TTT_ClearTimer(g_hExplosionTimer[client]);

Handle explosionPack;
g_hExplosionTimer[client] = CreateDataTimer(time, explodeC4, explosionPack, TIMER_FLAG_NO_MAPCHANGE);
g_hExplosionTimer[client] = CreateTimer(time, explodeC4, explosionPack, TIMER_FLAG_NO_MAPCHANGE);
WritePackCell(explosionPack, GetClientUserId(client));
WritePackCell(explosionPack, bombEnt);

if (g_cC4BeepVolume.FloatValue > 0.0)
{
Handle beepPack;
CreateDataTimer(1.0, bombBeep, beepPack);
CreateTimer(1.0, bombBeep, beepPack);
WritePackCell(beepPack, bombEnt);
WritePackCell(beepPack, (time - 1));
}
@@ -931,7 +931,7 @@ public Action bombBeep(Handle timer, Handle pack)
}

Handle bombBeep2;
CreateDataTimer(1.0, bombBeep, bombBeep2);
CreateTimer(1.0, bombBeep, bombBeep2);
WritePackCell(bombBeep2, bombEnt);
WritePackCell(bombBeep2, beeps);
return Plugin_Stop;
@@ -186,7 +186,7 @@ public Action TTT_OnBodyChecked(int client, int[] ragdoll)
}

DataPack pack = new DataPack();
CreateDataTimer(1.0, Timer_DecoyBody, pack, TIMER_FLAG_NO_MAPCHANGE);
CreateTimer(1.0, Timer_DecoyBody, pack, TIMER_FLAG_NO_MAPCHANGE);
pack.WriteCell(GetClientUserId(attacker));
pack.WriteCell(EntIndexToEntRef(body));
pack.WriteCell(bReal);
@@ -217,7 +217,7 @@ public Action Timer_DecoyBody(Handle timer, any pack)
EmitAmbientSoundAny(BEEP_SOUND, fPos);

DataPack pack2 = new DataPack();
CreateDataTimer(1.0, Timer_DecoyBody, pack2, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
CreateTimer(1.0, Timer_DecoyBody, pack2, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
pack2.WriteCell(GetClientUserId(attacker));
pack2.WriteCell(EntIndexToEntRef(body));
pack2.WriteCell(bReal);
@@ -54,7 +54,7 @@ public void OnPluginStart()
g_cCount = AutoExecConfig_CreateConVar("drop_max_usage", "1", "Usages per round", _, true, 1.0);
g_cDistance = AutoExecConfig_CreateConVar("drop_distance", "500", "Distance between client and target");
g_cDropMode = AutoExecConfig_CreateConVar("drop_mode", "1", "0 - Just drop primary weapons, 1 - Drop primary weapons (no pickup for x seconds)", _, true, 0.0, true, 1.0);
g_cCooldown = AutoExecConfig_CreateConVar("drop_cooldown", "3", "Cooldown to allow pickup again (drop_drop_mode must be higher as 0)");
g_cCooldown = AutoExecConfig_CreateConVar("drop_cooldown", "9", "Cooldown to allow pickup again (drop_drop_mode must be higher as 0)");
g_cDropTraitorWeapons = AutoExecConfig_CreateConVar("drop_traitor_weapons", "0", "Drop all traitor weapons? If it true just the caller does not drop his weapons", _, true, 0.0, true, 1.0);
TTT_EndConfig();

@@ -144,14 +144,14 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count
continue;
}

if (!g_cDropTraitorWeapons.BoolValue && TTT_GetClientRole(i) == TTT_TEAM_TRAITOR)
if (TTT_GetClientRole(i) == TTT_TEAM_TRAITOR && !g_cDropTraitorWeapons.BoolValue)
{
continue;
}

DropWeapons(i);

if (g_cDropMode.BoolValue)
if (g_cDropMode.IntValue == 1)
{
g_bCooldown[i] = true;
}
@@ -134,7 +134,7 @@ public Action Event_SmokeDetonate(Event event, const char[] name, bool dontBroad
g_bActivePoison[client] = true;

DataPack pack = new DataPack();
CreateDataTimer(g_cDamageInterval.FloatValue, Timer_CheckPlayers, pack, TIMER_FLAG_NO_MAPCHANGE);
CreateTimer(g_cDamageInterval.FloatValue, Timer_CheckPlayers, pack, TIMER_FLAG_NO_MAPCHANGE);
pack.WriteCell(GetClientUserId(client));
pack.WriteCell(EntIndexToEntRef(entity));

@@ -183,7 +183,7 @@ public Action Timer_CheckPlayers(Handle timer, any pack)
}

DataPack pack2 = new DataPack();
CreateDataTimer(g_cDamageInterval.FloatValue, Timer_CheckPlayers, pack2, TIMER_FLAG_NO_MAPCHANGE);
CreateTimer(g_cDamageInterval.FloatValue, Timer_CheckPlayers, pack2, TIMER_FLAG_NO_MAPCHANGE);
pack2.WriteCell(GetClientUserId(attacker));
pack2.WriteCell(EntIndexToEntRef(entity));
}

0 comments on commit 8a9f28f

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.