Skip to content

Commit b6bda49

Browse files
Update codestyle & minor changes (#264)
* update links * antiflood: delete semicolon * pgbans: remove semicolons * pgbans: update codestyle * csbans: remove semicolons * minor codestyle changes * remove semicolons * pgbans: fix compile * update names * Rank restrictions: remove extra spaces * Rank restrictions: minor changes * Request UnGAG: remove extra space * Rank restrictions: remove semicolons
1 parent 23c1066 commit b6bda49

File tree

11 files changed

+399
-364
lines changed

11 files changed

+399
-364
lines changed

cstrike/addons/amxmodx/scripting/CA_Addon_DeathMute.sma

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ new g_syncHudOj
3131
public stock const PluginName[] = "CA Addon: Death mute"
3232
public stock const PluginVersion[] = CA_VERSION
3333
public stock const PluginAuthor[] = "Sergey Shorokhov"
34-
public stock const PluginURL[] = "github.com/ChatAdditions/ChatsAdditions_AMXX"
34+
public stock const PluginURL[] = "https://github.com/ChatAdditions/"
3535
public stock const PluginDescription[] = "Alive players don't hear dead players after 5 secs"
3636

3737
public plugin_init() {
3838
register_plugin(PluginName, PluginVersion, PluginAuthor)
3939

4040
register_dictionary("CA_Addon_DeathMute.txt")
4141

42-
Register_CVars()
42+
Create_CVars()
4343

4444
AutoExecConfig(true, "CA_Addon_DeathMute", "ChatAdditions")
4545

@@ -49,7 +49,7 @@ public plugin_init() {
4949
g_syncHudOj = CreateHudSyncObj()
5050
}
5151

52-
Register_CVars() {
52+
Create_CVars() {
5353
bind_pcvar_float(create_cvar("ca_deathmute_time", "5.0",
5454
.description = "Time (in seconds) for killed players, during which they can report information to living players.\n\
5555
0 - disabled functionality",

cstrike/addons/amxmodx/scripting/CA_Addon_RankRestrictions.sma

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
#include <ChatAdditions>
33

44
#pragma ctrlchar '\'
5+
#pragma tabsize 2
56

67
// Natives
7-
native aes_get_player_level(const player)
8-
native ar_get_user_level(const player, rankName[] = "", len = 0)
9-
native crxranks_get_user_level(const player)
10-
native cmsranks_get_user_level(id, szLevel[] = "", len = 0)
11-
native csstats_get_user_stats(const player, const stats[22])
12-
native Float:cmsstats_get_user_skill(index, skillname[] = "", namelen = 0, &skill_level = 0);
13-
native get_user_skill(player,&Float:skill)
14-
native get_user_stats(index,stats[STATSX_MAX_STATS],bodyhits[MAX_BODYHITS]);
8+
native aes_get_player_level(const player);
9+
native ar_get_user_level(const player, rankName[] = "", len = 0);
10+
native crxranks_get_user_level(const player);
11+
native cmsranks_get_user_level(player, szLevel[] = "", len = 0);
12+
native csstats_get_user_stats(const player, const stats[22]);
13+
native Float:cmsstats_get_user_skill(player, skillname[] = "", namelen = 0, &skill_level = 0);
14+
native get_user_skill(player, &Float: skill);
15+
native get_user_stats(player, stats[STATSX_MAX_STATS], bodyhits[MAX_BODYHITS]);
1516
//
1617

1718

18-
static ca_rankrestrictions_type,
19+
new ca_rankrestrictions_type,
1920
ca_rankrestrictions_min_kills,
2021
ca_rankrestrictions_type_level,
2122
ca_rankrestrictions_min_level,
@@ -25,14 +26,14 @@ static ca_rankrestrictions_type,
2526
public stock const PluginName[] = "CA Addon: Rank restrictions"
2627
public stock const PluginVersion[] = CA_VERSION
2728
public stock const PluginAuthor[] = "steelzzz"
28-
public stock const PluginURL[] = "github.com/ChatAdditions/ChatsAdditions_AMXX"
29+
public stock const PluginURL[] = "https://github.com/ChatAdditions/"
2930
public stock const PluginDescription[] = "Restrict chat until you reach the rank of a statistic"
3031

3132
public plugin_init() {
3233
register_plugin(PluginName, PluginVersion, PluginAuthor)
3334
register_dictionary("CA_Addon_RankRestrictions.txt")
3435

35-
Register_CVars()
36+
Create_CVars()
3637

3738
AutoExecConfig(true, "CA_Addon_RankRestrictions", "ChatAdditions")
3839
}
@@ -43,31 +44,31 @@ public plugin_natives() {
4344

4445
public native_filter(const name[], index, trap) {
4546
if(strcmp(name, "aes_get_player_level"))
46-
return PLUGIN_HANDLED
47+
return PLUGIN_HANDLED
4748

4849
if(strcmp(name, "ar_get_user_level"))
49-
return PLUGIN_HANDLED
50+
return PLUGIN_HANDLED
5051

5152
if(strcmp(name, "crxranks_get_user_level"))
52-
return PLUGIN_HANDLED
53+
return PLUGIN_HANDLED
5354

5455
if(strcmp(name, "csstats_get_user_stats"))
55-
return PLUGIN_HANDLED
56+
return PLUGIN_HANDLED
5657

5758
if(strcmp(name, "cmsranks_get_user_level"))
58-
return PLUGIN_HANDLED;
59+
return PLUGIN_HANDLED
5960

6061
if(strcmp(name, "cmsstats_get_user_skill"))
61-
return PLUGIN_HANDLED;
62+
return PLUGIN_HANDLED
6263

6364
if(strcmp(name, "get_user_stats"))
64-
return PLUGIN_HANDLED;
65+
return PLUGIN_HANDLED
6566

6667
return PLUGIN_CONTINUE
6768
}
6869

69-
static Register_CVars() {
70-
bind_pcvar_num(create_cvar("ca_rankrestrictions_type", "1",
70+
Create_CVars() {
71+
bind_pcvar_num(create_cvar("ca_rankrestrictions_type", "1",
7172
.description = "Restrictions Types\n\
7273
0 - Disable restrictions\n\
7374
1 - Level restrictions\n\
@@ -140,7 +141,7 @@ public CA_Client_Voice(const listener, const sender) {
140141
return CanCommunicate(sender, false) ? CA_CONTINUE : CA_SUPERCEDE
141142
}
142143

143-
static bool: CanCommunicate(const player, const bool: print = true) {
144+
bool: CanCommunicate(const player, const bool: print = true) {
144145
if(ca_rankrestrictions_type <= 0)
145146
return true
146147

@@ -171,7 +172,7 @@ static bool: CanCommunicate(const player, const bool: print = true) {
171172
return true
172173
}
173174

174-
static GetUserLevel(const player) {
175+
GetUserLevel(const player) {
175176
switch(ca_rankrestrictions_type_level) {
176177
case 0: return aes_get_player_level(player)
177178
case 1: return ar_get_user_level(player)
@@ -200,7 +201,7 @@ static GetUserLevel(const player) {
200201
return 0
201202
}
202203

203-
static GetUserFragsFromStats(const player) {
204+
GetUserFragsFromStats(const player) {
204205
enum { stats_Frags/* , stats_Deaths, stats_Rounds = 16 */ }
205206

206207
switch(ca_rankrestrictions_type_kills)

cstrike/addons/amxmodx/scripting/CA_Addon_RequestUnGag.sma

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,29 @@
77
#pragma ctrlchar '\'
88
#pragma tabsize 2
99

10-
static Float: g_userNextRequestTime[MAX_PLAYERS + 1]
10+
new Float: g_userNextRequestTime[MAX_PLAYERS + 1]
1111

12-
static ca_requestungag_cmd[32],
13-
Float: ca_requestungag_delay
14-
15-
static ca_gag_access_flags_high[32], ca_gag_access_flags[32]
12+
new ca_requestungag_cmd[32],
13+
Float: ca_requestungag_delay,
14+
ca_gag_access_flags_high[32],
15+
ca_gag_access_flags[32]
1616

1717
public stock const PluginName[] = "CA Addon: Request UnGAG"
1818
public stock const PluginVersion[] = CA_VERSION
1919
public stock const PluginAuthor[] = "steelzzz"
20-
public stock const PluginURL[] = "github.com/ChatAdditions/ChatsAdditions_AMXX"
20+
public stock const PluginURL[] = "https://github.com/ChatAdditions/"
2121
public stock const PluginDescription[] = "A player can apologize to the administration"
2222

2323
public plugin_init() {
2424
register_plugin(PluginName, PluginVersion, PluginAuthor)
2525
register_dictionary("CA_Addon_RequestUngag.txt")
2626

27-
Register_CVars()
27+
Create_CVars()
28+
2829
AutoExecConfig(true, "CA_Addon_RequestUnGag", "ChatAdditions")
2930
}
3031

31-
public Register_CVars() {
32+
public Create_CVars() {
3233
bind_pcvar_string(create_cvar("ca_requestungag_cmd", "/sorry",
3334
.description = "Request ungag command"),
3435
ca_requestungag_cmd, charsmax(ca_requestungag_cmd)

cstrike/addons/amxmodx/scripting/CA_AntiFlood.sma

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ new Float: ca_anti_flood_time,
1212
public stock const PluginName[] = "CA: Anti Flood"
1313
public stock const PluginVersion[] = CA_VERSION
1414
public stock const PluginAuthor[] = "Nordic Warrior"
15-
public stock const PluginURL[] = "https://github.com/ChatAdditions"
15+
public stock const PluginURL[] = "https://github.com/ChatAdditions/"
1616
public stock const PluginDescription[] = "Antiflood for chat"
1717

1818
public plugin_init() {
1919
register_plugin(PluginName, PluginVersion, PluginAuthor)
2020

2121
register_dictionary("CA_AntiFlood.txt")
2222

23-
CreateCVars()
23+
Create_CVars()
24+
2425
AutoExecConfig(true, "CA_AntiFlood", "ChatAdditions")
2526
}
2627

@@ -41,7 +42,7 @@ public CA_Client_SayTeam(id, const message[]) {
4142

4243
CheckMessage(id, const message[]) {
4344
if(message[0] == '/') {
44-
return CA_CONTINUE;
45+
return CA_CONTINUE
4546
}
4647

4748
static Float:nextMessage[MAX_PLAYERS + 1]
@@ -77,7 +78,7 @@ public client_disconnected(id) {
7778
g_OldMessage[id][0] = EOS
7879
}
7980

80-
CreateCVars() {
81+
Create_CVars() {
8182
bind_pcvar_float(
8283
create_cvar(
8384
.name = "ca_anti_flood_time",

cstrike/addons/amxmodx/scripting/CA_Gag.sma

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public plugin_precache() {
7676
register_srvcmd("ca_gag_show_templates", "SrvCmd_ShowTemplates");
7777
register_srvcmd("ca_gag_reload_config", "SrvCmd_ReloadConfig")
7878

79-
Register_CVars()
79+
Create_CVars()
8080

8181
g_gagReasonsTemplates = ArrayCreate(reason_s)
8282
g_gagTimeTemplates = ArrayCreate()
@@ -126,7 +126,7 @@ public plugin_end() {
126126
DestroyForward(g_fwd_gag_removed)
127127
}
128128

129-
Register_CVars() {
129+
Create_CVars() {
130130
bind_pcvar_string(create_cvar("ca_gag_times", "1i, 5i, 10i, 30i, 1h, 1d, 1w, 1m",
131131
.description = "Gag time values for choose\n \
132132
format: 1 = 1 second, 1i = 1 minute, 1h = 1 hour, 1d = 1 day, 1w = 1 week, 1m = 1 month, 1y = 1 year\n \

cstrike/addons/amxmodx/scripting/CA_Mute.sma

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ enum {
2020
ITEM_MUTE_ALL = -1
2121
}
2222

23-
2423
public stock const PluginName[] = "CA: Mute"
2524
public stock const PluginVersion[] = CA_VERSION
2625
public stock const PluginAuthor[] = "Sergey Shorokhov"

cstrike/addons/amxmodx/scripting/CA_Storage_CSBans.sma

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
new const SQL_TBL_GAGS[] = "chatadditions_gags"
2121

2222
const QUERY_LENGTH = 4096
23-
const MAX_REASON_LENGTH = 256;
23+
const MAX_REASON_LENGTH = 256
2424
new g_query[QUERY_LENGTH]
2525

2626
new Handle: g_tuple = Empty_Handle
@@ -35,7 +35,7 @@ new ca_storage_host[64],
3535
public stock const PluginName[] = "ChatAdditions: CSBans storage"
3636
public stock const PluginVersion[] = CA_VERSION
3737
public stock const PluginAuthor[] = "Sergey Shorokhov"
38-
public stock const PluginURL[] = "github.com/ChatAdditions/ChatsAdditions_AMXX"
38+
public stock const PluginURL[] = "https://github.com/ChatAdditions/"
3939
public stock const PluginDescription[] = "CSBans (MySQL) storage provider for ChatAdditions"
4040

4141
public plugin_init() {
@@ -45,7 +45,8 @@ public plugin_init() {
4545
set_fail_state("Can't user 'MySQL'. Check modules.ini")
4646
}
4747

48-
Register_CVars()
48+
Create_CVars()
49+
4950
AutoExecConfig(true, "CA_Storage_CSBans", "ChatAdditions")
5051

5152
g_queueLoad = QueueCreate(MAX_AUTHID_LENGTH)
@@ -77,7 +78,7 @@ public plugin_cfg() {
7778
RegisterForwards()
7879
}
7980

80-
Register_CVars() {
81+
Create_CVars() {
8182
bind_pcvar_string(create_cvar("ca_storage_host", "127.0.0.1", FCVAR_PROTECTED,
8283
.description = "CSBans MySQL database host address"
8384
),
@@ -192,14 +193,14 @@ Storage_Save(const name[], const authID[], const IP[],
192193
return
193194
}
194195

195-
new name_safe[MAX_NAME_LENGTH * 2];
196-
SQL_QuoteString(Empty_Handle, name_safe, charsmax(name_safe), name);
196+
new name_safe[MAX_NAME_LENGTH * 2]
197+
SQL_QuoteString(Empty_Handle, name_safe, charsmax(name_safe), name)
197198

198-
new reason_safe[MAX_REASON_LENGTH * 2];
199-
SQL_QuoteString(Empty_Handle, reason_safe, charsmax(reason_safe), reason);
199+
new reason_safe[MAX_REASON_LENGTH * 2]
200+
SQL_QuoteString(Empty_Handle, reason_safe, charsmax(reason_safe), reason)
200201

201-
new adminName_safe[MAX_NAME_LENGTH * 2];
202-
SQL_QuoteString(Empty_Handle, adminName_safe, charsmax(adminName_safe), adminName);
202+
new adminName_safe[MAX_NAME_LENGTH * 2]
203+
SQL_QuoteString(Empty_Handle, adminName_safe, charsmax(adminName_safe), adminName)
203204

204205
// TODO: Optimize this EPIC QUERY
205206
formatex(g_query, charsmax(g_query), "INSERT INTO %s ", SQL_TBL_GAGS); {
@@ -312,7 +313,7 @@ public handle_Loaded(failstate, Handle: query, error[], errnum, data[], size, Fl
312313
new bool: found = (SQL_NumResults(query) != 0)
313314

314315
if(!found) {
315-
return;
316+
return
316317
}
317318

318319
new name[MAX_NAME_LENGTH]; SQL_ReadResult(query, res_name, name, charsmax(name))

0 commit comments

Comments
 (0)