PDA

View Full Version : [REZOLVAT] Problema plugin!



bLLue
05-04-2014, 11:12 PM
Salut am niste probleme cu acest plugin nu merge compilat , am gasit altu dar nu functioneaza pe server.

#include <amxmodx>

new a[6]

public plugin_init()
{
register_plugin("Map Scheduler", "1.0", "Author")

set_task(60.0, "task_check_time", 38427236, _, _, "b")
}

public task_check_time()
{
get_time("%H:%M", a, 5)

if (equal(a, "21:33"))
{
chat_color(0, "!g[WarGods.ro] !nEste ora !g21:33 !nserverul trece pe setarile de noapte.")
}

if (equal(a, "21:34"))
{
chat_color(0, "!g[WarGods.ro] !FIRTS MAP: deathrun_arctic")
}

if (equal(a, "21:35"))
{
server_cmd("amx_map deathrun_arctic")

}

if (equal(a, "00:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}

if (equal(a, "01:00"))
{
server_cmd("amx_map deathrun_temple")
}

if (equal(a, "01:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}

if (equal(a, "02:00"))
{
server_cmd("amx_map deathrun_forest")
}

if (equal(a, "02:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}

if (equal(a, "03:00"))
{
server_cmd("amx_map deathrun_projetocs2")

}

if (equal(a, "03:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}

if (equal(a, "04:00"))
{
server_cmd("amx_map deathrun_baw")
}

if (equal(a, "04:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}

if (equal(a, "05:00"))
{
server_cmd("amx_map deathrun_arctic")
}

if (equal(a, "05:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}
if (equal(a, "06:00"))
{
server_cmd("amx_map deathrun_dust2009")
}

if (equal(a, "06:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}

if (equal(a, "07:00"))
{
server_cmd("amx_map deathrun_arctic")
}

if (equal(a, "07:05"))
{
server_cmd("amx_rcon mp_timelimit 0")
server_cmd("amx_pausecfg stop adminvote")
server_cmd("amx_pausecfg stop mapchooser")
server_cmd("amx_pausecfg stop mapsmenu")
}

if (equal(a, "07:50"))
{
server_cmd("amx_map deathrun_projetocs2")
}

if (equal(a, "07:55"))
{
server_cmd("amx_rcon mp_timelimit 30")
}

if (equal(a, "08:00"))
{
chat_color(0, "!g[WarGods] !nEste ora !g08:00 !nserverul trece pe setarile de zi.")
}
}


stock chat_color(const id, const input[], any:...)
{
new count = 1, players[24]

static msg[191]

vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!n", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "!t2", "^0")

if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
}
daca ma puteti ajuta cu el desigur sa mearga si pe server. Multumesc enorm

Tiger
05-04-2014, 11:34 PM
1. Foloseste tag-ul "CODE", nu "QUOTE" pentru a pune script-ul pe forum.
2. Inlocuieste chat_color cu asta:



stock chat_color(id, const input[], any:...)
{
static msg[191];
new players[32], count = 1;

vformat(msg, 190, input, 3);

replace_all(msg, 190, "!g", "^4");
replace_all(msg, 190, "!n", "^1");
replace_all(msg, 190, "!t", "^3");

if (id)
players[0] = id;
else
get_players(players, count, "ch");

new ids;
new msg_SayText = get_user_msgid("SayText");
for (new i = 0; i < count; i++)
{
ids = players[i];
if (is_user_connected(ids))
{
message_begin(MSG_ONE_UNRELIABLE, msg_SayText, _, ids);
write_byte(ids);
write_string(msg);
message_end();
}
}
}


3. Pluginul pe care l-ai gasit este o porcarie. Tot in 60 de secunde se reverifica ceasul si este neoptimizat.

bLLue
05-04-2014, 11:46 PM
Atunci zi un plugin care sa pun anumite mape pe el pe timp gen asta ma refer la timp.