diff --git a/plugins/basetriggers.sp b/plugins/basetriggers.sp index 7acd8b73..10122319 100644 --- a/plugins/basetriggers.sp +++ b/plugins/basetriggers.sp @@ -48,15 +48,15 @@ public Plugin:myinfo = url = "http://www.sourcemod.net/" }; -new Handle:g_Cvar_TriggerShow = INVALID_HANDLE; -new Handle:g_Cvar_TimeleftInterval = INVALID_HANDLE; -new Handle:g_Cvar_FriendlyFire = INVALID_HANDLE; +ConVar g_Cvar_TriggerShow; +ConVar g_Cvar_TimeleftInterval; +ConVar g_Cvar_FriendlyFire; new Handle:g_Timer_TimeShow = INVALID_HANDLE; -new Handle:g_Cvar_WinLimit = INVALID_HANDLE; -new Handle:g_Cvar_FragLimit = INVALID_HANDLE; -new Handle:g_Cvar_MaxRounds = INVALID_HANDLE; +ConVar g_Cvar_WinLimit; +ConVar g_Cvar_FragLimit; +ConVar g_Cvar_MaxRounds; #define TIMELEFT_ALL_ALWAYS 0 /* Print to all players */ #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("ff", Command_FriendlyFire); - HookConVarChange(g_Cvar_TimeleftInterval, ConVarChange_TimeleftInterval); + g_Cvar_TimeleftInterval.AddChangeHook(ConVarChange_TimeleftInterval); decl String:folder[64]; 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) { - decl String:ctime[64]; + char ctime[64]; FormatTime(ctime, 64, NULL_STRING); - if(GetConVarInt(g_Cvar_TriggerShow)) + if (g_Cvar_TriggerShow.IntValue) { 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) { - decl String:map[64]; + char map[64]; GetCurrentMap(map, sizeof(map)); - if(GetConVarInt(g_Cvar_TriggerShow)) + if (g_Cvar_TriggerShow.IntValue) { 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) { - decl String:map[32]; + char map[32]; GetNextMap(map, sizeof(map)); - if(GetConVarInt(g_Cvar_TriggerShow)) + if (g_Cvar_TriggerShow.IntValue) { if (mapchooser && EndOfMapVoteEnabled() && !HasEndOfMapVoteFinished()) { @@ -323,15 +323,14 @@ public OnClientSayCommand_Post(client, const String:command[], const String:sArg ShowTimeLeft(client, who) { - new bool:lastround = false; - new bool:written = false; - new bool:notimelimit = false; + bool lastround = false; + bool written = false; + bool notimelimit = false; - decl String:finalOutput[1024]; - finalOutput[0] = 0; + char finalOutput[1024]; if (who == TIMELEFT_ALL_ALWAYS - || (who == TIMELEFT_ALL_MAYBE && GetConVarInt(g_Cvar_TriggerShow))) + || (who == TIMELEFT_ALL_MAYBE && g_Cvar_TriggerShow.IntValue)) { client = 0; } @@ -362,9 +361,9 @@ ShowTimeLeft(client, who) 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) { @@ -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) { @@ -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) { @@ -486,7 +485,7 @@ ShowTimeLeft(client, who) } 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); } @@ -503,10 +502,10 @@ ShowTimeLeft(client, who) ShowFriendlyFire(client) { - if (g_Cvar_FriendlyFire != INVALID_HANDLE) + if (g_Cvar_FriendlyFire) { - decl String:phrase[24]; - if (GetConVarBool(g_Cvar_FriendlyFire)) + char phrase[24]; + if (g_Cvar_FriendlyFire.BoolValue) { strcopy(phrase, sizeof(phrase), "Friendly Fire On"); } @@ -515,7 +514,7 @@ ShowFriendlyFire(client) strcopy(phrase, sizeof(phrase), "Friendly Fire Off"); } - if(GetConVarInt(g_Cvar_TriggerShow)) + if (g_Cvar_TriggerShow.IntValue) { PrintToChatAll("[SM] %t", phrase); } diff --git a/plugins/funcommands/beacon.sp b/plugins/funcommands/beacon.sp index bad1b648..1402d823 100644 --- a/plugins/funcommands/beacon.sp +++ b/plugins/funcommands/beacon.sp @@ -33,7 +33,7 @@ new g_BeaconSerial[MAXPLAYERS+1] = { 0, ... }; -new Handle:g_Cvar_BeaconRadius = INVALID_HANDLE; +ConVar g_Cvar_BeaconRadius; CreateBeacon(client) { @@ -86,28 +86,28 @@ public Action:Timer_Beacon(Handle:timer, any:value) return Plugin_Stop; } - new team = GetClientTeam(client); + int team = GetClientTeam(client); - new Float:vec[3]; + float vec[3]; GetClientAbsOrigin(client, vec); vec[2] += 10; 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(); 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) { - 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 { - 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(); diff --git a/plugins/funcommands/fire.sp b/plugins/funcommands/fire.sp index 5bff2839..1e73a4fb 100644 --- a/plugins/funcommands/fire.sp +++ b/plugins/funcommands/fire.sp @@ -34,16 +34,16 @@ new g_FireBombSerial[MAXPLAYERS+1] = { 0, ... }; new g_FireBombTime[MAXPLAYERS+1] = { 0, ... }; -new Handle:g_Cvar_BurnDuration = INVALID_HANDLE; -new Handle:g_Cvar_FireBombTicks = INVALID_HANDLE; -new Handle:g_Cvar_FireBombRadius = INVALID_HANDLE; -new Handle:g_Cvar_FireBombMode = INVALID_HANDLE; +ConVar g_Cvar_BurnDuration; +ConVar g_Cvar_FireBombTicks; +ConVar g_Cvar_FireBombRadius; +ConVar g_Cvar_FireBombMode; CreateFireBomb(client) { g_FireBombSerial[client] = ++g_Serial_Gen; 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) @@ -99,16 +99,16 @@ public Action:Timer_FireBomb(Handle:timer, any:value) } g_FireBombTime[client]--; - new Float:vec[3]; + float vec[3]; GetClientEyePosition(client, vec); if (g_FireBombTime[client] > 0) { - new color; + int color; 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]) { 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); - decl String:name[64]; + char name[64]; GetClientName(client, name, sizeof(name)); PrintCenterTextAll("%t", "Till Explodes", name, g_FireBombTime[client]); @@ -134,9 +134,9 @@ public Action:Timer_FireBomb(Handle:timer, any:value) GetClientAbsOrigin(client, vec); 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_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(); } return Plugin_Continue; @@ -145,7 +145,7 @@ public Action:Timer_FireBomb(Handle:timer, any:value) { 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(); } @@ -153,16 +153,16 @@ public Action:Timer_FireBomb(Handle:timer, any:value) { GetClientAbsOrigin(client, vec); 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(); 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(); 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(); 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(); } @@ -171,13 +171,13 @@ public Action:Timer_FireBomb(Handle:timer, any:value) EmitAmbientSound(g_BoomSound, vec, client, SNDLEVEL_RAIDSIREN); } - IgniteEntity(client, GetConVarFloat(g_Cvar_BurnDuration)); + IgniteEntity(client, g_Cvar_BurnDuration.FloatValue); KillFireBomb(client); 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++) { @@ -191,18 +191,18 @@ public Action:Timer_FireBomb(Handle:timer, any:value) continue; } - new Float:pos[3]; + float pos[3]; 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; } - new Float:duration = GetConVarFloat(g_Cvar_BurnDuration); - duration *= (GetConVarFloat(g_Cvar_FireBombRadius) - distance) / GetConVarFloat(g_Cvar_FireBombRadius); + float duration = g_Cvar_BurnDuration.FloatValue; + duration *= (g_Cvar_FireBombRadius.FloatValue - distance) / g_Cvar_FireBombRadius.FloatValue; IgniteEntity(i, duration); } @@ -372,14 +372,14 @@ public Action:Command_Burn(client, args) return Plugin_Handled; } - decl String:arg[65]; + char arg[65]; GetCmdArg(1, arg, sizeof(arg)); - new Float:seconds = GetConVarFloat(g_Cvar_BurnDuration); + float seconds = g_Cvar_BurnDuration.FloatValue; if (args > 1) { - decl String:time[20]; + char time[20]; GetCmdArg(2, time, sizeof(time)); if (StringToFloatEx(time, seconds) == 0) { @@ -388,8 +388,9 @@ public Action:Command_Burn(client, args) } } - decl String:target_name[MAX_TARGET_LENGTH]; - decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; + char target_name[MAX_TARGET_LENGTH]; + int target_list[MAXPLAYERS], target_count; + bool tn_is_ml; if ((target_count = ProcessTargetString( arg, @@ -430,11 +431,12 @@ public Action:Command_FireBomb(client, args) return Plugin_Handled; } - decl String:arg[65]; + char arg[65]; GetCmdArg(1, arg, sizeof(arg)); - decl String:target_name[MAX_TARGET_LENGTH]; - decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; + char target_name[MAX_TARGET_LENGTH]; + int target_list[MAXPLAYERS], target_count; + bool tn_is_ml; if ((target_count = ProcessTargetString( arg, diff --git a/plugins/funcommands/ice.sp b/plugins/funcommands/ice.sp index 0275c52e..8de9701d 100644 --- a/plugins/funcommands/ice.sp +++ b/plugins/funcommands/ice.sp @@ -36,10 +36,10 @@ new g_FreezeBombSerial[MAXPLAYERS+1] = { 0, ... }; new g_FreezeTime[MAXPLAYERS+1] = { 0, ... }; new g_FreezeBombTime[MAXPLAYERS+1] = { 0, ... }; -new Handle:g_Cvar_FreezeDuration = INVALID_HANDLE; -new Handle:g_Cvar_FreezeBombTicks = INVALID_HANDLE; -new Handle:g_Cvar_FreezeBombRadius = INVALID_HANDLE; -new Handle:g_Cvar_FreezeBombMode = INVALID_HANDLE; +ConVar g_Cvar_FreezeDuration; +ConVar g_Cvar_FreezeBombTicks; +ConVar g_Cvar_FreezeBombRadius; +ConVar g_Cvar_FreezeBombMode; FreezeClient(client, time) { @@ -93,7 +93,7 @@ CreateFreezeBomb(client) KillFreezeBomb(client); return; } - g_FreezeBombTime[client] = GetConVarInt(g_Cvar_FreezeBombTicks); + g_FreezeBombTime[client] = g_Cvar_FreezeBombTicks.IntValue; g_FreezeBombSerial[client] = ++g_Serial_Gen; 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) { - 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]) { 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); - decl String:name[64]; + char name[64]; GetClientName(client, name, sizeof(name)); PrintCenterTextAll("%t", "Till Explodes", name, g_FreezeBombTime[client]); @@ -255,9 +255,9 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value) GetClientAbsOrigin(client, vec); 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_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(); } return Plugin_Continue; @@ -266,7 +266,7 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value) { 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(); } @@ -276,13 +276,13 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value) } 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) { @@ -294,12 +294,12 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value) continue; } - new Float:pos[3]; + float pos[3]; 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; } @@ -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; @@ -421,7 +421,7 @@ public MenuHandler_Freeze(Handle:menu, MenuAction:action, param1, param2) new String:name[32]; 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); } @@ -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) { @@ -487,10 +487,10 @@ public Action:Command_Freeze(client, args) return Plugin_Handled; } - decl String:arg[65]; + char arg[65]; GetCmdArg(1, arg, sizeof(arg)); - new seconds = GetConVarInt(g_Cvar_FreezeDuration); + int seconds = g_Cvar_FreezeDuration.IntValue; if (args > 1) { diff --git a/plugins/funcommands/timebomb.sp b/plugins/funcommands/timebomb.sp index 182a3bcb..cc659cf0 100644 --- a/plugins/funcommands/timebomb.sp +++ b/plugins/funcommands/timebomb.sp @@ -34,15 +34,15 @@ new g_TimeBombSerial[MAXPLAYERS+1] = { 0, ... }; new g_TimeBombTime[MAXPLAYERS+1] = { 0, ... }; -new Handle:g_Cvar_TimeBombTicks = INVALID_HANDLE; -new Handle:g_Cvar_TimeBombRadius = INVALID_HANDLE; -new Handle:g_Cvar_TimeBombMode = INVALID_HANDLE; +ConVar g_Cvar_TimeBombTicks; +ConVar g_Cvar_TimeBombRadius; +ConVar g_Cvar_TimeBombMode; CreateTimeBomb(client) { g_TimeBombSerial[client] = ++g_Serial_Gen; 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) @@ -80,8 +80,8 @@ PerformTimeBomb(client, target) public Action:Timer_TimeBomb(Handle:timer, any:value) { - new client = value & 0x7f; - new serial = value >> 7; + int client = value & 0x7f; + int serial = value >> 7; if (!IsClientInGame(client) || !IsPlayerAlive(client) @@ -92,16 +92,16 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) } g_TimeBombTime[client]--; - new Float:vec[3]; + float vec[3]; GetClientEyePosition(client, vec); if (g_TimeBombTime[client] > 0) { - new color; + int color; 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]) { 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); - decl String:name[64]; + char name[64]; GetClientName(client, name, sizeof(name)); PrintCenterTextAll("%t", "Till Explodes", name, g_TimeBombTime[client]); @@ -127,9 +127,9 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) GetClientAbsOrigin(client, vec); 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_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(); } return Plugin_Continue; @@ -138,7 +138,7 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) { 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(); } @@ -151,9 +151,9 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) KillTimeBomb(client); 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++) { @@ -167,18 +167,18 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) continue; } - new Float:pos[3]; + float pos[3]; 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; } 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); @@ -189,14 +189,14 @@ public Action:Timer_TimeBomb(Handle:timer, any:value) } /* ToDo - new Float:dir[3]; + float dir[3]; SubtractVectors(vec, pos, dir); TR_TraceRayFilter(vec, dir, MASK_SOLID, RayType_Infinite, TR_Filter_Client); if (i == TR_GetEntityIndex()) { new damage = 100; - new radius = GetConVarInt(g_Cvar_TimeBombRadius) / 2; + new radius = g_Cvar_TimeBombRadius.IntValue / 2; if (distance > radius) { diff --git a/plugins/funvotes/votealltalk.sp b/plugins/funvotes/votealltalk.sp index 561b2274..51fefd75 100644 --- a/plugins/funvotes/votealltalk.sp +++ b/plugins/funvotes/votealltalk.sp @@ -52,7 +52,7 @@ DisplayVoteAllTalkMenu(client) g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL); - if (GetConVarBool(g_Cvar_Alltalk)) + if (g_Cvar_Alltalk.BoolValue) { SetMenuTitle(g_hVoteMenu, "Votealltalk Off"); } @@ -101,4 +101,4 @@ public Action:Command_VoteAlltalk(client, args) DisplayVoteAllTalkMenu(client); return Plugin_Handled; -} \ No newline at end of file +} diff --git a/plugins/funvotes/voteff.sp b/plugins/funvotes/voteff.sp index e12934cc..9fbb045c 100644 --- a/plugins/funvotes/voteff.sp +++ b/plugins/funvotes/voteff.sp @@ -52,7 +52,7 @@ DisplayVoteFFMenu(client) g_hVoteMenu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL); - if (GetConVarBool(g_Cvar_FF)) + if (g_Cvar_FF.BoolValue) { SetMenuTitle(g_hVoteMenu, "Voteff Off"); } @@ -100,4 +100,4 @@ public Action:Command_VoteFF(client, args) DisplayVoteFFMenu(client); return Plugin_Handled; -} \ No newline at end of file +}