mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 03:13:20 +00:00
Improve ux
This commit is contained in:
parent
fe92123a5b
commit
f715687724
2 changed files with 4 additions and 5 deletions
Binary file not shown.
|
@ -55,7 +55,7 @@ public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroa
|
||||||
|
|
||||||
public Action Cmd_VGag(int client, int args) {
|
public Action Cmd_VGag(int client, int args) {
|
||||||
if(args < 1) {
|
if(args < 1) {
|
||||||
ReplyToCommand(client, "Usage: sm_vgag <player>");
|
ReplyToCommand(client, "Usage: sm_vgag <player> - vocalize gag someone for yourself only");
|
||||||
} else {
|
} else {
|
||||||
char arg1[32];
|
char arg1[32];
|
||||||
GetCmdArg(1, arg1, sizeof(arg1));
|
GetCmdArg(1, arg1, sizeof(arg1));
|
||||||
|
@ -79,10 +79,10 @@ public Action Cmd_VGag(int client, int args) {
|
||||||
int playerIndex = gaggedPlayers[client].FindValue(target_list[i]);
|
int playerIndex = gaggedPlayers[client].FindValue(target_list[i]);
|
||||||
if(playerIndex > -1) {
|
if(playerIndex > -1) {
|
||||||
gaggedPlayers[client].Erase(playerIndex);
|
gaggedPlayers[client].Erase(playerIndex);
|
||||||
ReplyToCommand(client, "Locally vocalize ungagged %N", target_list[i]);
|
ReplyToCommand(client, "Vocalize ungagged %N for yourself.", target_list[i]);
|
||||||
}else{
|
}else{
|
||||||
gaggedPlayers[client].Push(target_list[i]);
|
gaggedPlayers[client].Push(target_list[i]);
|
||||||
ReplyToCommand(client, "Locally vocalize gagged %N", target_list[i]);
|
ReplyToCommand(client, "Vocalize gagged %N for yourself. Type command again to ungag.", target_list[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,13 +95,12 @@ public Action SoundHook(int clients[MAXPLAYERS], int& numClients, char sample[PL
|
||||||
for(int i = 0; i < numClients; i++) {
|
for(int i = 0; i < numClients; i++) {
|
||||||
int client = clients[i];
|
int client = clients[i];
|
||||||
if(gaggedPlayers[client].FindValue(entity) > -1) {
|
if(gaggedPlayers[client].FindValue(entity) > -1) {
|
||||||
// Swap gagged player to end of list, then remove it (dec. numClients is effectively same)
|
// Swap gagged player to end of list, then reduce array count by one.
|
||||||
int swap = clients[numClients - 1];
|
int swap = clients[numClients - 1];
|
||||||
clients[numClients - 1] = client;
|
clients[numClients - 1] = client;
|
||||||
clients[i] = swap;
|
clients[i] = swap;
|
||||||
numClients -= 1;
|
numClients -= 1;
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
//Remove client from clients
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue