This is working if 1 player from T or CT write gg. Server will restart.
PHP Code:
#include <amxmodx>
#include <cstrike>
new const cmd[][] = {
"say /gg", "say gg", "say .gg", "say !gg"
}
public plugin_init() {
for(new i = 0; i < sizeof cmd; i++)
register_clcmd(cmd[i], "team_command")
}
public team_command(id){
if (cs_get_user_team(id) == CS_TEAM_T)
{
server_cmd( "restart" )
}
else if (cs_get_user_team(id) == CS_TEAM_CT)
{
server_cmd( "restart" )
}
}
This plugin executes a command if 5 people write .gg no mather which team. Server will restart.
Commands .gg .nogg .status
PHP Code:
#include <amxmodx>
#include <cstrike>
new bool:gReady[33] = false
new bool:gReStart = false
new gReadyNum
public plugin_init()
{
// PLUGIN ORIGINAL CODED BY AssKicR
// most work on this plugin was done by him.
// Coding errors corrected by KristianI
register_plugin("Ready?","6.2","KristianI")
register_clcmd("say .gg","HandleReady")
register_clcmd("say .nogg","HandleStop")
register_clcmd("say .status","HandleStatus")
register_cvar("sv_minplayers","5")
}
public HandleReady(id)
{
if(!gReady[id]) {
gReady[id] = true
gReadyNum += 1
HandleStatus
}else{
client_print(id,print_chat,"You are giving up already!")
}
}
public HandleStop(id)
{
if(gReady[id]) {
gReady[id] = false
gReadyNum -= 1
client_print(id,print_chat,"You are not giving up!")
HandleStatus
//client_print(0,print_chat,"%i/%i giving up!",gReadyNum,get_playersnum())
}else{
client_print(id,print_chat,"You are not giving up!")
}
}
public HandleStatus()
{
// Print number of players ready to chat
client_print(0,print_chat,"%i/%i are giving up!",gReadyNum,get_cvar_num("sv_minplayers"))
// Checks the number of players ready compared to number of
// players needed to start the game (sv_minplayers)
if (gReadyNum==get_cvar_num("sv_minplayers") && !gReStart) {
gReStart = true
goLIVE
server_cmd( "restart" )
}
}
public client_disconnect(id)
{
if (gReady[id]==true) {
gReady[id]=false
gReadyNum -= 1
}
}
public goLIVE() {
for (new playerID=0; playerID<33; playerID++) {
gReady[playerID]=false
}
gReadyNum = 0
gReStart = false
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1030{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/