Pausable | Tactical timeout for counter strike source v34

KaKeRo

Участник
Сообщения
25
Реакции
1
Hey guys
im working on a plugin thats like csgo tactical timeout, its work very well!
But its just work with admins commands,
I dont know how to set 1 timeout per team and how to make a vote that players can call a timeout without admins

please help
 

Reiko1231

AlexTheRegent
Сообщения
508
Реакции
1,336
To limit timeouts per team you have to declare two global variables:
bool g_t_restart_used, g_ct_restart_used;

Then you have to reset them every map change (if you want to allow one timeout for each team per map):
public void OnMapChange() g_t_restart_used = g_ct_restart_used = false;

Then you have to set corresponding variable to true every time timeout is used. Example for T:
g_t_restart_used = true;

And in timeout command you have to add team-based variable check. Example for T:
if (g_t_restart_used == true) { PrintToChat(client, "Your team already used timeout"); return Plugin_Handled; }

To make a vote you have two options:
1. RTV-based when players write command in chat. You can find example in addons/sourcemod/scripting/rockthevote.sp file.
2. Menu based when one player starts vote and all. More information about menus and votes in sourcemod's wiki:
In both cases you have to separate votes by team.
 

KaKeRo

Участник
Сообщения
25
Реакции
1
I have fixed my way, but i think your way is better, tnx any way
 
Сверху Снизу