06/12/2019, 06:40 PM
(Última modificación: 07/12/2019, 12:35 PM por andres_1041. Edited 1 time in total.)
Buenas! Bueno paso por aquí para ver si alguien puede ayudarme a hacer que este plugin me compile si alguien me ayuda se lo agradezco mucho
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define adtime 600.0 //Default of 10 minuites
new pcvar_Advertise
new pcvar_Display
enum Colors
{
Gris = 33,
Rojo,
Azul
}
public plugin_init()
{
register_plugin("resetscore", "1.0", "Ayuwoki")
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
//You may type /resetscore or /restartscore
register_clcmd("say /resetscore", "reset_score")
register_clcmd("say /rs", "reset_score")
register_clcmd("say rs", "reset_score")
register_clcmd("rs", "reset_score")
//This command by default will be set at 0
//Change it to 1 in server.cfg if you want
//A message to be shown to advertise this.
pcvar_Advertise = register_cvar("sv_rsadvertise", "1")
//This command by default is also 0
//Change it to 1 in server.cfg if you want
//It to show who reset their scores when they do it
pcvar_Display = register_cvar("sv_rsdisplay", "1")
if(get_cvar_num("sv_rsadvertise") == 1)
{
set_task(adtime, "advertise", _, _, _, "b")
}
}
public reset_score(id)
{
//These both NEED to be done twice, otherwise your frags wont
//until the next round
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)
if(get_pcvar_num(pcvar_Display) == 1)
{
///chatcolor(id, Gris, "!g[!nForce!g]!n Has reiniciado tu Score")
}
return PLUGIN_HANDLED;
}
if(g_maximumrs[id] > 0) {
chatcolor(id, Rojo, "!g[!nForce!g]!n SOLO PUEDES HACER UN !colorRS!n POR RONDA!")
return PLUGIN_HANDLED;
}
else
{
g_maximumrs[id]++
new name[33]
get_user_name(id, name, 32)
chatcolor(id, Gris, "!g[!nForce!g]!n !color%s !nHAS REINCIADO !colorSCORE", name)
}
return PLUGIN_HANDLED;
}
}
public client_putinserver(id)
{
set_task(0.2, "chatcolor_send_teaminfo", id);
if(get_pcvar_num(pcvar_Advertise) == 1)
{
set_task(10.0, "connectmessage", id, _, _, "a", 1)
}
}
public connectmessage(id)
{
if(is_user_connected(id))
{
chatcolor(id, Gris, "Escribe rs")
}
}
stock chatcolor(id, Colors:color, msg[], any:...)
{
static szMsg[191], msgSayText;
#define teaminfo_sent(%0) (TeamInfoSent & (1<<%0))
if (!msgSayText)
msgSayText = get_user_msgid("SayText");
vformat(szMsg, 190, msg, 4);
replace_all(szMsg, 190, "!g", "^4")
replace_all(szMsg, 190, "!n", "^1")
replace_all(szMsg, 190, "!color", "^3");
replace_all(szMsg, 190, "!t2", "^0")
message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgSayText, .player = id);
write_byte(color ? (_:color) : 33);
write_string(szMsg);
message_end();
}
public chatcolor_send_teaminfo(id)
{
if (!is_user_connected(id))
return;
static msgTeamInfo;
if (!msgTeamInfo)
msgTeamInfo = get_user_msgid("TeamInfo");
static const pTeams[][] = { "", "TERRORIST", "CT" };
for (new pid = 0; pid < 3; pid++)
{
message_begin(MSG_ONE_UNRELIABLE, msgTeamInfo, .player = id)
write_byte(pid+33)
write_string(pTeams[pid])
message_end()
}
}