Code:
///////////////////////////////////////////////////////////////////
// Fun Predictions 1.0 by SlimDog //
// Description: It will show some fun predictinions in every new //
// round:) //
// //
// Admin commands //
// amx_prediction (ADMIN_LEVEL_H) - if turned on, turns off; if //
// turned off, turns on fun predictions. //
////////////////////////Don't edit below///////////////////////////
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Fun Predictions"
#define VERSION "1.0"
#define AUTHOR "SlimDog"
////////////////////////////////////////////////////////
// You can change Fun Predictions default status here //
// 1 - on by default, 0 - off by default //
///////////////////You can edit here////////////////////
new predstat = 1
// Don't edit below if you don't realy know what you are doing
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("RoundTime", "predict", "bc")
register_concmd("amx_prediction", "prstatus", ADMIN_LEVEL_H)
}
public prstatus(id) {
if (predstat == 1) {
predstat = 0
console_print(id, "[!] You have turned off FUN Predictions. So now it's not active.")
}
else {
predstat = 1
console_print(id, "[!] You have turned on FUN Predictions. So now it's active.")
}
return PLUGIN_CONTINUE
}
public predict()
{
new players[32], num;
get_players(players, num, "a");
if ((predstat == 1) && (num > 1)) {
new cfg[256]
get_configsdir(cfg[255], 255)
format(cfg, 255, "%s/predictions.txt")
if(!file_exists(cfg))
{
client_print(0, print_chat, "[!Warning!] Fun Predictions can't work without %s. Please check if that file exists.",cfg)
return PLUGIN_HANDLED;
}
new krcid
while(!is_user_alive(krcid))
krcid = random_num(1,get_playersnum())
new veikejas[33]
get_user_name(krcid,veikejas,32)
new lntx[101], predtag[31], message[127], ilgis, ilgiss;
read_file(cfg, random_num(9,file_size(cfg,1)), lntx, 100, ilgis)
read_file(cfg, 7, predtag, 30, ilgiss)
format(message ,"%s %s",predtag,lntx);
client_print(0, print_chat, "%s",message)
}
return PLUGIN_CONTINUE
}