Sikerült, megtaláltam a plugint!
Ebbe valaki beletudná irni, hogy ha megszavazzák az alltalkot, akkor a halott CT-k lássák a T-ket, ha pedig nem szavazzák meg az alltalkot, akkor ne lássák egymást?
Kód:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "ST Vote"
#define VERSION "1.0"
#define AUTHOR "Toster v2.1"
new yup
new nop
new txt[] = "\rEnable Alltalk?^n^n\y1. Yes^n2. No"
new voted[32]
new votend
new file[128]
new startch
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_menucmd(register_menuid("stmenu"), 1023, "actionMenu")
register_cvar("stv_lasts","160.0")
set_task(0.1,"show",1,"",1,"b")
set_task(60.0,"strch")
set_task(get_cvar_float("stv_lasts"),"stopdavote")
get_configsdir(file,127)
format(file[strlen(file)],127-strlen(file),"/stvote.ini")
}
public strch() startch=1
public actionMenu(id,key)
{
new name[32]
get_user_name(id,name,31)
switch(key)
{
case 0:{
yup++
client_print(0,print_chat,"[ST Vote] %s voted for alltalk!",name)
}
case 1:{
nop++
client_print(0,print_chat,"[ST Vote] %s voted against alltalk!",name)
}
}
voted[id-1]=1
return PLUGIN_HANDLED
}
public show()
{
new num
new players[32]
if(votend==1)return PLUGIN_HANDLED
get_players (players,num,"c")
if(yup+nop==num&&startch==1)stopdavote()
for(new i=1;i<=32;i++)
{
if(voted[i-1]!=1)
show_menu(i,((1<<0)|(1<<1)),txt, _,"stmenu")
}
return PLUGIN_CONTINUE
}
public client_disconnect(id) voted[id-1]=0
public stopdavote()
{
if(votend==1)return PLUGIN_HANDLED
votend=1
client_print(0,print_chat,"[ST Vote] Enable Alltalk?")
client_print(0,print_chat,"[ST Vote] The result is: Yes - %d No - %d",yup,nop)
if(yup>nop)
{
client_print(0,print_chat,"[ST Vote] Alltalk enabled!")
for(new i=0;i<=file_size(file,1)+1;i++)
{
//new read[100]
//new trash
//read_file(file,i,read,99,trash)
//client_print(0,print_chat,"[ST Vote] %s",read)
server_cmd("sv_alltalk 1")
}
}
else
{
client_print(0,print_chat,"[ST Vote] Alltalk disabled :(")
server_cmd("sv_alltalk 1")
}
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/