Trivia Bot [AMXX]
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
-
- Membru, skill 0
- Posts: 2
- Joined: 28 Feb 2011, 20:12
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Contact:
-
- Membru, skill 0
- Posts: 8
- Joined: 25 Nov 2010, 19:33
- Detinator Steam: Da
- CS Status: Invat Sa Trag
- Detinator server CS: cs.Celife.Ro
- Location: La Soruta`n Pat!
- Contact:
nu-l pot compila
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
/tmp/text6KtRYy.sma(11) : fatal error 100: cannot read from file: "colorchat"
Compilation aborted.
1 Error.
mi-l compileaza si mie cineva sau imi spune cum pot rezolva problema sa il compilez singur?
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
/tmp/text6KtRYy.sma(11) : fatal error 100: cannot read from file: "colorchat"
Compilation aborted.
1 Error.
mi-l compileaza si mie cineva sau imi spune cum pot rezolva problema sa il compilez singur?
Code: Select all
/*
Fisier descarcat de pe www.celife.ro/forum !
Fisier tradus de LeThy !
Versiune plugin: 1.1
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>
#include <nvault>
#define PLUGIN "Trivia Bot"
#define VERSION "1.1"
#define AUTHOR "Alka"
#define CharsMax(%1) sizeof %1 - 1
#define MAX_LINES 512
#define MAX_LEN 256
#define QUESTION_INTERVAL 15.0
#define QUESTION_INTERVAL_NUM 15
new List[2][MAX_LINES][MAX_LEN];
new Amount;
new Timer = QUESTION_INTERVAL_NUM;
new CurrentAnswer[128];
new bool:TriviaOnOff[33];
new TriviaPoints[33];
new const PluginTag[] = "[Fanatic.celife.ro]";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say", "HookSay");
register_clcmd("say !top10", "ShowTriviaTop");
register_clcmd("say !triviatop10", "ShowTriviaTop");
register_clcmd("say !triviatop", "ShowTriviaTop");
register_clcmd("say !triviapoints", "ShowTriviaPoints");
register_clcmd("say !points", "ShowTriviaPoints");
set_task(1.0, "TimeRemainingCounter", 1111, "", 0, "b", 0);
TeamInfo = get_user_msgid("TeamInfo");
SayText = get_user_msgid("SayText");
}
public plugin_cfg()
{
new ConfigsDir[64], File[64];
new TriviaDir[64];
get_configsdir(ConfigsDir, CharsMax(ConfigsDir));
formatex(TriviaDir, CharsMax(TriviaDir), "%s/Trivia Bot", ConfigsDir);
formatex(File, CharsMax(File), "%s/trivia_list.ini", TriviaDir);
if(!dir_exists(TriviaDir))
mkdir(TriviaDir);
if(!file_exists(File))
write_file(File, "", -1);
new FilePointer = fopen(File, "rt");
new Buffer[512];
while(!feof(FilePointer))
{
fgets(FilePointer, Buffer, CharsMax(Buffer));
if(!Buffer[0] || Buffer[0] == ';' || strlen(Buffer) < 3)
continue;
trim(Buffer);
strtok(Buffer, List[0][Amount], sizeof List[][] - 1, List[1][Amount], sizeof List[][] - 1, ';', 0);
Amount++;
}
fclose(FilePointer);
server_print("%s Successfuly loaded %d lines from %s.", PluginTag, Amount, File);
ShowQuestion();
}
public ShowQuestion()
{
if(task_exists(2222))
remove_task(2222);
new RndNum = random(Amount);
formatex(CurrentAnswer, CharsMax(CurrentAnswer), List[1][RndNum]);
static Players[32], Num, Player;
get_players(Players, Num, "bh");
for(new i = 0 ; i < Num ; i++)
{
Player = Players[i];
if(!is_user_connected(Player))
continue;
if(!TriviaOnOff[Player])
continue;
ColorChat(Player, RED, "%s^x01%s", PluginTag, List[0][RndNum]);
}
Timer = QUESTION_INTERVAL_NUM - 1;
set_task(QUESTION_INTERVAL, "ShowQuestion", 2222, "", 0, "", 0);
}
public TimeRemainingCounter()
{
if(Timer < 0)
return;
static Players[32], Num, Player;
get_players(Players, Num, "bh");
for(new i = 0 ; i < Num ; i++)
{
Player = Players[i];
if(!is_user_connected(Player))
continue;
if(!TriviaOnOff[Player])
continue;
set_hudmessage(255, 255, 255, -1.0, 0.7, 0, 1.0, 0.8, 1.0, 1.0, 4);
show_hudmessage(Player, "%s Timp ramas pana la urmatoarea intrebare : %d", PluginTag, Timer);
}
Timer--;
}
public HookSay(id)
{
new Args[256];
read_args(Args, CharsMax(Args));
if(containi(Args, CurrentAnswer) != -1 && TriviaOnOff[id])
{
new RndNum = random(500);
ColorChat(id, RED, "%s^x01 Raspunsul tau a fost corect. Felicitari, ai castigat %d$", PluginTag, RndNum);
TriviaPoints[id] += 1;
if(is_user_connected(id))
cs_set_user_money(id, cs_get_user_money(id) + RndNum, 0);
ShowQuestion();
return 1;
}
else if(equali(Args, "^"/trivia^"", 9))
{
if(!TriviaOnOff[id])
{
ColorChat(id, RED, "%s^x04 Te-ai alaturat la Trivia, il poti juca cat timp esti mort!", PluginTag);
TriviaOnOff[id] = true;
}
else
{
ColorChat(id, RED, "%s^x04 Ai parasit Trivia, nu mai poti juca!", PluginTag);
TriviaOnOff[id] = false;
}
}
return 0;
}
public client_disconnect(id)
{
TriviaOnOff[id] = false;
if(TriviaPoints[id] != 1)
SavePoints(id);
}
public client_putinserver(id)
{
set_task(15.0, "ShowAdvMessage", id + 3333);
LoadPoints(id);
}
public ShowAdvMessage(index)
{
index -= 3333;
ColorChat(index, RED, "%s^x01 In timp ce esti mort poti juca Trivia si poti castiga bani! Tasteaza ^x04/trivia ^x01 in chat pentru activare.", PluginTag);
}
public SavePoints(index)
{
new Vault = nvault_open("trivia_points");
new Key[64], Value[64], Name[32];
get_user_name(index, Name, sizeof Name - 1);
formatex(Key, sizeof Key - 1, "%s-trivia_points:", Name);
formatex(Value, sizeof Value - 1, "%d", TriviaPoints[index]);
nvault_set(Vault, Key, Value);
nvault_close(Vault);
}
public LoadPoints(index)
{
new Vault = nvault_open("trivia_points");
new Key[64], Value[64], Name[32];
get_user_name(index, Name, sizeof Name - 1);
formatex(Key, sizeof Key - 1, "%s-trivia_points:", Name);
nvault_get(Vault, Key, Value, sizeof Value - 1);
nvault_close(Vault);
TriviaPoints[index] = str_to_num(Value);
}
public ShowTriviaTop(id)
{
static Sort[33][2];
new Count;
new Players[32], Num, Player;
get_players(Players, Num);
for(new i = 0 ; i < Num ; i++)
{
Player = Players[i];
Sort[Count][0] = Player;
Sort[Count][1] = TriviaPoints[Player];
Count++;
}
SortCustom2D(Sort, Count, "points_compare");
new Motd[1024], Len;
Len = format(Motd, sizeof Motd - 1,"<body bgcolor=#000000><font color=#98f5ff><pre>");
Len += format(Motd[Len], (sizeof Motd - 1) - Len,"%s %-22.22s %3s^n", "#", "Name", "Trivia Points");
new b = clamp(Count, 0, 10);
new Name[32], User;
for(new a = 0; a < b; a++)
{
User = Sort[a][0];
get_user_name(User, Name, sizeof Name - 1);
Len += format(Motd[Len], (sizeof Motd - 1) - Len,"%d %-22.22s %d^n", a + 1, Name, Sort[a][1]);
}
Len += format(Motd[Len], (sizeof Motd - 1) - Len,"</body></font></pre>");
show_motd(id, Motd, "Trivia Top 10");
}
public points_compare(elem1[], elem2[])
{
if(elem1[1] > elem2[1])
return -1;
else if(elem1[1] < elem2[1])
return 1;
return 0;
}
public ShowTriviaPoints(id)
ColorChat(id, RED, "%s^x04 Aveti %d puncte trivia%s.", PluginTag, TriviaPoints[id], TriviaPoints[id] > 1 ? "s" : "");
- last.bllu3
- Membru, skill +1
- Posts: 121
- Joined: 30 Jul 2010, 18:32
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com!
- Has thanked: 19 times
- Contact:
nici eu nu il pot compila , topicul e ...
sa vina un scripter cu un raspuns pls
sa vina un scripter cu un raspuns pls
- [ HNS Clasic]
- [ HNS Clasic]
- [ HNS Clasic]
-
- Membru, skill 0
- Posts: 24
- Joined: 22 Mar 2012, 09:00
- Detinator Steam: Da
- Has thanked: 3 times
- Been thanked: 1 time
- Contact:
Eu l-am modificat ca in explicatiile de sus da nu merge sai fac compile (sa fac din trivia_bot.sma in trivia_bot.amx).
Las lincu aici daca mil poate compila cineva http://www.2shared.com/file/-8UKfFpX/trivia_bot.html.
Multumesc foarte mult
Las lincu aici daca mil poate compila cineva http://www.2shared.com/file/-8UKfFpX/trivia_bot.html.
Multumesc foarte mult
- CryWolf
- Administrator
- Posts: 6505
- Joined: 07 Aug 2008, 16:33
- Detinator Steam: Da
- Reputatie: Administrator
Fost Scripter
Manager CS2.eXtream.Ro
Fost Detinator ZM.eXtream.Ro
Fost manager CS.eXtream.Ro
Fost manager CSGO.eXtream.Ro
Fost manager global - Location: Botosani
- Discord: crywolf1989
- Has thanked: 202 times
- Been thanked: 850 times
- Contact:
->
Am scos colorchat si am adaugat alt stock de colorare facut de aNNakin (alt_chat) si se pare ca functioneaza ok.
- trivia_bot.sma | Afiseaza codul
Am scos colorchat si am adaugat alt stock de colorare facut de aNNakin (alt_chat) si se pare ca functioneaza ok.
NU IMI MAI DA-TI PM CU CERERE AJUTOR/SAMD, FOLOSITI FORUMUL, CITESC MAJORITATEA TOPICURILOR.
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV
- PKK.
- Membru, skill +2
- Posts: 522
- Joined: 09 Oct 2010, 21:59
- Detinator Steam: Da
- SteamID: pkk08
- Location: Piatra Neamt
- Has thanked: 65 times
- Been thanked: 41 times
CryWolf wrote:->
- trivia_bot.sma | Afiseaza codul
Am scos colorchat si am adaugat alt stock de colorare facut de aNNakin (alt_chat) si se pare ca functioneaza ok.
Cand incerc sa compilez imi scrie:
trivia_bot.sma(319) : error 001: expected token: "}", but found "-end of file-"
- CryWolf
- Administrator
- Posts: 6505
- Joined: 07 Aug 2008, 16:33
- Detinator Steam: Da
- Reputatie: Administrator
Fost Scripter
Manager CS2.eXtream.Ro
Fost Detinator ZM.eXtream.Ro
Fost manager CS.eXtream.Ro
Fost manager CSGO.eXtream.Ro
Fost manager global - Location: Botosani
- Discord: crywolf1989
- Has thanked: 202 times
- Been thanked: 850 times
- Contact:
hmm... da mai trebuia adaugat un } la urma, am editat.
NU IMI MAI DA-TI PM CU CERERE AJUTOR/SAMD, FOLOSITI FORUMUL, CITESC MAJORITATEA TOPICURILOR.
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV
-
- Membru, skill 0
- Posts: 20
- Joined: 10 Apr 2012, 19:40
- Detinator Steam: Nu
- CS Status: Citesc forumul eXtreamCS.com...!
- Contact:
Gj Foarte Util Pluginul !
- BioLoGic
- Membru, skill 0
- Posts: 64
- Joined: 07 Feb 2012, 21:18
- Detinator Steam: Da
- CS Status: Ocupat..!
- Detinator server CS: Da
- Has thanked: 13 times
- Been thanked: 3 times
- Contact:
Eu stiu ca poti juca trivia numai cand esti mort /:)Masaroo wrote:Da este un plugin foarte bun ... Chiar imi place :P Este fainut deoarece nu te plictisesti de exemplu cand 2 playeri stau in baza unul la altul ( campeaza ) nu te plictisesti ci chiar te Distrezi/Exersezi cu TriviaBot