MyBB, XenForo, vBulletin rakibi DiyoBB çok yakında beta süreci ile webailesi.com adresinde! Tıkla ve detayları görüntüle

Soruyu şu nickli oyuncu doğru cevapladı

Konu

#1
Eklentide "nickli" oyuncu soruyu doğru cevapladı şeklinde chatte herkese gözükmesini istiyorum, eklentiyi düzenleyebilir misiniz ?
.sma quiz.sma (Dosya Boyutu: 9,06 KB | İndirme Sayısı: 7)
Son Düzenleme: 04-11-2021, 16:40, Düzenleyen: Mahinev.
#2
Eklenti ingilizce. Siz ingilizce mi kullanacaksınız ?
Dilerseniz forumda quiz eklentisi var. Onu kullanabilirsiniz.
(- Ücretli Eklenti Yaptırmak İsteyen -)
#3
(04-11-2021, 17:22)suriyelikene Adlı Kullanıcıdan Alıntı: Eklenti ingilizce. Siz ingilizce mi kullanacaksınız ?
Dilerseniz forumda quiz eklentisi var. Onu kullanabilirsiniz.
türkçeleştirebilirim ancak "chatte şu kişi soruyu doğru cevapladı" yazmıyor onu halledebilirseniz işime yarayacaktır. şimdiden teşekkürler
#4
(04-11-2021, 18:00)Mahinev Adlı Kullanıcıdan Alıntı:
(04-11-2021, 17:22)suriyelikene Adlı Kullanıcıdan Alıntı: Eklenti ingilizce. Siz ingilizce mi kullanacaksınız ?
Dilerseniz forumda quiz eklentisi var. Onu kullanabilirsiniz.
türkçeleştirebilirim ancak "chatte şu kişi soruyu doğru cevapladı" yazmıyor onu halledebilirseniz işime yarayacaktır. şimdiden teşekkürler

eklenti içinde doğru cevapladı diye bir yer var ama chat'e yazıyormu hiçbir fikrim yok
#5
(04-11-2021, 18:59)Possidentis Adlı Kullanıcıdan Alıntı:
(04-11-2021, 18:00)Mahinev Adlı Kullanıcıdan Alıntı: türkçeleştirebilirim ancak "chatte şu kişi soruyu doğru cevapladı" yazmıyor onu halledebilirseniz işime yarayacaktır. şimdiden teşekkürler

eklenti içinde doğru cevapladı diye bir yer var ama chat'e yazıyormu hiçbir fikrim yok
cevap doğru yanıtlandı mesajı alınıyor ancak kimin doğru cevapladığı gözükmüyor
#6
Eklenti anlamsız yazılmış bunu kullanmanı tavsiye etmem ancak istediğin özelliği ekledim yinede bir kontrol et. 


PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new plugin[] = "Quiz"
new version[] = "0.6"
new author[] = "Doombringer"

new enableduse_moderewardtimelimitmin_displaymax_displaydisplay_mode

#define MAX_QUESTIONS 200
#define MAX_NUM_OF_CHAR 190

//#define MIN_TIME 20.0
//#define MAX_TIME 50.0


new Questions[MAX_QUESTIONS][MAX_NUM_OF_CHAR]
new 
Answers[MAX_QUESTIONS][MAX_NUM_OF_CHAR]
new 
bool:alreadyused[MAX_QUESTIONS]
new 
num_of_questions

new iG_KazananID;

new 
used_question[1][MAX_NUM_OF_CHAR]
new 
used_answer[1][MAX_NUM_OF_CHAR]
new 
text[MAX_NUM_OF_CHAR]

new 
answered_questions[32]

new 
quiz_file[62]
new 
g_MyMsgSync

public plugin_init()
{
    
register_plugin(plugin,version,author)
    
    
register_clcmd("say","handle_say")
    
register_clcmd("say_team","handle_say")
    
    new 
config[64]
    
get_configsdir(config,63)
    
    
formatex(quiz_file,61,"%s/quiz_file.ini",config)
    
    
enabled register_cvar("quiz_enabled","1")
    
use_mode register_cvar("quiz_usemode","0")
    
    if(
is_module_loaded("cstrike") != -1)    
    
reward register_cvar("quiz_reward","2000")
    
    
timelimit register_cvar("quiz_timelimit","120")
    
    
min_display register_cvar("quiz_min_display","20")
    
max_display register_cvar("quiz_max_display","50")
    
display_mode register_cvar("quiz_display_mode","0")
    
    
register_cvar("amx_quiz_version",version,FCVAR_SERVER)
    
    
g_MyMsgSync CreateHudSyncObj()

    if(!
file_exists(quiz_file))
    {
        new 
file fopen(quiz_file,"wt")
        
fprintf(file"; Quiz file^n")
        
fprintf(file"; Here goes all questions/answers^n")
        
fprintf(file"; Questions/Answers goes like ^"what is 1+1?^" ^"2^"^n")
        
fclose(file)
    }

    
load_quiz()

    
pick_question()
    
    
set_display_time()

    return 
PLUGIN_CONTINUE
}

public 
say(idtext_to_say[])
{
    
//remove_quotes(text_to_say)
    
    
if(get_pcvar_num(display_mode) == 0)
    {
        
client_print(idprint_chat"%s"text_to_say)
    }
    else if(
get_pcvar_num(display_mode) == 1)
    {
        
set_hudmessage(random(255), random(255), random(255), -1.00.3706.07.00.10.2)
                //show_hudmessage(id, "%s", text_to_say)
                ShowSyncHudMsg(idg_MyMsgSync"%s"text_to_say)
            }
            else if(get_pcvar_num(display_mode) == 2)
            {
                client_print(idprint_chat"%s"text_to_say)

                set_hudmessage(random(255), random(255), random(255), -1.00.3706.07.00.10.2)
                ShowSyncHudMsg(idg_MyMsgSync"%s"text_to_say)
            }

            return PLUGIN_CONTINUE
        
}


        public load_quiz()
        {
            if(get_pcvar_num(enabled) < 1)
            return PLUGIN_HANDLED

            
new file fopen(quiz_file,"rt")

            if(!file)
            {
                server_print("[%s, load_quiz()] Error, File not found!",plugin)
                return PLUGIN_HANDLED
            
}

            new f_question[MAX_NUM_OF_CHAR], f_answer[MAX_NUM_OF_CHAR]

            new Text[MAX_NUM_OF_CHAR]

            while(!feof(file) && num_of_questions MAX_QUESTIONS)
            {        
                fgets(fileTextMAX_NUM_OF_CHAR-1)

                if( Text[0] == ';' || equal(Text,"") )
                continue;

                parse(Textf_questionMAX_NUM_OF_CHAR-1f_answerMAX_NUM_OF_CHAR-1)

                num_of_questions++

        
//trim(f_question)
        //trim(f_answer)
        
        
remove_quotes(f_answer)
        
        
Questions[num_of_questions] = f_question
        Answers
[num_of_questions] = f_answer
    
}
    
iG_KazananID 0;
    
fclose(file)
    
    if(
num_of_questions 1)
    {
        
server_print("[%s] ERROR! You need more questions, you have %d, you need more then 2",pluginnum_of_questions)
        
pause("ad")
    }
    
    
server_print("[%s] Successfully loaded %d questions",plugin,num_of_questions)
    
    return 
PLUGIN_HANDLED
}

public 
display_question()
{    
    new 
Players[32], playerCountid
    
    formatex
(textMAX_NUM_OF_CHAR-1,"Question: %s"used_question[0])
    
    if(
get_pcvar_num(use_mode) == 0)
    {
        
get_players(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        
get_players(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    
say(0,text)

    
set_display_time()
}

public 
take_new_question()
{
    new 
Players[32], playerCountid
    
    formatex
(textMAX_NUM_OF_CHAR-1,"[%s] We now passed the time-limit, picking new question..."plugin)
    
    if(
get_pcvar_num(use_mode) == 0)
    {
        
get_players(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        
get_players(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    
say(0,text)

    
pick_question()
}

public 
set_timelimit()
{
    if( (
get_pcvar_num(timelimit) < 1) || (get_pcvar_num(enabled) < 1) )
    return 
PLUGIN_CONTINUE
    
    set_task
(float(get_pcvar_num(timelimit)),"take_new_question"33523)
    
    return 
PLUGIN_CONTINUE
}

stock set_display_time()
{
    if(
get_pcvar_num(enabled) < 1)
    return 
PLUGIN_CONTINUE
    
    set_task
(random_float(float(get_pcvar_num(min_display)),float(get_pcvar_num(max_display))),"display_question")
    
    return 
PLUGIN_CONTINUE
}

public 
pick_question()
{            
    new 
number random_num(1,num_of_questions)
    
    if(
alreadyused[number] == true)
    
set_task(0.1,"pick_question")
    
iG_KazananID 0;
    
//used_question[0] = Questions[number]
    //used_answer[0] = Answers[number]
    
    
copy(used_question[0], MAX_NUM_OF_CHAR-1Questions[number])
    
copy(used_answer[0], MAX_NUM_OF_CHAR-1Answers[number])
    
    
alreadyused[number] = true
    
    set_timelimit
()
    
    return 
PLUGIN_HANDLED
}

give_reward(idname[])
{            
    if(
get_pcvar_num(use_mode) == 0)
    {        
   
        
new Players[32], playerCountplayer
        
        get_players
(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
player Players[i]
            
            if(
get_pcvar_num(display_mode) == 0)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
                
say(playertext)

                
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
            else if(
get_pcvar_num(display_mode) == 1)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        new 
Players[32], playerCountplayer
        
        get_players
(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
player Players[i]
            
            if(
get_pcvar_num(display_mode) == 0)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
                
say(playertext)

                
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
            else if(
get_pcvar_num(display_mode) == 1)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    {
        if(
get_pcvar_num(display_mode) == 0)
        {
            
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
            
say(0text)
            
            
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
            
say(0text)
        }
        else if(
get_pcvar_num(display_mode) == 1)
        {
            
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
            
say(0text)
        }
    }             
    
    if(
is_module_loaded("cstrike") != -1)
    {
        new 
get_pcvar_num(reward)
        
formatex(textMAX_NUM_OF_CHAR-1,"You got %d $ for answering right"R)
        
say(idtext)

        
cs_set_user_money(idcs_get_user_money(id) + R)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
handle_say(id)
{
    if(
get_pcvar_num(enabled) < 1)
    return 
PLUGIN_CONTINUE
    
    
if( (get_pcvar_num(use_mode) == 0) && (is_user_alive(id)) )
    return 
PLUGIN_CONTINUE
    
    
else if( (get_pcvar_num(use_mode) == 1) && (!is_user_alive(id)) )
    return 
PLUGIN_CONTINUE
    
    
new Arg[64]
    
    
read_args(Arg,63)
    
    if(
contain(Argused_answer[0]) != -1)
    {
        if(!
iG_KazananID){
            
answered_questions[id]++

            
remove_task(33523)

            new 
name[32]
            
get_user_name(id,name,31)
            
iG_KazananID id;
            
give_reward(idname)
            
pick_question()
        }
        else {
            if(
is_user_connected(iG_KazananID)){
                new 
name[32]
                
get_user_name(iG_KazananID,name,31)
                
client_print(idprint_chat"Hey senden once %s isimli oyuncu soruyu yanitladi",name)
            }
            else {
                
client_print(idprint_chat"Hey senden once birisi soruyu yanitladi")
            }
        }
    }
    
    if(
contain(Arg"/question") != -1)
    {
        
formatex(textMAX_NUM_OF_CHAR-1,"Question: %s"used_question[0])
        
say(idtext)
    }

    return 
PLUGIN_CONTINUE

İletişim bilgilerim;
#7
(04-11-2021, 19:12)MawiLarq Adlı Kullanıcıdan Alıntı: Eklenti anlamsız yazılmış bunu kullanmanı tavsiye etmem ancak istediğin özelliği ekledim yinede bir kontrol et. 


PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new plugin[] = "Quiz"
new version[] = "0.6"
new author[] = "Doombringer"

new enableduse_moderewardtimelimitmin_displaymax_displaydisplay_mode

#define MAX_QUESTIONS 200
#define MAX_NUM_OF_CHAR 190

//#define MIN_TIME 20.0
//#define MAX_TIME 50.0


new Questions[MAX_QUESTIONS][MAX_NUM_OF_CHAR]
new 
Answers[MAX_QUESTIONS][MAX_NUM_OF_CHAR]
new 
bool:alreadyused[MAX_QUESTIONS]
new 
num_of_questions

new iG_KazananID;

new 
used_question[1][MAX_NUM_OF_CHAR]
new 
used_answer[1][MAX_NUM_OF_CHAR]
new 
text[MAX_NUM_OF_CHAR]

new 
answered_questions[32]

new 
quiz_file[62]
new 
g_MyMsgSync

public plugin_init()
{
    
register_plugin(plugin,version,author)
    
    
register_clcmd("say","handle_say")
    
register_clcmd("say_team","handle_say")
    
    new 
config[64]
    
get_configsdir(config,63)
    
    
formatex(quiz_file,61,"%s/quiz_file.ini",config)
    
    
enabled register_cvar("quiz_enabled","1")
    
use_mode register_cvar("quiz_usemode","0")
    
    if(
is_module_loaded("cstrike") != -1)    
    
reward register_cvar("quiz_reward","2000")
    
    
timelimit register_cvar("quiz_timelimit","120")
    
    
min_display register_cvar("quiz_min_display","20")
    
max_display register_cvar("quiz_max_display","50")
    
display_mode register_cvar("quiz_display_mode","0")
    
    
register_cvar("amx_quiz_version",version,FCVAR_SERVER)
    
    
g_MyMsgSync CreateHudSyncObj()

    if(!
file_exists(quiz_file))
    {
        new 
file fopen(quiz_file,"wt")
        
fprintf(file"; Quiz file^n")
        
fprintf(file"; Here goes all questions/answers^n")
        
fprintf(file"; Questions/Answers goes like ^"what is 1+1?^" ^"2^"^n")
        
fclose(file)
    }

    
load_quiz()

    
pick_question()
    
    
set_display_time()

    return 
PLUGIN_CONTINUE
}

public 
say(idtext_to_say[])
{
    
//remove_quotes(text_to_say)
    
    
if(get_pcvar_num(display_mode) == 0)
    {
        
client_print(idprint_chat"%s"text_to_say)
    }
    else if(
get_pcvar_num(display_mode) == 1)
    {
        
set_hudmessage(random(255), random(255), random(255), -1.00.3706.07.00.10.2)
                //show_hudmessage(id, "%s", text_to_say)
                ShowSyncHudMsg(idg_MyMsgSync"%s"text_to_say)
            }
            else if(get_pcvar_num(display_mode) == 2)
            {
                client_print(idprint_chat"%s"text_to_say)

                set_hudmessage(random(255), random(255), random(255), -1.00.3706.07.00.10.2)
                ShowSyncHudMsg(idg_MyMsgSync"%s"text_to_say)
            }

            return PLUGIN_CONTINUE
        
}


        public load_quiz()
        {
            if(get_pcvar_num(enabled) < 1)
            return PLUGIN_HANDLED

            
new file fopen(quiz_file,"rt")

            if(!file)
            {
                server_print("[%s, load_quiz()] Error, File not found!",plugin)
                return PLUGIN_HANDLED
            
}

            new f_question[MAX_NUM_OF_CHAR], f_answer[MAX_NUM_OF_CHAR]

            new Text[MAX_NUM_OF_CHAR]

            while(!feof(file) && num_of_questions MAX_QUESTIONS)
            {        
                fgets(fileTextMAX_NUM_OF_CHAR-1)

                if( Text[0] == ';' || equal(Text,"") )
                continue;

                parse(Textf_questionMAX_NUM_OF_CHAR-1f_answerMAX_NUM_OF_CHAR-1)

                num_of_questions++

        
//trim(f_question)
        //trim(f_answer)
        
        
remove_quotes(f_answer)
        
        
Questions[num_of_questions] = f_question
        Answers
[num_of_questions] = f_answer
    
}
    
iG_KazananID 0;
    
fclose(file)
    
    if(
num_of_questions 1)
    {
        
server_print("[%s] ERROR! You need more questions, you have %d, you need more then 2",pluginnum_of_questions)
        
pause("ad")
    }
    
    
server_print("[%s] Successfully loaded %d questions",plugin,num_of_questions)
    
    return 
PLUGIN_HANDLED
}

public 
display_question()
{    
    new 
Players[32], playerCountid
    
    formatex
(textMAX_NUM_OF_CHAR-1,"Question: %s"used_question[0])
    
    if(
get_pcvar_num(use_mode) == 0)
    {
        
get_players(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        
get_players(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    
say(0,text)

    
set_display_time()
}

public 
take_new_question()
{
    new 
Players[32], playerCountid
    
    formatex
(textMAX_NUM_OF_CHAR-1,"[%s] We now passed the time-limit, picking new question..."plugin)
    
    if(
get_pcvar_num(use_mode) == 0)
    {
        
get_players(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        
get_players(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    
say(0,text)

    
pick_question()
}

public 
set_timelimit()
{
    if( (
get_pcvar_num(timelimit) < 1) || (get_pcvar_num(enabled) < 1) )
    return 
PLUGIN_CONTINUE
    
    set_task
(float(get_pcvar_num(timelimit)),"take_new_question"33523)
    
    return 
PLUGIN_CONTINUE
}

stock set_display_time()
{
    if(
get_pcvar_num(enabled) < 1)
    return 
PLUGIN_CONTINUE
    
    set_task
(random_float(float(get_pcvar_num(min_display)),float(get_pcvar_num(max_display))),"display_question")
    
    return 
PLUGIN_CONTINUE
}

public 
pick_question()
{            
    new 
number random_num(1,num_of_questions)
    
    if(
alreadyused[number] == true)
    
set_task(0.1,"pick_question")
    
iG_KazananID 0;
    
//used_question[0] = Questions[number]
    //used_answer[0] = Answers[number]
    
    
copy(used_question[0], MAX_NUM_OF_CHAR-1Questions[number])
    
copy(used_answer[0], MAX_NUM_OF_CHAR-1Answers[number])
    
    
alreadyused[number] = true
    
    set_timelimit
()
    
    return 
PLUGIN_HANDLED
}

give_reward(idname[])
{            
    if(
get_pcvar_num(use_mode) == 0)
    {        
   
        
new Players[32], playerCountplayer
        
        get_players
(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
player Players[i]
            
            if(
get_pcvar_num(display_mode) == 0)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
                
say(playertext)

                
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
            else if(
get_pcvar_num(display_mode) == 1)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        new 
Players[32], playerCountplayer
        
        get_players
(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
player Players[i]
            
            if(
get_pcvar_num(display_mode) == 0)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
                
say(playertext)

                
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
            else if(
get_pcvar_num(display_mode) == 1)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    {
        if(
get_pcvar_num(display_mode) == 0)
        {
            
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
            
say(0text)
            
            
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
            
say(0text)
        }
        else if(
get_pcvar_num(display_mode) == 1)
        {
            
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
            
say(0text)
        }
    }             
    
    if(
is_module_loaded("cstrike") != -1)
    {
        new 
get_pcvar_num(reward)
        
formatex(textMAX_NUM_OF_CHAR-1,"You got %d $ for answering right"R)
        
say(idtext)

        
cs_set_user_money(idcs_get_user_money(id) + R)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
handle_say(id)
{
    if(
get_pcvar_num(enabled) < 1)
    return 
PLUGIN_CONTINUE
    
    
if( (get_pcvar_num(use_mode) == 0) && (is_user_alive(id)) )
    return 
PLUGIN_CONTINUE
    
    
else if( (get_pcvar_num(use_mode) == 1) && (!is_user_alive(id)) )
    return 
PLUGIN_CONTINUE
    
    
new Arg[64]
    
    
read_args(Arg,63)
    
    if(
contain(Argused_answer[0]) != -1)
    {
        if(!
iG_KazananID){
            
answered_questions[id]++

            
remove_task(33523)

            new 
name[32]
            
get_user_name(id,name,31)
            
iG_KazananID id;
            
give_reward(idname)
            
pick_question()
        }
        else {
            if(
is_user_connected(iG_KazananID)){
                new 
name[32]
                
get_user_name(iG_KazananID,name,31)
                
client_print(idprint_chat"Hey senden once %s isimli oyuncu soruyu yanitladi",name)
            }
            else {
                
client_print(idprint_chat"Hey senden once birisi soruyu yanitladi")
            }
        }
    }
    
    if(
contain(Arg"/question") != -1)
    {
        
formatex(textMAX_NUM_OF_CHAR-1,"Question: %s"used_question[0])
        
say(idtext)
    }

    return 
PLUGIN_CONTINUE

bu sefer soru bile sormuyor
#8
PHP Kod:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new plugin[] = "Quiz"
new version[] = "0.6"
new author[] = "Doombringer"

new iG_KazananID;

new 
enableduse_moderewardtimelimitmin_displaymax_displaydisplay_mode

#define MAX_QUESTIONS 200
#define MAX_NUM_OF_CHAR 190

//#define MIN_TIME 20.0
//#define MAX_TIME 50.0


new Questions[MAX_QUESTIONS][MAX_NUM_OF_CHAR]
new 
Answers[MAX_QUESTIONS][MAX_NUM_OF_CHAR]
new 
bool:alreadyused[MAX_QUESTIONS]
new 
num_of_questions

new used_question[1][MAX_NUM_OF_CHAR]
new 
used_answer[1][MAX_NUM_OF_CHAR]
new 
text[MAX_NUM_OF_CHAR]

new 
answered_questions[32]

new 
quiz_file[62]
new 
g_MyMsgSync

public plugin_init()
{
    
register_plugin(plugin,version,author)
    
    
register_clcmd("say","handle_say")
    
register_clcmd("say_team","handle_say")
    
    new 
config[64]
    
get_configsdir(config,63)
    
    
formatex(quiz_file,61,"%s/quiz_file.ini",config)
    
    
enabled register_cvar("quiz_enabled","1")
    
use_mode register_cvar("quiz_usemode","0")
    
    if(
is_module_loaded("cstrike") != -1)    
    
reward register_cvar("quiz_reward","2000")
    
    
timelimit register_cvar("quiz_timelimit","120")
    
    
min_display register_cvar("quiz_min_display","20")
    
max_display register_cvar("quiz_max_display","50")
    
display_mode register_cvar("quiz_display_mode","0")
    
    
register_cvar("amx_quiz_version",version,FCVAR_SERVER)
    
    
g_MyMsgSync CreateHudSyncObj()

    if(!
file_exists(quiz_file))
    {
        new 
file fopen(quiz_file,"wt")
        
fprintf(file"; Quiz file^n")
        
fprintf(file"; Here goes all questions/answers^n")
        
fprintf(file"; Questions/Answers goes like ^"what is 1+1?^" ^"2^"^n")
        
fclose(file)
    }

    
load_quiz()

    
pick_question()
    
    
set_display_time()

    return 
PLUGIN_CONTINUE
}

public 
say(idtext_to_say[])
{
    
    if(
get_pcvar_num(display_mode) == 0)
    {
        
client_print(idprint_chat"%s"text_to_say)
    }
    else if(
get_pcvar_num(display_mode) == 1)
    {
        
set_hudmessage(random(255), random(255), random(255), -1.00.3706.07.00.10.2)

        
ShowSyncHudMsg(idg_MyMsgSync"%s"text_to_say)
    }
    else if(
get_pcvar_num(display_mode) == 2)
    {
        
client_print(idprint_chat"%s"text_to_say)

        
set_hudmessage(random(255), random(255), random(255), -1.00.3706.07.00.10.2)
        
ShowSyncHudMsg(idg_MyMsgSync"%s"text_to_say)
    }

    return 
PLUGIN_CONTINUE
}


public 
load_quiz()
{
    if(
get_pcvar_num(enabled) < 1)
    return 
PLUGIN_HANDLED

    
new file fopen(quiz_file,"rt")

    if(!
file)
    {
        
server_print("[%s, load_quiz()] Error, File not found!",plugin)
        return 
PLUGIN_HANDLED
    
}

    new 
f_question[MAX_NUM_OF_CHAR], f_answer[MAX_NUM_OF_CHAR]

    new 
Text[MAX_NUM_OF_CHAR]

    while(!
feof(file) && num_of_questions MAX_QUESTIONS)
    {        
        
fgets(fileTextMAX_NUM_OF_CHAR-1)

        if( 
Text[0] == ';' || equal(Text,"") )
        continue;

        
parse(Textf_questionMAX_NUM_OF_CHAR-1f_answerMAX_NUM_OF_CHAR-1)

        
num_of_questions++

        
//trim(f_question)
        //trim(f_answer)
        
        
remove_quotes(f_answer)
        
        
Questions[num_of_questions] = f_question
        Answers
[num_of_questions] = f_answer
    
}
    
    
fclose(file)
    
    if(
num_of_questions 1)
    {
        
server_print("[%s] ERROR! You need more questions, you have %d, you need more then 2",pluginnum_of_questions)
        
pause("ad")
    }
    
    
server_print("[%s] Successfully loaded %d questions",plugin,num_of_questions)
    
    return 
PLUGIN_HANDLED
}

public 
display_question()
{    
    new 
Players[32], playerCountid
    
    formatex
(textMAX_NUM_OF_CHAR-1,"Question: %s"used_question[0])
    
    if(
get_pcvar_num(use_mode) == 0)
    {
        
get_players(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        
get_players(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    
say(0,text)

    
set_display_time()
}

public 
take_new_question()
{
    new 
Players[32], playerCountid
    
    formatex
(textMAX_NUM_OF_CHAR-1,"[%s] We now passed the time-limit, picking new question..."plugin)
    
    if(
get_pcvar_num(use_mode) == 0)
    {
        
get_players(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        
get_players(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
id Players[i]
            
            
say(id,text)
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    
say(0,text)

    
pick_question()
}

public 
set_timelimit()
{
    if( (
get_pcvar_num(timelimit) < 1) || (get_pcvar_num(enabled) < 1) )
    return 
PLUGIN_CONTINUE
    
    set_task
(float(get_pcvar_num(timelimit)),"take_new_question"33523)
    
    return 
PLUGIN_CONTINUE
}

stock set_display_time()
{
    if(
get_pcvar_num(enabled) < 1)
    return 
PLUGIN_CONTINUE
    
    set_task
(random_float(float(get_pcvar_num(min_display)),float(get_pcvar_num(max_display))),"display_question")
    
    return 
PLUGIN_CONTINUE
}

public 
pick_question()
{            
    new 
number random_num(1,num_of_questions)
    
    if(
alreadyused[number] == true)
    
set_task(0.1,"pick_question")
    
    
//used_question[0] = Questions[number]
    //used_answer[0] = Answers[number]
    
    
copy(used_question[0], MAX_NUM_OF_CHAR-1Questions[number])
    
copy(used_answer[0], MAX_NUM_OF_CHAR-1Answers[number])
    
    
alreadyused[number] = true
    
    set_timelimit
()
    
    return 
PLUGIN_HANDLED
}

give_reward(idname[])
{            
    if(
get_pcvar_num(use_mode) == 0)
    {        
   
        
new Players[32], playerCountplayer
        
        get_players
(PlayersplayerCount"b"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
player Players[i]
            
            if(
get_pcvar_num(display_mode) == 0)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
                
say(playertext)

                
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
            else if(
get_pcvar_num(display_mode) == 1)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
        }
    }
    else if(
get_pcvar_num(use_mode) == 1)
    {
        new 
Players[32], playerCountplayer
        
        get_players
(PlayersplayerCount"a"
        
        for(new 
i=1;i<playerCount;i++)
        {
            
player Players[i]
            
            if(
get_pcvar_num(display_mode) == 0)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
                
say(playertext)

                
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
            else if(
get_pcvar_num(display_mode) == 1)
            {
                
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
                
say(playertext)
            }
        }
    }
    else if(
get_pcvar_num(use_mode) == 2)
    {
        if(
get_pcvar_num(display_mode) == 0)
        {
            
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s",name,used_question[0])
            
say(0text)
            
            
formatex(textMAX_NUM_OF_CHAR-1,"%s has answered right to %d %s now",name,answered_questions[id], answered_questions[id] == "question":"questions")
            
say(0text)
        }
        else if(
get_pcvar_num(display_mode) == 1)
        {
            
formatex(textMAX_NUM_OF_CHAR-1,"%s answered right on the question: %s^n%s has answered right to %d %s now",name,used_question[0],name,answered_questions[id], answered_questions[id] == "question":"questions")
            
say(0text)
        }
    }             
    
    if(
is_module_loaded("cstrike") != -1)
    {
        new 
get_pcvar_num(reward)
        
formatex(textMAX_NUM_OF_CHAR-1,"You got %d $ for answering right"R)
        
say(idtext)

        
cs_set_user_money(idcs_get_user_money(id) + R)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
handle_say(id)
{
    if(
get_pcvar_num(enabled) < 1)
    return 
PLUGIN_CONTINUE
    
    
if( (get_pcvar_num(use_mode) == 0) && (is_user_alive(id)) )
    return 
PLUGIN_CONTINUE
    
    
else if( (get_pcvar_num(use_mode) == 1) && (!is_user_alive(id)) )
    return 
PLUGIN_CONTINUE
    
    
new Arg[64]
    
    
read_args(Arg,63)
    
    if(
contain(Argused_answer[0]) != -1)
    {
        if(
contain(Argused_answer[0]) != -1)
        {
            if(!
iG_KazananID){
                
answered_questions[id]++

                
remove_task(33523)

                new 
name[32]
                
get_user_name(id,name,31)
                
iG_KazananID id;
                
give_reward(idname)
                
pick_question()
            }
            else {
                if(
is_user_connected(iG_KazananID)){
                    new 
name[32]
                    
get_user_name(iG_KazananID,name,31)
                    
client_print(idprint_chat"Hey senden once %s isimli oyuncu soruyu yanitladi",name)
                }
                else {
                    
client_print(idprint_chat"Hey senden once birisi soruyu yanitladi")
                }
            }
        }
    }
    
    if(
contain(Arg"/question") != -1)
    {
        
formatex(textMAX_NUM_OF_CHAR-1,"Question: %s"used_question[0])
        
say(idtext)
    }

    return 
PLUGIN_CONTINUE


Doğru kopyaladığına emin ol. Aynı zamanda şuanda test için bir kod gönderdim soru sorarsa ve hatasız yerleştirdiysem soruyu bilen kişiyi yazması gerek(Dediğim gibi eklenti anlamsız karıştırılmış incelemek için zaman ayırmadım).
İletişim bilgilerim;
#9
Deneyin bakalım :
.sma quiz.sma (Dosya Boyutu: 9,16 KB | İndirme Sayısı: 3)
(- Ücretli Eklenti Yaptırmak İsteyen -)
#10
(04-11-2021, 19:37)suriyelikene Adlı Kullanıcıdan Alıntı: Deneyin bakalım :
teşekkürler

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da
Task
Kayıt Ol
Discord Adresimize Katılın