mirror of
https://codeberg.org/spire/setteam.git
synced 2026-08-02 04:14:46 +02:00
allow using client id
This commit is contained in:
parent
1ef7a7a127
commit
7ae52b678f
2 changed files with 15 additions and 1 deletions
Binary file not shown.
|
|
@ -13,6 +13,8 @@ public Plugin:myinfo = {
|
||||||
KeyValues force_team;
|
KeyValues force_team;
|
||||||
|
|
||||||
public OnPluginStart() {
|
public OnPluginStart() {
|
||||||
|
LoadTranslations("common.phrases");
|
||||||
|
|
||||||
RegServerCmd("sm_setteam", SetTeam, "Set a players team");
|
RegServerCmd("sm_setteam", SetTeam, "Set a players team");
|
||||||
RegServerCmd("sm_forceteam", ForceExec, "Set a players team and keep them there");
|
RegServerCmd("sm_forceteam", ForceExec, "Set a players team and keep them there");
|
||||||
|
|
||||||
|
|
@ -75,7 +77,19 @@ public Action:SetTeam(args) {
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
int client = FindTarget(0, player, false, true);
|
int client = StringToInt(player);
|
||||||
|
|
||||||
|
if (client <= 0) {
|
||||||
|
client = FindTarget(0, player, false, true);
|
||||||
|
} else {
|
||||||
|
client -= 1; // status starts client ids with
|
||||||
|
}
|
||||||
|
|
||||||
|
if (client <= 0) {
|
||||||
|
PrintToServer("Player '%s' not found", player);
|
||||||
|
|
||||||
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
|
||||||
set_force(client, 0);
|
set_force(client, 0);
|
||||||
ChangeClientTeam(client, team);
|
ChangeClientTeam(client, team);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue