Załączone pliki
Użytkownik gring0 edytował ten post 27.01.2012 20:16
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Napisano 27.01.2012 20:15
Użytkownik gring0 edytował ten post 27.01.2012 20:16
Napisano 27.01.2012 20:24
If you can dream it, you can do it.
Napisano 31.01.2012 10:50
Napisano 31.01.2012 22:50
g_cvarTimeToNextQuiz = register_cvar("quiz_timetonextquiz", "8")http://amxx.pl/wklejka/132804657113249/
Tak o dla zabawy.speedkill po co się pytasz jak i tak tego nie robisz?
If you can dream it, you can do it.
Napisano 31.01.2012 23:22
Napisano 01.02.2012 20:01
If you can dream it, you can do it.
Napisano 01.02.2012 20:44
Napisano 01.02.2012 21:24
#include <amxmodx>
#include <amxmisc>
#include <ColorChat>
#include <fakemeta_util>
#if cellbits == 32
#define OFFSET_CSMONEY 115
#else
#define OFFSET_CSMONEY 140
#endif
enum FastAnsInfo {
Array:InfoQuestion,
Array:InfoAnsewer
}
new Array:gaFastAnsInfo[FastAnsInfo]
new giQuestion, giHudTimes;
public plugin_init() {
register_plugin("Fast Ansewer", "0.1", "MarWit")
register_clcmd("say", "handleSay")
register_clcmd("say_team", "handleSay")
gaFastAnsInfo[InfoQuestion] = ArrayCreate(256)
gaFastAnsInfo[InfoAnsewer] = ArrayCreate(192)
LoadConfigFile();
set_task(random_float(90.0, 190.0), "SayQuestion", _, _, _, "b");
}
public LoadConfigFile()
{
new szFile[128]
get_configsdir(szFile, charsmax(szFile))
format(szFile, 127, "%s/fast_ansewer.ini", szFile)
new iFile;
if(!(iFile = fopen(szFile, "r")))
set_fail_state("[Fast Ansewer] Nie ma pliku quiz.ini!")
new szBuffer[512], szFastAnsQuestion[256], szFastAnsAnsewer[192]
while(!feof(iFile))
{
fgets(iFile, szBuffer, 511)
trim(szBuffer)
if(!szBuffer[0] || szBuffer[0] == ';' || szBuffer[0] == ' ')
continue;
parse(szBuffer, szFastAnsQuestion, 255, szFastAnsAnsewer, 191);
remove_quotes(szFastAnsQuestion);
remove_quotes(szFastAnsAnsewer);
ArrayPushString(gaFastAnsInfo[InfoQuestion], szFastAnsQuestion)
ArrayPushString(gaFastAnsInfo[InfoAnsewer], szFastAnsAnsewer)
}
if(!ArraySize(gaFastAnsInfo[InfoQuestion]))
log_amx("[Fast Ansewer] W pliku nie ma zadnych pytan!");
else
log_amx("[Fast Ansewer] Zaladowano %d pytan!", ArraySize(gaFastAnsInfo[InfoQuestion]));
}
public handleSay(id)
{
if(giQuestion == -1)
return PLUGIN_CONTINUE
new szBuffer[192], szAnsewer[192];
read_args(szBuffer, 191);
ArrayGetString(gaFastAnsInfo[InfoAnsewer], giQuestion, szAnsewer, 191);
if(equali(szBuffer, szAnsewer))
GiveAward(id);
return PLUGIN_CONTINUE
}
public SayQuestion()
{
new giQuestion = random_num(0, ArraySize(gaFastAnsInfo[InfoQuestion]));
new szBuffer[256];
ArrayGetString(gaFastAnsInfo[InfoQuestion], giQuestion, szBuffer, 255);
ColorChat(0, RED, "[Fast Ansewer]^x01 %s", szBuffer);
set_task(1.0, "_taskHud", 9741, _, _, "a", 10)
giHudTimes = 10;
}
public GiveAward(id)
{
remove_task(9741);
giHudTimes = 0;
giQuestion = -1;
new szName[64], iAwardAmount;
get_user_name(id, szName, 63);
set_hudmessage(255, 0, 0, -1.0, 0.01, 0, 0.1, 3.0, 0.1, 0.1)
switch(random(1))
{
case 0:
{
iAwardAmount = random_num(1, 8);
show_hudmessage(0, "[Fast Ansewer]^x01 %s za poprawna odpowiedz dostal %d fragow!", szName, iAwardAmount);
set_pev(id, pev_frags, float(pev(id, pev_frags)+iAwardAmount))
message_begin(MSG_ALL, get_user_msgid("ScoreInfo"));
write_byte(id);
write_short(pev(id, pev_frags));
write_short(get_user_deaths(id));
write_short(0);
write_short(pev(id, pev_team));
message_end();
}
case 1:
{
iAwardAmount = random_num(800, 16000);
iAwardAmount = get_pdata_int(id, OFFSET_CSMONEY, 5) + iAwardAmount > 16000 ? 16000 : iAwardAmount;
show_hudmessage(0, "[Fast Ansewer]^x01 %s za poprawna odpowiedz dostal +%d $!", szName, iAwardAmount);
set_pdata_int(id, OFFSET_CSMONEY, iAwardAmount, 5);
message_begin(MSG_ONE, get_user_msgid("Money"), {0, 0, 0}, id);
write_long(iAwardAmount);
write_byte(1);
message_end();
}
}
}
public _taskHud(iTask)
{
if(--giHudTimes > 0)
{
set_hudmessage(255, 0, 0, -1.0, 0.01, 0, 0.1, 3.0, 0.1, 0.1)
show_hudmessage(0, "[Fast Ansewer]^x01 Zostalo %d sekund!", giHudTimes)
}
else
{
set_hudmessage(255, 0, 0, -1.0, 0.01, 0, 0.1, 3.0, 0.1, 0.1)
show_hudmessage(0, "[Fast Ansewer]^x01 Niestety, nikt nie wygral ")
giHudTimes = 0;
giQuestion = -1;
}
}
"pytanie" "odpowiedz"
Napisano 10.02.2012 17:57
Użytkownik gring0 edytował ten post 10.02.2012 17:57
Napisano 15.02.2012 20:43
Inny
Dodanie Broni do PaintBallNapisany przez One ShooT, 05.02.2024 inny, modyfikacja |
|
||||
Modyfikacja
prośba o przerobienie pluginuprośba Napisany przez bili, 06.02.2021 modyfikacja |
|
||||
Modyfikacja
Prośba o dodanie modelu do vipa z generatoraNapisany przez Vanilla, 01.02.2021 modyfikacja |
|
||||
Modyfikacja
Plugin na przenikanie/spadochron pod komendąNapisany przez Polonez, 22.01.2021 modyfikacja |
|
||||
|
[ROZWIĄZANE] Modyfikacja pluginuNapisany przez _.-*`PaniQ*-._, 11.01.2021 modyfikacja |
|
0 użytkowników, 0 gości, 0 anonimowych