Skip to content
This repository was archived by the owner on Oct 30, 2019. It is now read-only.

Commit 07ae8dc

Browse files
CleversonCleverson
authored andcommitted
Fixed type names for some functions
Fixed type names for some functions
1 parent a556694 commit 07ae8dc

File tree

3 files changed

+39
-90
lines changed

3 files changed

+39
-90
lines changed

addons/amxmodx/scripting/PugAdmin.sma

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ new g_iAdminCount;
1414
#define ADMIN_IPADDR (1<<3)
1515
#define ADMIN_NAME (1<<4)
1616

17-
new bool:g_bCaseSensitiveName[33];
17+
new bool:g_bCaseSensitiveName[MAX_PLAYERS+1];
1818

1919
new g_pMode;
2020
new g_pPasswordField;
@@ -73,7 +73,7 @@ public plugin_cfg()
7373
return g_iAdminCount;
7474
}
7575

76-
PugGetAccess(id,sName[],sAuth[],sIP[],sPassword[])
76+
fnGetAccess(id,sName[],sAuth[],sIP[],sPassword[])
7777
{
7878
new index = -1;
7979
new iResult = 0;
@@ -227,7 +227,7 @@ PugGetAccess(id,sName[],sAuth[],sIP[],sPassword[])
227227
return iResult;
228228
}
229229

230-
PugAccessUser(id,sName[] = "")
230+
fnSetAccess(id,sName[] = "")
231231
{
232232
remove_user_flags(id);
233233
new sIP[32],sAuth[32],sPassword[32],sPwField[32],sUserName[32];
@@ -247,7 +247,7 @@ PugAccessUser(id,sName[] = "")
247247
get_pcvar_string(g_pPasswordField,sPwField,charsmax(sPwField));
248248
get_user_info(id,sPwField,sPassword,charsmax(sPassword));
249249

250-
new iResult = PugGetAccess(id,sUserName,sAuth,sIP,sPassword);
250+
new iResult = fnGetAccess(id,sUserName,sAuth,sIP,sPassword);
251251

252252
if(iResult & 1)
253253
{
@@ -286,14 +286,14 @@ public client_infochanged(id)
286286
{
287287
if(!equal(sName[0],sName[1]))
288288
{
289-
PugAccessUser(id,sName[1]);
289+
fnSetAccess(id,sName[1]);
290290
}
291291
}
292292
else
293293
{
294294
if(!equali(sName[0],sName[1]))
295295
{
296-
PugAccessUser(id,sName[1]);
296+
fnSetAccess(id,sName[1]);
297297
}
298298
}
299299
}
@@ -305,14 +305,14 @@ public client_authorized(id)
305305
{
306306
g_bCaseSensitiveName[id] = false;
307307

308-
return get_pcvar_num(g_pMode) ? PugAccessUser(id) : PLUGIN_CONTINUE;
308+
return get_pcvar_num(g_pMode) ? fnSetAccess(id) : PLUGIN_CONTINUE;
309309
}
310310

311311
public client_putinserver(id)
312312
{
313313
if(!is_dedicated_server() && (id == 1))
314314
{
315-
return get_pcvar_num(g_pMode) ? PugAccessUser(id) : PLUGIN_CONTINUE;
315+
return get_pcvar_num(g_pMode) ? fnSetAccess(id) : PLUGIN_CONTINUE;
316316
}
317317

318318
return PLUGIN_CONTINUE;

addons/amxmodx/scripting/PugAux.sma

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
#pragma semicolon 1
1313

14-
new g_iHits[MAX_PLAYERS][MAX_PLAYERS];
15-
new g_iDamage[MAX_PLAYERS][MAX_PLAYERS];
14+
new g_iHits[MAX_PLAYERS+1][MAX_PLAYERS+1];
15+
new g_iDamage[MAX_PLAYERS+1][MAX_PLAYERS+1];
1616

1717
new bool:g_bRound;
1818

@@ -23,16 +23,16 @@ public plugin_init()
2323
register_dictionary("PugCore.txt");
2424
register_dictionary("PugAux.txt");
2525

26-
PugRegisterCommand("hp","CommandHP",ADMIN_ALL,"PUG_DESC_HP");
27-
PugRegisterCommand("dmg","CommandDamage",ADMIN_ALL,"PUG_DESC_DMG");
28-
PugRegisterCommand("rdmg","CommandRecivedDamage",ADMIN_ALL,"PUG_DESC_RDMG");
29-
PugRegisterCommand("sum","CommandSummary",ADMIN_ALL,"PUG_DESC_SUM");
26+
PugRegisterCommand("hp","fnHP",ADMIN_ALL,"PUG_DESC_HP");
27+
PugRegisterCommand("dmg","fnDamage",ADMIN_ALL,"PUG_DESC_DMG");
28+
PugRegisterCommand("rdmg","fnRecivedDamage",ADMIN_ALL,"PUG_DESC_RDMG");
29+
PugRegisterCommand("sum","fnSummary",ADMIN_ALL,"PUG_DESC_SUM");
3030

31-
PugRegisterAdminCommand("kick","CommandKick",PUG_CMD_LVL,"PUG_DESC_KICK");
32-
PugRegisterAdminCommand("map","CommandMap",PUG_CMD_LVL,"PUG_DESC_MAP");
33-
PugRegisterAdminCommand("msg","CommandMessage",PUG_CMD_LVL,"PUG_DESC_MSG");
34-
PugRegisterAdminCommand("kill","CommandKill",PUG_CMD_LVL,"PUG_DESC_KILL");
35-
PugRegisterAdminCommand("rcon","CommandRcon",PUG_CMD_LVL,"PUG_DESC_RCON");
31+
PugRegisterAdminCommand("kick","fnKick",PUG_CMD_LVL,"PUG_DESC_KICK");
32+
PugRegisterAdminCommand("map","fnMap",PUG_CMD_LVL,"PUG_DESC_MAP");
33+
PugRegisterAdminCommand("msg","fnMessage",PUG_CMD_LVL,"PUG_DESC_MSG");
34+
PugRegisterAdminCommand("kill","fnKill",PUG_CMD_LVL,"PUG_DESC_KILL");
35+
PugRegisterAdminCommand("rcon","fnRcon",PUG_CMD_LVL,"PUG_DESC_RCON");
3636
}
3737

3838
public client_disconnected(id,bool:bDrop,szMessage[],iLen)
@@ -66,7 +66,7 @@ public PugEventRoundEnd()
6666
g_bRound = false;
6767
}
6868

69-
public CommandHP(id)
69+
public fnHP(id)
7070
{
7171
new iStage = GET_PUG_STAGE();
7272

@@ -127,7 +127,7 @@ public CommandHP(id)
127127
return PLUGIN_HANDLED;
128128
}
129129

130-
public CommandDamage(id)
130+
public fnDamage(id)
131131
{
132132
new iStage = GET_PUG_STAGE();
133133

@@ -211,7 +211,7 @@ public CommandDamage(id)
211211
return PLUGIN_HANDLED;
212212
}
213213

214-
public CommandRecivedDamage(id)
214+
public fnRecivedDamage(id)
215215
{
216216
new iStage = GET_PUG_STAGE();
217217

@@ -295,7 +295,7 @@ public CommandRecivedDamage(id)
295295
return PLUGIN_HANDLED;
296296
}
297297

298-
public CommandSummary(id)
298+
public fnSummary(id)
299299
{
300300
new iStage = GET_PUG_STAGE();
301301

@@ -370,7 +370,7 @@ public CommandSummary(id)
370370
return PLUGIN_HANDLED;
371371
}
372372

373-
public CommandKick(id)
373+
public fnKick(id)
374374
{
375375
if(!access(id,PUG_CMD_LVL) && (id != 0))
376376
{
@@ -391,14 +391,7 @@ public CommandKick(id)
391391
read_argv(2,sReason,charsmax(sReason));
392392
remove_quotes(sReason);
393393

394-
if(sReason[0])
395-
{
396-
PugDisconnect(iPlayer,sReason);
397-
}
398-
else
399-
{
400-
PugDisconnect(iPlayer);
401-
}
394+
server_cmd("kick #%i %s",get_user_userid(iPlayer),sReason);
402395
}
403396
else
404397
{
@@ -409,7 +402,7 @@ public CommandKick(id)
409402
return PLUGIN_HANDLED;
410403
}
411404

412-
public CommandMap(id)
405+
public fnMap(id)
413406
{
414407
if(!access(id,PUG_CMD_LVL) && (id != 0))
415408
{
@@ -434,7 +427,7 @@ public CommandMap(id)
434427
return PLUGIN_HANDLED;
435428
}
436429

437-
public CommandMessage(id)
430+
public fnMessage(id)
438431
{
439432
if(!access(id,PUG_CMD_LVL) && (id != 0))
440433
{
@@ -459,7 +452,7 @@ public CommandMessage(id)
459452
return PLUGIN_HANDLED;
460453
}
461454

462-
public CommandKill(id)
455+
public fnKill(id)
463456
{
464457
if(!access(id,PUG_CMD_LVL) && (id != 0))
465458
{
@@ -485,7 +478,7 @@ public CommandKill(id)
485478
return PLUGIN_HANDLED;
486479
}
487480

488-
public CommandRcon(id)
481+
public fnRcon(id)
489482
{
490483
if(!access(id,PUG_CMD_LVL) && (id != 0))
491484
{

addons/amxmodx/scripting/PugConfigs.sma

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ new g_pHalfTime;
1414
new g_pOvertime;
1515
new g_pFinished;
1616

17-
new g_pPlayersMax;
18-
new g_pVisibleMaxPlayers;
19-
20-
new bool:g_bLive;
21-
2217
public plugin_init()
2318
{
2419
register_plugin("Pug Mod (Configs)",PUG_MOD_VERSION,PUG_MOD_AUTHOR);
@@ -30,88 +25,49 @@ public plugin_init()
3025
g_pHalfTime = create_cvar("pug_config_halftime","halftime.rc",FCVAR_NONE,"Used at half-time session");
3126
g_pOvertime = create_cvar("pug_config_overtime","esl-ot.rc",FCVAR_NONE,"Used at Overtime session");
3227
g_pFinished = create_cvar("pug_config_end","end.rc",FCVAR_NONE,"Executed when the match ends");
33-
34-
g_pPlayersMax = get_cvar_pointer("pug_players_max");
35-
g_pVisibleMaxPlayers = get_cvar_pointer("sv_visiblemaxplayers");
3628
}
3729

3830
public plugin_cfg()
3931
{
40-
g_bLive = false;
41-
42-
Exec(g_pPugMod);
43-
44-
set_pcvar_num(g_pVisibleMaxPlayers,get_pcvar_num(g_pPlayersMax));
45-
}
46-
47-
public client_authorized(id)
48-
{
49-
if(g_bLive)
50-
{
51-
set_pcvar_num(g_pVisibleMaxPlayers,get_pcvar_num(g_pPlayersMax));
52-
}
53-
}
54-
55-
public client_disconnected(id,bool:bDrop,szMessage[],iLen)
56-
{
57-
if(g_bLive)
58-
{
59-
set_pcvar_num(g_pVisibleMaxPlayers,get_pcvar_num(g_pPlayersMax) + 1);
60-
}
32+
fnExec(g_pPugMod);
6133
}
6234

6335
public PugEventWarmup()
6436
{
65-
g_bLive = false;
66-
67-
Exec(g_pWarmup);
68-
69-
set_pcvar_num(g_pVisibleMaxPlayers,get_pcvar_num(g_pPlayersMax));
37+
fnExec(g_pWarmup);
7038
}
7139

7240
public PugEventStart()
7341
{
74-
g_bLive = false;
75-
76-
Exec(g_pStart);
42+
fnExec(g_pStart);
7743
}
7844

7945
public PugEventFirstHalf()
8046
{
81-
g_bLive = true;
82-
83-
Exec(g_pLive);
47+
fnExec(g_pLive);
8448
}
8549

8650
public PugEventHalfTime()
8751
{
88-
g_bLive = true;
89-
90-
Exec(g_pHalfTime);
52+
fnExec(g_pHalfTime);
9153
}
9254

9355
public PugEventSecondHalf()
9456
{
95-
g_bLive = true;
96-
97-
Exec(g_pLive);
57+
fnExec(g_pLive);
9858
}
9959

10060
public PugEventOvertime()
10161
{
102-
g_bLive = true;
103-
104-
Exec(g_pOvertime);
62+
fnExec(g_pOvertime);
10563
}
10664

10765
public PugEventEnd()
10866
{
109-
g_bLive = false;
110-
111-
Exec(g_pFinished);
67+
fnExec(g_pFinished);
11268
}
11369

114-
Exec(hConvar)
70+
fnExec(hConvar)
11571
{
11672
new sFile[32];
11773
get_pcvar_string(hConvar,sFile,charsmax(sFile));
@@ -126,4 +82,4 @@ Exec(hConvar)
12682
server_cmd("exec %s",sDir);
12783
server_exec();
12884
}
129-
}
85+
}

0 commit comments

Comments
 (0)