Port remaining .sp files.

This commit is contained in:
David Anderson 2014-11-09 16:52:06 -08:00
parent 110440988d
commit 4a66b67d81
7 changed files with 117 additions and 116 deletions

View File

@ -48,15 +48,15 @@ public Plugin:myinfo =
url = "http://www.sourcemod.net/" url = "http://www.sourcemod.net/"
}; };
new Handle:g_Cvar_TriggerShow = INVALID_HANDLE; ConVar g_Cvar_TriggerShow;
new Handle:g_Cvar_TimeleftInterval = INVALID_HANDLE; ConVar g_Cvar_TimeleftInterval;
new Handle:g_Cvar_FriendlyFire = INVALID_HANDLE; ConVar g_Cvar_FriendlyFire;
new Handle:g_Timer_TimeShow = INVALID_HANDLE; new Handle:g_Timer_TimeShow = INVALID_HANDLE;
new Handle:g_Cvar_WinLimit = INVALID_HANDLE; ConVar g_Cvar_WinLimit;
new Handle:g_Cvar_FragLimit = INVALID_HANDLE; ConVar g_Cvar_FragLimit;
new Handle:g_Cvar_MaxRounds = INVALID_HANDLE; ConVar g_Cvar_MaxRounds;
#define TIMELEFT_ALL_ALWAYS 0 /* Print to all players */ #define TIMELEFT_ALL_ALWAYS 0 /* Print to all players */
#define TIMELEFT_ALL_MAYBE 1 /* Print to all players if sm_trigger_show allows */ #define TIMELEFT_ALL_MAYBE 1 /* Print to all players if sm_trigger_show allows */
@ -80,7 +80,7 @@ public OnPluginStart()
RegConsoleCmd("motd", Command_Motd); RegConsoleCmd("motd", Command_Motd);
RegConsoleCmd("ff", Command_FriendlyFire); RegConsoleCmd("ff", Command_FriendlyFire);
HookConVarChange(g_Cvar_TimeleftInterval, ConVarChange_TimeleftInterval); g_Cvar_TimeleftInterval.AddChangeHook(ConVarChange_TimeleftInterval);
decl String:folder[64]; decl String:folder[64];
GetGameFolderName(folder, sizeof(folder)); GetGameFolderName(folder, sizeof(folder));
@ -257,10 +257,10 @@ public OnClientSayCommand_Post(client, const String:command[], const String:sArg
} }
else if (strcmp(sArgs, "thetime", false) == 0) else if (strcmp(sArgs, "thetime", false) == 0)
{ {
decl String:ctime[64]; char ctime[64];
FormatTime(ctime, 64, NULL_STRING); FormatTime(ctime, 64, NULL_STRING);
if(GetConVarInt(g_Cvar_TriggerShow)) if (g_Cvar_TriggerShow.IntValue)
{ {
PrintToChatAll("[SM] %t", "Thetime", ctime); PrintToChatAll("[SM] %t", "Thetime", ctime);
} }
@ -275,10 +275,10 @@ public OnClientSayCommand_Post(client, const String:command[], const String:sArg
} }
else if (strcmp(sArgs, "currentmap", false) == 0) else if (strcmp(sArgs, "currentmap", false) == 0)
{ {
decl String:map[64]; char map[64];
GetCurrentMap(map, sizeof(map)); GetCurrentMap(map, sizeof(map));
if(GetConVarInt(g_Cvar_TriggerShow)) if (g_Cvar_TriggerShow.IntValue)
{ {
PrintToChatAll("[SM] %t", "Current Map", map); PrintToChatAll("[SM] %t", "Current Map", map);
} }
@ -289,10 +289,10 @@ public OnClientSayCommand_Post(client, const String:command[], const String:sArg
} }
else if (strcmp(sArgs, "nextmap", false) == 0) else if (strcmp(sArgs, "nextmap", false) == 0)
{ {
decl String:map[32]; char map[32];
GetNextMap(map, sizeof(map)); GetNextMap(map, sizeof(map));
if(GetConVarInt(g_Cvar_TriggerShow)) if (g_Cvar_TriggerShow.IntValue)
{ {
if (mapchooser && EndOfMapVoteEnabled() && !HasEndOfMapVoteFinished()) if (mapchooser && EndOfMapVoteEnabled() && !HasEndOfMapVoteFinished())
{ {
@ -323,15 +323,14 @@ public OnClientSayCommand_Post(client, const String:command[], const String:sArg
ShowTimeLeft(client, who) ShowTimeLeft(client, who)
{ {
new bool:lastround = false; bool lastround = false;
new bool:written = false; bool written = false;
new bool:notimelimit = false; bool notimelimit = false;
decl String:finalOutput[1024]; char finalOutput[1024];
finalOutput[0] = 0;
if (who == TIMELEFT_ALL_ALWAYS if (who == TIMELEFT_ALL_ALWAYS
|| (who == TIMELEFT_ALL_MAYBE && GetConVarInt(g_Cvar_TriggerShow))) || (who == TIMELEFT_ALL_MAYBE && g_Cvar_TriggerShow.IntValue))
{ {
client = 0; client = 0;
} }
@ -362,9 +361,9 @@ ShowTimeLeft(client, who)
if (!lastround) if (!lastround)
{ {
if (g_Cvar_WinLimit != INVALID_HANDLE) if (g_Cvar_WinLimit)
{ {
new winlimit = GetConVarInt(g_Cvar_WinLimit); int winlimit = g_Cvar_WinLimit.IntValue;
if (winlimit > 0) if (winlimit > 0)
{ {
@ -399,9 +398,9 @@ ShowTimeLeft(client, who)
} }
} }
if (g_Cvar_FragLimit != INVALID_HANDLE) if (g_Cvar_FragLimit)
{ {
new fraglimit = GetConVarInt(g_Cvar_FragLimit); int fraglimit = g_Cvar_FragLimit.IntValue;
if (fraglimit > 0) if (fraglimit > 0)
{ {
@ -436,9 +435,9 @@ ShowTimeLeft(client, who)
} }
} }
if (g_Cvar_MaxRounds != INVALID_HANDLE) if (g_Cvar_MaxRounds)
{ {
new maxrounds = GetConVarInt(g_Cvar_MaxRounds); int maxrounds = g_Cvar_MaxRounds.IntValue;
if (maxrounds > 0) if (maxrounds > 0)
{ {
@ -486,7 +485,7 @@ ShowTimeLeft(client, who)
} }
if (who == TIMELEFT_ALL_ALWAYS if (who == TIMELEFT_ALL_ALWAYS
|| (who == TIMELEFT_ALL_MAYBE && GetConVarInt(g_Cvar_TriggerShow))) || (who == TIMELEFT_ALL_MAYBE && g_Cvar_TriggerShow.IntValue))
{ {
PrintToChatAll("[SM] %s", finalOutput); PrintToChatAll("[SM] %s", finalOutput);
} }
@ -503,10 +502,10 @@ ShowTimeLeft(client, who)
ShowFriendlyFire(client) ShowFriendlyFire(client)
{ {
if (g_Cvar_FriendlyFire != INVALID_HANDLE) if (g_Cvar_FriendlyFire)
{ {
decl String:phrase[24]; char phrase[24];
if (GetConVarBool(g_Cvar_FriendlyFire)) if (g_Cvar_FriendlyFire.BoolValue)
{ {
strcopy(phrase, sizeof(phrase), "Friendly Fire On"); strcopy(phrase, sizeof(phrase), "Friendly Fire On");
} }
@ -515,7 +514,7 @@ ShowFriendlyFire(client)
strcopy(phrase, sizeof(phrase), "Friendly Fire Off"); strcopy(phrase, sizeof(phrase), "Friendly Fire Off");
} }
if(GetConVarInt(g_Cvar_TriggerShow)) if (g_Cvar_TriggerShow.IntValue)
{ {
PrintToChatAll("[SM] %t", phrase); PrintToChatAll("[SM] %t", phrase);
} }

View File

@ -33,7 +33,7 @@
new g_BeaconSerial[MAXPLAYERS+1] = { 0, ... }; new g_BeaconSerial[MAXPLAYERS+1] = { 0, ... };
new Handle:g_Cvar_BeaconRadius = INVALID_HANDLE; ConVar g_Cvar_BeaconRadius;
CreateBeacon(client) CreateBeacon(client)
{ {
@ -86,28 +86,28 @@ public Action:Timer_Beacon(Handle:timer, any:value)
return Plugin_Stop; return Plugin_Stop;
} }
new team = GetClientTeam(client); int team = GetClientTeam(client);
new Float:vec[3]; float vec[3];
GetClientAbsOrigin(client, vec); GetClientAbsOrigin(client, vec);
vec[2] += 10; vec[2] += 10;
if (g_BeamSprite > -1 && g_HaloSprite > -1) if (g_BeamSprite > -1 && g_HaloSprite > -1)
{ {
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_BeaconRadius), g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_BeaconRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0);
TE_SendToAll(); TE_SendToAll();
if (team == 2) if (team == 2)
{ {
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_BeaconRadius), g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, redColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_BeaconRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, redColor, 10, 0);
} }
else if (team == 3) else if (team == 3)
{ {
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_BeaconRadius), g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, blueColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_BeaconRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, blueColor, 10, 0);
} }
else else
{ {
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_BeaconRadius), g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, greenColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_BeaconRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, greenColor, 10, 0);
} }
TE_SendToAll(); TE_SendToAll();

View File

@ -34,16 +34,16 @@
new g_FireBombSerial[MAXPLAYERS+1] = { 0, ... }; new g_FireBombSerial[MAXPLAYERS+1] = { 0, ... };
new g_FireBombTime[MAXPLAYERS+1] = { 0, ... }; new g_FireBombTime[MAXPLAYERS+1] = { 0, ... };
new Handle:g_Cvar_BurnDuration = INVALID_HANDLE; ConVar g_Cvar_BurnDuration;
new Handle:g_Cvar_FireBombTicks = INVALID_HANDLE; ConVar g_Cvar_FireBombTicks;
new Handle:g_Cvar_FireBombRadius = INVALID_HANDLE; ConVar g_Cvar_FireBombRadius;
new Handle:g_Cvar_FireBombMode = INVALID_HANDLE; ConVar g_Cvar_FireBombMode;
CreateFireBomb(client) CreateFireBomb(client)
{ {
g_FireBombSerial[client] = ++g_Serial_Gen; g_FireBombSerial[client] = ++g_Serial_Gen;
CreateTimer(1.0, Timer_FireBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS); CreateTimer(1.0, Timer_FireBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
g_FireBombTime[client] = GetConVarInt(g_Cvar_FireBombTicks); g_FireBombTime[client] = g_Cvar_FireBombTicks.IntValue;
} }
KillFireBomb(client) KillFireBomb(client)
@ -99,16 +99,16 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
} }
g_FireBombTime[client]--; g_FireBombTime[client]--;
new Float:vec[3]; float vec[3];
GetClientEyePosition(client, vec); GetClientEyePosition(client, vec);
if (g_FireBombTime[client] > 0) if (g_FireBombTime[client] > 0)
{ {
new color; int color;
if (g_FireBombTime[client] > 1) if (g_FireBombTime[client] > 1)
{ {
color = RoundToFloor(g_FireBombTime[client] * (255.0 / GetConVarFloat(g_Cvar_FireBombTicks))); color = RoundToFloor(g_FireBombTime[client] * (255.0 / g_Cvar_FireBombTicks.FloatValue));
if (g_BeepSound[0]) if (g_BeepSound[0])
{ {
EmitAmbientSound(g_BeepSound, vec, client, SNDLEVEL_RAIDSIREN); EmitAmbientSound(g_BeepSound, vec, client, SNDLEVEL_RAIDSIREN);
@ -125,7 +125,7 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
SetEntityRenderColor(client, 255, color, color, 255); SetEntityRenderColor(client, 255, color, color, 255);
decl String:name[64]; char name[64];
GetClientName(client, name, sizeof(name)); GetClientName(client, name, sizeof(name));
PrintCenterTextAll("%t", "Till Explodes", name, g_FireBombTime[client]); PrintCenterTextAll("%t", "Till Explodes", name, g_FireBombTime[client]);
@ -134,9 +134,9 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
GetClientAbsOrigin(client, vec); GetClientAbsOrigin(client, vec);
vec[2] += 10; vec[2] += 10;
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_FireBombRadius) / 3.0, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_FireBombRadius.FloatValue / 3.0, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0);
TE_SendToAll(); TE_SendToAll();
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_FireBombRadius) / 3.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, whiteColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_FireBombRadius.FloatValue / 3.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, whiteColor, 10, 0);
TE_SendToAll(); TE_SendToAll();
} }
return Plugin_Continue; return Plugin_Continue;
@ -145,7 +145,7 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
{ {
if (g_ExplosionSprite > -1) if (g_ExplosionSprite > -1)
{ {
TE_SetupExplosion(vec, g_ExplosionSprite, 0.1, 1, 0, GetConVarInt(g_Cvar_FireBombRadius), 5000); TE_SetupExplosion(vec, g_ExplosionSprite, 0.1, 1, 0, g_Cvar_FireBombRadius.IntValue, 5000);
TE_SendToAll(); TE_SendToAll();
} }
@ -153,16 +153,16 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
{ {
GetClientAbsOrigin(client, vec); GetClientAbsOrigin(client, vec);
vec[2] += 10; vec[2] += 10;
TE_SetupBeamRingPoint(vec, 50.0, GetConVarFloat(g_Cvar_FireBombRadius), g_BeamSprite, g_HaloSprite, 0, 10, 0.5, 30.0, 1.5, orangeColor, 5, 0); TE_SetupBeamRingPoint(vec, 50.0, g_Cvar_FireBombRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.5, 30.0, 1.5, orangeColor, 5, 0);
TE_SendToAll(); TE_SendToAll();
vec[2] += 15; vec[2] += 15;
TE_SetupBeamRingPoint(vec, 40.0, GetConVarFloat(g_Cvar_FireBombRadius), g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 30.0, 1.5, orangeColor, 5, 0); TE_SetupBeamRingPoint(vec, 40.0, g_Cvar_FireBombRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 30.0, 1.5, orangeColor, 5, 0);
TE_SendToAll(); TE_SendToAll();
vec[2] += 15; vec[2] += 15;
TE_SetupBeamRingPoint(vec, 30.0, GetConVarFloat(g_Cvar_FireBombRadius), g_BeamSprite, g_HaloSprite, 0, 10, 0.7, 30.0, 1.5, orangeColor, 5, 0); TE_SetupBeamRingPoint(vec, 30.0, g_Cvar_FireBombRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.7, 30.0, 1.5, orangeColor, 5, 0);
TE_SendToAll(); TE_SendToAll();
vec[2] += 15; vec[2] += 15;
TE_SetupBeamRingPoint(vec, 20.0, GetConVarFloat(g_Cvar_FireBombRadius), g_BeamSprite, g_HaloSprite, 0, 10, 0.8, 30.0, 1.5, orangeColor, 5, 0); TE_SetupBeamRingPoint(vec, 20.0, g_Cvar_FireBombRadius.FloatValue, g_BeamSprite, g_HaloSprite, 0, 10, 0.8, 30.0, 1.5, orangeColor, 5, 0);
TE_SendToAll(); TE_SendToAll();
} }
@ -171,13 +171,13 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
EmitAmbientSound(g_BoomSound, vec, client, SNDLEVEL_RAIDSIREN); EmitAmbientSound(g_BoomSound, vec, client, SNDLEVEL_RAIDSIREN);
} }
IgniteEntity(client, GetConVarFloat(g_Cvar_BurnDuration)); IgniteEntity(client, g_Cvar_BurnDuration.FloatValue);
KillFireBomb(client); KillFireBomb(client);
SetEntityRenderColor(client, 255, 255, 255, 255); SetEntityRenderColor(client, 255, 255, 255, 255);
if (GetConVarInt(g_Cvar_FireBombMode) > 0) if (g_Cvar_FireBombMode.IntValue > 0)
{ {
new teamOnly = ((GetConVarInt(g_Cvar_FireBombMode) == 1) ? true : false); int teamOnly = ((g_Cvar_FireBombMode.IntValue == 1) ? true : false);
for (new i = 1; i <= MaxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
@ -191,18 +191,18 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
continue; continue;
} }
new Float:pos[3]; float pos[3];
GetClientAbsOrigin(i, pos); GetClientAbsOrigin(i, pos);
new Float:distance = GetVectorDistance(vec, pos); float distance = GetVectorDistance(vec, pos);
if (distance > GetConVarFloat(g_Cvar_FireBombRadius)) if (distance > g_Cvar_FireBombRadius.FloatValue)
{ {
continue; continue;
} }
new Float:duration = GetConVarFloat(g_Cvar_BurnDuration); float duration = g_Cvar_BurnDuration.FloatValue;
duration *= (GetConVarFloat(g_Cvar_FireBombRadius) - distance) / GetConVarFloat(g_Cvar_FireBombRadius); duration *= (g_Cvar_FireBombRadius.FloatValue - distance) / g_Cvar_FireBombRadius.FloatValue;
IgniteEntity(i, duration); IgniteEntity(i, duration);
} }
@ -372,14 +372,14 @@ public Action:Command_Burn(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
decl String:arg[65]; char arg[65];
GetCmdArg(1, arg, sizeof(arg)); GetCmdArg(1, arg, sizeof(arg));
new Float:seconds = GetConVarFloat(g_Cvar_BurnDuration); float seconds = g_Cvar_BurnDuration.FloatValue;
if (args > 1) if (args > 1)
{ {
decl String:time[20]; char time[20];
GetCmdArg(2, time, sizeof(time)); GetCmdArg(2, time, sizeof(time));
if (StringToFloatEx(time, seconds) == 0) if (StringToFloatEx(time, seconds) == 0)
{ {
@ -388,8 +388,9 @@ public Action:Command_Burn(client, args)
} }
} }
decl String:target_name[MAX_TARGET_LENGTH]; char target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; int target_list[MAXPLAYERS], target_count;
bool tn_is_ml;
if ((target_count = ProcessTargetString( if ((target_count = ProcessTargetString(
arg, arg,
@ -430,11 +431,12 @@ public Action:Command_FireBomb(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
decl String:arg[65]; char arg[65];
GetCmdArg(1, arg, sizeof(arg)); GetCmdArg(1, arg, sizeof(arg));
decl String:target_name[MAX_TARGET_LENGTH]; char target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; int target_list[MAXPLAYERS], target_count;
bool tn_is_ml;
if ((target_count = ProcessTargetString( if ((target_count = ProcessTargetString(
arg, arg,

View File

@ -36,10 +36,10 @@ new g_FreezeBombSerial[MAXPLAYERS+1] = { 0, ... };
new g_FreezeTime[MAXPLAYERS+1] = { 0, ... }; new g_FreezeTime[MAXPLAYERS+1] = { 0, ... };
new g_FreezeBombTime[MAXPLAYERS+1] = { 0, ... }; new g_FreezeBombTime[MAXPLAYERS+1] = { 0, ... };
new Handle:g_Cvar_FreezeDuration = INVALID_HANDLE; ConVar g_Cvar_FreezeDuration;
new Handle:g_Cvar_FreezeBombTicks = INVALID_HANDLE; ConVar g_Cvar_FreezeBombTicks;
new Handle:g_Cvar_FreezeBombRadius = INVALID_HANDLE; ConVar g_Cvar_FreezeBombRadius;
new Handle:g_Cvar_FreezeBombMode = INVALID_HANDLE; ConVar g_Cvar_FreezeBombMode;
FreezeClient(client, time) FreezeClient(client, time)
{ {
@ -93,7 +93,7 @@ CreateFreezeBomb(client)
KillFreezeBomb(client); KillFreezeBomb(client);
return; return;
} }
g_FreezeBombTime[client] = GetConVarInt(g_Cvar_FreezeBombTicks); g_FreezeBombTime[client] = g_Cvar_FreezeBombTicks.IntValue;
g_FreezeBombSerial[client] = ++g_Serial_Gen; g_FreezeBombSerial[client] = ++g_Serial_Gen;
CreateTimer(1.0, Timer_FreezeBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS); CreateTimer(1.0, Timer_FreezeBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
} }
@ -229,7 +229,7 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
if (g_FreezeBombTime[client] > 1) if (g_FreezeBombTime[client] > 1)
{ {
color = RoundToFloor(g_FreezeBombTime[client] * (255.0 / GetConVarFloat(g_Cvar_FreezeBombTicks))); color = RoundToFloor(g_FreezeBombTime[client] * (255.0 / g_Cvar_FreezeBombTicks.FloatValue));
if (g_BeepSound[0]) if (g_BeepSound[0])
{ {
EmitAmbientSound(g_BeepSound, vec, client, SNDLEVEL_RAIDSIREN); EmitAmbientSound(g_BeepSound, vec, client, SNDLEVEL_RAIDSIREN);
@ -246,7 +246,7 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
SetEntityRenderColor(client, color, color, 255, 255); SetEntityRenderColor(client, color, color, 255, 255);
decl String:name[64]; char name[64];
GetClientName(client, name, sizeof(name)); GetClientName(client, name, sizeof(name));
PrintCenterTextAll("%t", "Till Explodes", name, g_FreezeBombTime[client]); PrintCenterTextAll("%t", "Till Explodes", name, g_FreezeBombTime[client]);
@ -255,9 +255,9 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
GetClientAbsOrigin(client, vec); GetClientAbsOrigin(client, vec);
vec[2] += 10; vec[2] += 10;
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_FreezeBombRadius) / 3.0, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_FreezeBombRadius.FloatValue / 3.0, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0);
TE_SendToAll(); TE_SendToAll();
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_FreezeBombRadius) / 3.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, whiteColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_FreezeBombRadius.FloatValue / 3.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, whiteColor, 10, 0);
TE_SendToAll(); TE_SendToAll();
} }
return Plugin_Continue; return Plugin_Continue;
@ -266,7 +266,7 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
{ {
if (g_ExplosionSprite > -1) if (g_ExplosionSprite > -1)
{ {
TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_FreezeBombRadius), 5000); TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, g_Cvar_FreezeBombRadius.IntValue, 5000);
TE_SendToAll(); TE_SendToAll();
} }
@ -276,13 +276,13 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
} }
KillFreezeBomb(client); KillFreezeBomb(client);
FreezeClient(client, GetConVarInt(g_Cvar_FreezeDuration)); FreezeClient(client, g_Cvar_FreezeDuration.IntValue);
if (GetConVarInt(g_Cvar_FreezeBombMode) > 0) if (g_Cvar_FreezeBombMode.IntValue > 0)
{ {
new bool:teamOnly = ((GetConVarInt(g_Cvar_FreezeBombMode) == 1) ? true : false); bool teamOnly = ((g_Cvar_FreezeBombMode.IntValue == 1) ? true : false);
for (new i = 1; i <= MaxClients; i++) for (int i = 1; i <= MaxClients; i++)
{ {
if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client) if (!IsClientInGame(i) || !IsPlayerAlive(i) || i == client)
{ {
@ -294,12 +294,12 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
continue; continue;
} }
new Float:pos[3]; float pos[3];
GetClientEyePosition(i, pos); GetClientEyePosition(i, pos);
new Float:distance = GetVectorDistance(vec, pos); float distance = GetVectorDistance(vec, pos);
if (distance > GetConVarFloat(g_Cvar_FreezeBombRadius)) if (distance > g_Cvar_FreezeBombRadius.FloatValue)
{ {
continue; continue;
} }
@ -318,7 +318,7 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
} }
} }
FreezeClient(i, GetConVarInt(g_Cvar_FreezeDuration)); FreezeClient(i, g_Cvar_FreezeDuration.IntValue);
} }
} }
return Plugin_Stop; return Plugin_Stop;
@ -421,7 +421,7 @@ public MenuHandler_Freeze(Handle:menu, MenuAction:action, param1, param2)
new String:name[32]; new String:name[32];
GetClientName(target, name, sizeof(name)); GetClientName(target, name, sizeof(name));
PerformFreeze(param1, target, GetConVarInt(g_Cvar_FreezeDuration)); PerformFreeze(param1, target, g_Cvar_FreezeDuration.IntValue);
ShowActivity2(param1, "[SM] ", "%t", "Froze target", "_s", name); ShowActivity2(param1, "[SM] ", "%t", "Froze target", "_s", name);
} }
@ -479,7 +479,7 @@ public MenuHandler_FreezeBomb(Handle:menu, MenuAction:action, param1, param2)
} }
} }
public Action:Command_Freeze(client, args) public Action Command_Freeze(int client, int args)
{ {
if (args < 1) if (args < 1)
{ {
@ -487,10 +487,10 @@ public Action:Command_Freeze(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
decl String:arg[65]; char arg[65];
GetCmdArg(1, arg, sizeof(arg)); GetCmdArg(1, arg, sizeof(arg));
new seconds = GetConVarInt(g_Cvar_FreezeDuration); int seconds = g_Cvar_FreezeDuration.IntValue;
if (args > 1) if (args > 1)
{ {

View File

@ -34,15 +34,15 @@
new g_TimeBombSerial[MAXPLAYERS+1] = { 0, ... }; new g_TimeBombSerial[MAXPLAYERS+1] = { 0, ... };
new g_TimeBombTime[MAXPLAYERS+1] = { 0, ... }; new g_TimeBombTime[MAXPLAYERS+1] = { 0, ... };
new Handle:g_Cvar_TimeBombTicks = INVALID_HANDLE; ConVar g_Cvar_TimeBombTicks;
new Handle:g_Cvar_TimeBombRadius = INVALID_HANDLE; ConVar g_Cvar_TimeBombRadius;
new Handle:g_Cvar_TimeBombMode = INVALID_HANDLE; ConVar g_Cvar_TimeBombMode;
CreateTimeBomb(client) CreateTimeBomb(client)
{ {
g_TimeBombSerial[client] = ++g_Serial_Gen; g_TimeBombSerial[client] = ++g_Serial_Gen;
CreateTimer(1.0, Timer_TimeBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS); CreateTimer(1.0, Timer_TimeBomb, client | (g_Serial_Gen << 7), DEFAULT_TIMER_FLAGS);
g_TimeBombTime[client] = GetConVarInt(g_Cvar_TimeBombTicks); g_TimeBombTime[client] = g_Cvar_TimeBombTicks.IntValue;
} }
KillTimeBomb(client) KillTimeBomb(client)
@ -80,8 +80,8 @@ PerformTimeBomb(client, target)
public Action:Timer_TimeBomb(Handle:timer, any:value) public Action:Timer_TimeBomb(Handle:timer, any:value)
{ {
new client = value & 0x7f; int client = value & 0x7f;
new serial = value >> 7; int serial = value >> 7;
if (!IsClientInGame(client) if (!IsClientInGame(client)
|| !IsPlayerAlive(client) || !IsPlayerAlive(client)
@ -92,16 +92,16 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
} }
g_TimeBombTime[client]--; g_TimeBombTime[client]--;
new Float:vec[3]; float vec[3];
GetClientEyePosition(client, vec); GetClientEyePosition(client, vec);
if (g_TimeBombTime[client] > 0) if (g_TimeBombTime[client] > 0)
{ {
new color; int color;
if (g_TimeBombTime[client] > 1) if (g_TimeBombTime[client] > 1)
{ {
color = RoundToFloor(g_TimeBombTime[client] * (128.0 / GetConVarFloat(g_Cvar_TimeBombTicks))); color = RoundToFloor(g_TimeBombTime[client] * (128.0 / g_Cvar_TimeBombTicks.FloatValue));
if (g_BeepSound[0]) if (g_BeepSound[0])
{ {
EmitAmbientSound(g_BeepSound, vec, client, SNDLEVEL_RAIDSIREN); EmitAmbientSound(g_BeepSound, vec, client, SNDLEVEL_RAIDSIREN);
@ -118,7 +118,7 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
SetEntityRenderColor(client, 255, 128, color, 255); SetEntityRenderColor(client, 255, 128, color, 255);
decl String:name[64]; char name[64];
GetClientName(client, name, sizeof(name)); GetClientName(client, name, sizeof(name));
PrintCenterTextAll("%t", "Till Explodes", name, g_TimeBombTime[client]); PrintCenterTextAll("%t", "Till Explodes", name, g_TimeBombTime[client]);
@ -127,9 +127,9 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
GetClientAbsOrigin(client, vec); GetClientAbsOrigin(client, vec);
vec[2] += 10; vec[2] += 10;
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_TimeBombRadius) / 3.0, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_TimeBombRadius.FloatValue / 3.0, g_BeamSprite, g_HaloSprite, 0, 15, 0.5, 5.0, 0.0, greyColor, 10, 0);
TE_SendToAll(); TE_SendToAll();
TE_SetupBeamRingPoint(vec, 10.0, GetConVarFloat(g_Cvar_TimeBombRadius) / 3.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, whiteColor, 10, 0); TE_SetupBeamRingPoint(vec, 10.0, g_Cvar_TimeBombRadius.FloatValue / 3.0, g_BeamSprite, g_HaloSprite, 0, 10, 0.6, 10.0, 0.5, whiteColor, 10, 0);
TE_SendToAll(); TE_SendToAll();
} }
return Plugin_Continue; return Plugin_Continue;
@ -138,7 +138,7 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
{ {
if (g_ExplosionSprite > -1) if (g_ExplosionSprite > -1)
{ {
TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, GetConVarInt(g_Cvar_TimeBombRadius), 5000); TE_SetupExplosion(vec, g_ExplosionSprite, 5.0, 1, 0, g_Cvar_TimeBombRadius.IntValue, 5000);
TE_SendToAll(); TE_SendToAll();
} }
@ -151,9 +151,9 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
KillTimeBomb(client); KillTimeBomb(client);
SetEntityRenderColor(client, 255, 255, 255, 255); SetEntityRenderColor(client, 255, 255, 255, 255);
if (GetConVarInt(g_Cvar_TimeBombMode) > 0) if (g_Cvar_TimeBombMode.IntValue > 0)
{ {
new teamOnly = ((GetConVarInt(g_Cvar_TimeBombMode) == 1) ? true : false); int teamOnly = ((g_Cvar_TimeBombMode.IntValue == 1) ? true : false);
for (new i = 1; i <= MaxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
@ -167,18 +167,18 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
continue; continue;
} }
new Float:pos[3]; float pos[3];
GetClientEyePosition(i, pos); GetClientEyePosition(i, pos);
new Float:distance = GetVectorDistance(vec, pos); float distance = GetVectorDistance(vec, pos);
if (distance > GetConVarFloat(g_Cvar_TimeBombRadius)) if (distance > g_Cvar_TimeBombRadius.FloatValue)
{ {
continue; continue;
} }
new damage = 220; new damage = 220;
damage = RoundToFloor(damage * ((GetConVarFloat(g_Cvar_TimeBombRadius) - distance) / GetConVarFloat(g_Cvar_TimeBombRadius))); damage = RoundToFloor(damage * ((g_Cvar_TimeBombRadius.FloatValue - distance) / g_Cvar_TimeBombRadius.FloatValue));
SlapPlayer(i, damage, false); SlapPlayer(i, damage, false);
@ -189,14 +189,14 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
} }
/* ToDo /* ToDo
new Float:dir[3]; float dir[3];
SubtractVectors(vec, pos, dir); SubtractVectors(vec, pos, dir);
TR_TraceRayFilter(vec, dir, MASK_SOLID, RayType_Infinite, TR_Filter_Client); TR_TraceRayFilter(vec, dir, MASK_SOLID, RayType_Infinite, TR_Filter_Client);
if (i == TR_GetEntityIndex()) if (i == TR_GetEntityIndex())
{ {
new damage = 100; new damage = 100;
new radius = GetConVarInt(g_Cvar_TimeBombRadius) / 2; new radius = g_Cvar_TimeBombRadius.IntValue / 2;
if (distance > radius) if (distance > radius)
{ {

View File

@ -52,7 +52,7 @@ DisplayVoteAllTalkMenu(client)
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL); g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
if (GetConVarBool(g_Cvar_Alltalk)) if (g_Cvar_Alltalk.BoolValue)
{ {
SetMenuTitle(g_hVoteMenu, "Votealltalk Off"); SetMenuTitle(g_hVoteMenu, "Votealltalk Off");
} }
@ -101,4 +101,4 @@ public Action:Command_VoteAlltalk(client, args)
DisplayVoteAllTalkMenu(client); DisplayVoteAllTalkMenu(client);
return Plugin_Handled; return Plugin_Handled;
} }

View File

@ -52,7 +52,7 @@ DisplayVoteFFMenu(client)
g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL); g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
if (GetConVarBool(g_Cvar_FF)) if (g_Cvar_FF.BoolValue)
{ {
SetMenuTitle(g_hVoteMenu, "Voteff Off"); SetMenuTitle(g_hVoteMenu, "Voteff Off");
} }
@ -100,4 +100,4 @@ public Action:Command_VoteFF(client, args)
DisplayVoteFFMenu(client); DisplayVoteFFMenu(client);
return Plugin_Handled; return Plugin_Handled;
} }