17/09/2020, 10:31 AM
Lo único que quiero a ver es que cada vez que se inicie el mapa se inicie el plugin en vez de ponerlo por consola algún admin y agregarle un respawn que revivan a 1 segundo de morir mientras dure los segundos de reset para usarlo como calentamiento si pueden ayudar gracias
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <engine>
// Creditos : Rattler || JAvee.
#define PLUGIN_NAME "Restart Automatico"
#define PLUGIN_VERS "1.1"
#define PLUGIN_AUTH "Renguito"
#define TASK_CD 3243244
#define ADMIN_LEVEL ADMIN_BAN
#define PREFIX "AMXX" // Aca pones el Nombre de tu Server
#define DEFAULT_COUNTDOWN_TIMER 20
new g_iCountDown = DEFAULT_COUNTDOWN_TIMER
new g_iHudSyncMsg
new spFile[96]
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERS, PLUGIN_AUTH)
g_iHudSyncMsg = CreateHudSyncObj()
register_concmd("amx_rr", "ConCmd_RestartRound", ADMIN_LEVEL, "< RestartRound >")
}
public cmdRR (id, level, cid){
if(!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED;
server_cmd("sv_restart 1")
new name[32]
get_user_name(id, name, sizeof(name) - 1)
client_print(0,print_chat,"ADMIN %s : Reseteo el Server",name)
return PLUGIN_HANDLED;
}
public ConCmd_RestartRound(id, lvl, cid)
{
if (!cmd_access(id, lvl, cid, 1))
return PLUGIN_HANDLED
ClearSyncHud(0, g_iHudSyncMsg)
g_iCountDown = DEFAULT_COUNTDOWN_TIMER
set_task(1.0, "Task_CountDown", TASK_CD, _, _, "a", g_iCountDown)
return PLUGIN_HANDLED
}
public Task_CountDown()
{
--g_iCountDown
set_hudmessage(255, 127, 255, -1.0, 0.2, 0, 1.0, 0.95, 0.1, 0.2, -1)
ShowSyncHudMsg(0, g_iHudSyncMsg, "[%s]^nAutoRestart en: %d Seg.", PREFIX, g_iCountDown)
switch (g_iCountDown)
{
case 1..10:
{
new VoiceSound[32]
num_to_word(g_iCountDown, VoiceSound, sizeof(VoiceSound)-1)
client_cmd(0, "spk ^"%s^"", VoiceSound)
}
case 0:
{
set_task(0.1,"cancion",0)
set_task(0.4, "aviso",0)
set_task(1.0, "aviso1",0)
set_task(2.0, "aviso2",0)
set_task(3.0, "aviso3",0)
set_task(4.0, "aviso4",0)
set_task(5.0, "aviso5",0)
set_task(6.0, "aviso6",0)
set_task(6.5, "Autorr",0)
}
}
}
public plugin_precache()
{
format( spFile, 95, "sound/autorr/rr.wav")
if(file_exists(spFile))
{
precache_sound("autorr/rr.wav")
}
}
public cancion()
{
if(file_exists(spFile))
{
client_cmd(0,"spk sound/autorr/rr.wav")
}
}
public aviso(){
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 5.0)
show_hudmessage(0, "--| Oppa Gangnam Style |--")
new iPlayers[ 32 ], iNum, Conos
get_players( iPlayers, iNum )
for( new i = 0; i < iNum; i++ )
{
Conos = iPlayers[i]
}
Temblor(Conos)
}
public aviso1(){
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 5.0)
show_hudmessage(0, "--| Oppa Gangnam Style |--")
}
public aviso2(){
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 5.0)
show_hudmessage(0, "--| Op |--")
}
public aviso3(){
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 5.0)
show_hudmessage(0, "--| Op |--")
}
public aviso4(){
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 5.0)
show_hudmessage(0, "--| Gangnam Style |--")
}
public aviso5(){
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 5.0)
show_hudmessage(0, "--| Gangnam Style |--")
}
public aviso6(){
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 2.0)
show_hudmessage(0, "--| Op op Op|--")
new iPlayers[ 32 ], iNum, Conos
get_players( iPlayers, iNum )
for( new i = 0; i < iNum; i++ )
{
Conos = iPlayers[i]
}
Temblor(Conos)
}
public Autorr()
{
set_hudmessage(255, 170, 85, -1.0, 0.3, 1, 6.0, 2.0)
show_hudmessage(0,"")
server_cmd("mp_freezetime 3")
server_cmd("sv_restart 1")
set_task(2.0,"Vale")
}
public Vale()
{
new iPlayers[ 32 ], iNum, Conos
get_players( iPlayers, iNum )
for( new i = 0; i < iNum; i++ )
{
Conos = iPlayers[i]
ScreenBlack(Conos)
}
new host[128],ip[32]
get_cvar_string("hostname", host, 127)
get_cvar_string("net_address", ip, 31)
set_hudmessage(random_num(55,255), random_num(55,255), random_num(55,255), -1.0, -1.0, 1, 6.0, 8.0)
show_hudmessage(0,"%s ^n %s ",host,ip)
server_cmd("mp_freezetime 0")
}
public Temblor(Conos)
{
message_begin(MSG_ALL, get_user_msgid("ScreenShake"), {0,0,0}, Conos)
write_short(255<< 14 ) //ammount
write_short(10 << 14) //lasts this long
write_short(255<< 14) //frequency
message_end()
}
public ScreenBlack(Conos)
{
message_begin(MSG_ALL,get_user_msgid("ScreenFade"),{0,0,0},Conos)
write_short(1<<15)
write_short(1<<13)
write_short(1<<12)
write_byte( 0 )
write_byte( 0 )
write_byte( 0 )
write_byte( 255 )
message_end()
}
Código PHP:
section .data
holaMundo: db '$ Te ayudaré siempre y cuando pueda.!! ❤️!', 10
longitud: equ $ - holaMundo
section .text