Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiam
NoCommExtendVote
Commits
febd5851
Commit
febd5851
authored
Oct 20, 2017
by
Neoony
Browse files
v0.9 WIP
- Ported to SourcePawn Transitional Syntax
parent
429bfeba
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
febd5851
...
...
@@ -88,4 +88,5 @@
- Added server commands nc_nce and nc_ncd, which basically do the same thing as sm_nce/sm_ncd but server side
**v0.9 WIP**
- Added updater support (https://git.empiresmod.com/sourcemod/Updater)
\ No newline at end of file
- Added updater support (https://git.empiresmod.com/sourcemod/Updater)
- Ported to SourcePawn Transitional Syntax
\ No newline at end of file
README.md
View file @
febd5851
...
...
@@ -222,4 +222,5 @@ I intend to keep surrender or comm lock as a separate plugins.
-
Added server commands nc_nce and nc_ncd, which basically do the same thing as sm_nce/sm_ncd but server side
**v0.9 WIP**
-
Added updater support (https://git.empiresmod.com/sourcemod/Updater)
\ No newline at end of file
-
Added updater support (https://git.empiresmod.com/sourcemod/Updater)
-
Ported to SourcePawn Transitional Syntax
\ No newline at end of file
addons/sourcemod/scripting/NoCommExtendVote.sp
View file @
febd5851
...
...
@@ -36,6 +36,10 @@ public Plugin myinfo =
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/no_commander_extend_vote/updater.txt"
//Neat
#pragma semicolon 1
#pragma newdecls required
//ConVars
ConVar nc_setvotetime, nc_allowspec, nc_addvotetime, nc_minplayers, nc_msgtimer, nc_marktime, nc_commcheck, nc_commcheckmp, nc_commchecktime, nc_lockspec, nc_lockspecmp, nc_lockspechide, nc_lockspectime, nc_howmanytimese, nc_howmanytimes, nc_alltalkm, nc_alltalkmmp, nc_alltalke, nc_vt, nc_pugc;
...
...
@@ -66,20 +70,20 @@ int nccommcheckxnf;
int nccommcheckxready;
int nccommcheckdone;
int nccommchecktimeron = 0;
new
Handle
:
InfoMessage;
new
Handle
:
CommCheck;
new
Handle
:
CommCheckPre;
new
Handle
:
CommCheckWarn;
new
Handle
:
CommCheckInfo;
Handle
InfoMessage;
Handle
CommCheck;
Handle
CommCheckPre;
Handle
CommCheckWarn;
Handle
CommCheckInfo;
int nclockspec;
int nclockspecmp;
int nclockspecmpnr = 0;
new
Handle
:
LockSpecMinPlayers;
Handle
LockSpecMinPlayers;
int nclockspecstarted = 0;
int nclockspechide;
float nclockspectime;
int nclockspecdone;
new
Handle
:
LockSpecTime;
Handle
LockSpecTime;
int nchowmanytimese;
int nchowmanytimes;
int nchowmanytimesc;
...
...
@@ -102,14 +106,14 @@ int announcedone11 = 0;
int announcedone12 = 0;
int announcedone13 = 0;
int announcedone14 = 0;
new String:
cvars[][] = {"sv_alltalk", "emp_allowspectators", "emp_sv_vote_commander_time"};
char
cvars[][] = {"sv_alltalk", "emp_allowspectators", "emp_sv_vote_commander_time"};
int NCEnableDisable = 1;
int ncalltalkm;
int ncalltalkdone = 0;
int ncvt;
int ncalltalkmmp;
new
Handle
:
AllTalkMinPlayers;
new
Handle
:
AllTalkTimer;
Handle
AllTalkMinPlayers;
Handle
AllTalkTimer;
int ncalltalkmmpnr = 0;
int ncalltalkmmpstarted = 0;
int ncalltalk;
...
...
@@ -164,12 +168,12 @@ public void OnPluginStart()
HookEvent("vehicle_enter", Event_VehicleEnter);
//Hide cvars messages
for(
new
i = 0; i <sizeof(cvars); i++)
for(
int
i = 0; i <sizeof(cvars); i++)
{
new
Handle
:
CVarHandle = FindConVar(cvars[i]);
Handle
CVarHandle = FindConVar(cvars[i]);
if (CVarHandle != INVALID_HANDLE)
{
new
flags;
int
flags;
flags = GetConVarFlags(CVarHandle);
flags &= ~FCVAR_NOTIFY;
SetConVarFlags(CVarHandle, flags);
...
...
@@ -200,12 +204,12 @@ public void OnLibraryAdded(const char[] name)
}
}
public OnClientPutInServer(Client)
public
void
OnClientPutInServer(
int
Client)
{
PrintToChat(Client, "\x04[NCEV] \x01This server is running\x04 [No Comm Extend Vote]\x01 v0.
8
by\x07ff6600 Neoony");
PrintToChat(Client, "\x04[NCEV] \x01This server is running\x04 [No Comm Extend Vote]\x01 v0.
9 WIP
by\x07ff6600 Neoony");
}
public OnMapStart()
public
void
OnMapStart()
{
AutoExecConfig(true, "NoCommExtendVote");
}
...
...
@@ -484,14 +488,14 @@ public Action LockSpecMP(Handle timer)
}
}
public Action
:
SCommand_NCEnable(args)
public Action
SCommand_NCEnable(
int
args)
{
NCEnableDisable = 1;
PrintToServer("[NCEV] Extending of the vote ENABLED");
vtpausedused = 0;
}
public Action
:
SCommand_NCDisable(args)
public Action
SCommand_NCDisable(
int
args)
{
NCEnableDisable = 0;
PrintToServer("[NCEV] Extending of the vote DISABLED");
...
...
@@ -626,7 +630,7 @@ public Action InfoMsg(Handle timer)
}
}
public
Event_CommVote(Handle
:
event, const char[] name, bool dontBroadcast)
void
Event_CommVote(Handle
event, const char[] name, bool dontBroadcast)
{
int cvote = GetEventInt(event, "team");
int cvoter_id = GetEventInt(event, "voter_id");
...
...
@@ -702,7 +706,7 @@ public Event_CommVote(Handle:event, const char[] name, bool dontBroadcast)
}
}
public
Event_CommVoteTime(Handle
:
event, const char[] name, bool dontBroadcast)
void
Event_CommVoteTime(Handle
event, const char[] name, bool dontBroadcast)
{
cexist = GetEventInt(event, "commander_exists");
vtime = GetEventInt(event, "time");
...
...
@@ -881,7 +885,7 @@ public Event_CommVoteTime(Handle:event, const char[] name, bool dontBroadcast)
}
}
public
Event_ElectedPlayer(Handle
:
event, const char[] name, bool dontBroadcast)
void
Event_ElectedPlayer(Handle
event, const char[] name, bool dontBroadcast)
{
//PrintToChatAll("commander_elected_player event");
//PrintToServer("commander_elected_player event");
...
...
@@ -943,14 +947,14 @@ public Event_ElectedPlayer(Handle:event, const char[] name, bool dontBroadcast)
}
}
public
Event_VehicleEnter(Handle
:
event, const char[] name, bool dontBroadcast)
void
Event_VehicleEnter(Handle
event, const char[] name, bool dontBroadcast)
{
if (nccommcheck == 1 && bothcommsdone == 0 && nccommcheckdone == 0)
{
if (nccommcheckx == 1 && nccommcheckxready == 0)
{
new
nfcv = FindEntityByClassname(-1, "emp_nf_commander");
new
becv = FindEntityByClassname(-1, "emp_imp_commander");
int
nfcv = FindEntityByClassname(-1, "emp_nf_commander");
int
becv = FindEntityByClassname(-1, "emp_imp_commander");
nccommcheckxready = 0;
int idvehicle = GetEventInt(event, "vehicleid");
if (idvehicle == becv) //Brenodi Empire
...
...
@@ -1136,15 +1140,15 @@ public Action CommChk(Handle timer)
{
if (nccommcheckxbe == 0)
{
new String:
commbe[256];
char
commbe[256];
Format(commbe,256,"emp_imp_commander");
new
ents=GetMaxEntities();
new
ent;
for(
new
i=1;i<=ents;i++)
int
ents=GetMaxEntities();
int
ent;
for(
int
i=1;i<=ents;i++)
{
if(IsValidEntity(i))
{
new String:
class[256];
char
class[256];
GetEdictClassname(i,class,256);
if(StrEqual(class,commbe,false))
{
...
...
@@ -1176,15 +1180,15 @@ public Action CommChk(Handle timer)
}
if (nccommcheckxnf == 0)
{
new String:
commnf[256];
char
commnf[256];
Format(commnf,256,"emp_nf_commander");
new
ents=GetMaxEntities();
new
ent;
for(
new
i=1;i<=ents;i++)
int
ents=GetMaxEntities();
int
ent;
for(
int
i=1;i<=ents;i++)
{
if(IsValidEntity(i))
{
new String:
class[256];
char
class[256];
GetEdictClassname(i,class,256);
if(StrEqual(class,commnf,false))
{
...
...
updater.txt
0 → 100644
View file @
febd5851
"Updater"
{
"Information"
{
"Version"
{
"Latest" "v0.9 WIP"
}
"Notes" "[NCEV] NoCommExtendVote. v0.9 WIP Changelog:"
"Notes" "- Added updater support (https://git.empiresmod.com/sourcemod/Updater)"
"Notes" "- Ported to SourcePawn Transitional Syntax"
}
"Files"
{
"Plugin" "Path_Mod/addons/sourcemod/plugins/NoCommExtendVote.smx"
"Source" "Path_Mod/addons/sourcemod/scripting/NoCommExtendVote.sp"
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment