DarkGL dorobiłem sobie vote ale cuś error wywala ps pomoc za tamto masz Pluchola
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <colorchat>
#define CZAS_VOTE 20.0
//Po jakim czasie na serwerze ma sie pokazac Glosowanie
new normalsky[64];
new choice[3]
new jest = 1
new co = 1
new glosowanie
public plugin_init()
{
register_plugin("Noc","1.0","[H]ARDBO[T]")
register_event("HLTV", "Nowa_Runda", "a", "1=0", "2=0")
jest = 1
co = jest
get_cvar_string("sv_skyname" , normalsky , 63);
glosowanie = register_cvar("sv_glosowanie", "1")
register_cvar("amx_jasnosc", "b")
set_task(CZAS_VOTE,"Jasnosc_Vote")
}
public plugin_precache()
{
precache_generic("gfx/env/niebo_a.tga")
precache_generic("gfx/env/niebo_b.tga")
precache_generic("gfx/env/niebo_c.tga")
set_cvar_string("sv_skyname" , normalsky);
server_cmd("sv_skyname space")
set_lights("b")
}
public Nowa_Runda()
{
new jas[4]
get_cvar_string("amx_jasnosc",jas,3)
set_lights(jas)
}
public Nowe_Vote(id,level,cid)
{
if (get_pcvar_num(glosowanie) == 1)
{
if (!cmd_access(id,level,cid,1))
{
return PLUGIN_HANDLED
}
Jasnosc_Vote()
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public Jasnosc_Vote()
{
if (get_pcvar_num(glosowanie) == 1)
{
show_menu(0,(1<<0)|(1<<1), "\yWybierz jasnosc Nocy ^n^n\w1. \rJasnosc \w(\rA\w)^n2. \rJasnosc \w(\rB\w)^n2. \rJasnosc \w(\rC\w)", 15, "menu_1") // Display menu
set_task(15.0,"Zobacz_Wynik")
choice[0] = 0
choice[1] = 0
choice[2] = 0
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public Zobacz_Wybor(id,key)
{
new name[32]
get_user_name(id,name,31)
new szMsg[192];
new what[8]
if (key == 1) what = "Jasnosc (A)"
if (key == 2) what = "Jasnosc ("
if (key == 3) what = "Jasnosc ©"
formatex(szMsg,191,"* %s ^x01* wybral^x04 * %s *^x01", name, what)
ColorChat(0, GREEN,szMsg);
++choice[key]
return PLUGIN_HANDLED
}
public Zobacz_Wynik(id)
{
if (choice[0] >= choice[1] >= choice[2])
{
server_cmd("sv_skyname niebo_a")
new szMsg[192];
formatex(szMsg,191,"*^x01 Glosowanie udane. (Jasnosc^x04 ^"%d^" ^x01) (Jasnosc^x04 ^"%d^" ^x01) (Jasnosc^x04 ^"%d^" ^x01).^x04 *^x01",choice[0],choice[1],choice[2])
ColorChat(0, GREEN,szMsg);
set_lights("a")
jest = 0
Wymus_Restart()
}
else
{
server_cmd("sv_skyname niebo_b")
new szMsg[192];
formatex(szMsg,191,"*^x01 Glosowanie udane. (Jasnosc^x04 ^"%d^" ^x01) (Jasnosc^x04 ^"%d^" ^x01) (Jasnosc^x04 ^"%d^" ^x01).^x04 *^x01",choice[0],choice[1],choice[2])
ColorChat(0, GREEN,szMsg);
set_lights("b")
jest = 0
Wymus_Restart()
}
else
{
server_cmd("sv_skyname niebo_c")
new szMsg[192];
formatex(szMsg,191,"*^x01 Glosowanie udane. (Jasnosc^x04 ^"%d^" ^x01) (Jasnosc^x04 ^"%d^" ^x01) (Jasnosc^x04 ^"%d^" ^x01).^x04 *^x01",choice[0],choice[1],choice[2])
ColorChat(0, GREEN,szMsg);
set_lights("c")
jest = 0
Wymus_Restart()
}
return PLUGIN_CONTINUE
}
public Wymus_Restart()
{
if (jest == co)
{
return PLUGIN_HANDLED
}
else
{
new szMsg[192];
formatex(szMsg,191,"*^x01 Zaraz nastapi^x04 Restart^x01 aby ustawic jasnosc na Mapie^x04 *^x01",choice[0],choice[1],choice[2])
ColorChat(0, GREEN,szMsg);
co = jest
server_cmd(0, sv_restart 1)
}
return PLUGIN_CONTINUE
}
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Error: Array sizes do not match, or destination array is too small on line 79
Error: Array sizes do not match, or destination array is too small on line 80
Error: Array sizes do not match, or destination array is too small on line 81
Error: Too many error messages on one line on line 81
Compilation aborted.
4 Errors.
Could not locate output file D:\XXX\XXX\XXX\XXX\compiled\Noc.amx (compile failed).
Użytkownik hardbot edytował ten post 02.05.2010 15:21