Raised This Month: $ Target: $400
 0% 

[HELP] Help me


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 08-26-2012 , 12:58   [HELP] Help me
Reply With Quote #1

I have dr sw.I want to use this plugin on my server.

the plugin questions correct answer gives the issuer awards.

They are: Health,Armor,Money and Awp gun.The plugin i would like to add to it at drpoint(Deathrun Shop)

EDIT:

With cvar the value can be changed.(ex: "sm_drpoint","5")

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <fun> 
#include <cstrike> 

#define PLUGIN "The Smartest" 
#define VERSION "1.0" 
#define AUTHOR "Krevedko" 

//new string_nums 
new question[131
new 
answer[64
new 
quest[64
new 
nick_winner[32
new 
results 
new string_num 
new random_quest 
new SayText 
new bool:HasC4[33

// Квары 
new redgreenblue 
new moneyawpstrip_weaponhealtharmorkevlarsound 

public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
register_logevent("newround"2"1=Round_Start"); 
    
red register_cvar("sm_red","0"); 
    
green register_cvar("sm_green","255"); 
    
blue register_cvar("sm_blue","0"); 
    
money register_cvar("sm_money","3500"); 
    
awp register_cvar("sm_awp","1"); 
    
sound register_cvar("sm_sound","1"); 
    
health register_cvar("sm_health","15"); 
    
armor register_cvar("sm_armor","100"); 
    
kevlar register_cvar("sm_kevlar","1"); 
    
strip_weapon register_cvar("sm_strip","1"); 
    
register_clcmd("say /vopros","resultats"); 
    
register_clcmd("say /question","resultats"); 
    
register_clcmd("say /winner""winner"); 
    
register_clcmd("say","check_results"); 
    
register_clcmd("say_team","check_results"); 
    
SayText get_user_msgid("SayText"); 
    
readfiles() 


public 
plugin_precache()  

    
precache_sound("the_smart/pipewarp.wav"
    return 
PLUGIN_CONTINUE 


public 
readfiles() 

    if (!
file_exists("addons/amxmodx/configs/questions.ini")) 
    { 
        
write_file("addons/amxmodx/configs/questions.ini""; This is questation database file. DB structure:^n;^"&#1074;questation^" ^"answer^"^n^"1+1^" ^"2^"", -1)  
    



public 
newround() 

    
results 
    
new txtlen 
    string_num 
file_size("addons/amxmodx/configs/questions.ini"1
    
random_quest random_num 1,string_num 
    
read_file("addons/amxmodx/configs/questions.ini"random_questquestion130txtlen
    while ( (
question[0] == ';' || equali(question,"")) ) 
    { 
        
random_quest random_num 1,string_num 
        
read_file("addons/amxmodx/configs/questions.ini"random_questquestion130txtlen
    } 
    
    
// парсим 
    
trim(question
    
    
parse(questionquestsizeof(quest) , answersizeof(answer)) 
    
    
    
set_hudmessage(get_pcvar_num(red), get_pcvar_num(green), get_pcvar_num(blue), 0.030.5506.012.00.20.2, -1
    
show_hudmessage(0"Smartest: %s = ?"quest




public 
check_results(id

    
    static 
chat[192]; 
    
read_args(chatsizeof(chat) - 1); 
    
remove_quotes(chat); 
    
    if ( 
results == ) { // проверка на доступность ответа 
        
        
if (equali(chatanswer )) 
        { 
            
go_nagrada(id
        } 
    } else 
    
    if (
chat[0] == '-' || chat[0] == '1' || chat[0] == '2' || chat[0] == '3' || chat[0] == '4' || chat[0] == '5' || chat[0] == '6' || chat[0] == '7' || 
    
chat[0] == '8' || chat[0] == '9' || chat[0] == '0'
    
print_col_chat(0"^4К Sorry, but ^3%s ^4 is already answered and gained award."nick_winner// Обламываем 


public 
go_nagrada(id// награда 

    
results // записываем ответ 
    
    
if (get_pcvar_num(sound) == 1) { 
        
client_cmd(0"spk the_smart/pipewarp" 
    } 
    
    if (
is_user_alive(id)) { 
        if (
get_pcvar_num(awp) == 1
        { 
            if (
get_pcvar_num(strip_weapon) == 1
            { 
                
                if (
user_has_weapon(idCSW_C4) && get_user_team(id) == 1
                    
HasC4[id] = true
                else 
                    
HasC4[id] = false
                
                
strip_user_weapons(id
                
                if (
HasC4[id]) 
                { 
                    
give_item(id"weapon_c4"); 
                    
cs_set_user_plantid ); 
                } 
                
                
give_item(id"weapon_knife"
                
give_item(id"weapon_deagle"
                
cs_set_user_bpammoidCSW_DEAGLE35 
                
            } 
            
give_item(id"weapon_awp"
            
cs_set_user_bpammoidCSW_AWP20 
        } 
        if ( 
get_pcvar_num(kevlar) == ) { 
            
give_item(id"item_kevlar"
        } 
        new 
give_health get_user_health(id) + get_pcvar_num(health
        
set_user_health(idgive_health
        new 
give_armor get_pcvar_num(armor
        
set_user_armor(idgive_armor
    }     
    
get_user_name(id,nick_winner,31); 
    new 
give_money cs_get_user_money(id) + get_pcvar_num(money
    
cs_set_user_money(idgive_money
    
print_col_chat(0"^4%s^3 have got first right answer^4and gained award! ^3%i ^4$, ^3%i ^4hp, ^3%i ^4ap"nick_winnerget_pcvar_num(money), get_pcvar_num(health), 
    
get_pcvar_num(armor)) 
    if ( 
get_pcvar_num(awp) == 1
        
print_col_chat(0"^4and ^3AWP"


public 
winner(id

    if ( 
results == 
    { 
        
print_col_chat(id"^4%s^3 have got first right answer! ^4и gained award! ^3%i ^4$, ^3%i ^4hp, ^3%i ^4ap"nick_winnerget_pcvar_num(money), get_pcvar_num(health), 
        
get_pcvar_num(armor)) 
        if ( 
get_pcvar_num(awp) == 1
            
print_col_chat(id"^4and ^3AWP"
    } else 
    
print_col_chat(id"^4No one answered right. Be first?"


public 
resultats(id

    
set_hudmessage(get_pcvar_num(red), get_pcvar_num(green), get_pcvar_num(blue), 0.030.5506.012.00.20.2, -1
    if ( 
results == 
    { 
        
show_hudmessage(id"Smartest ended. Winner in chat."
        
print_col_chat(id"^4First is ^3%s ^4and he is gained award! ^3%i ^4$, ^3%i ^4hp, ^3%i ^4ap"nick_winnerget_pcvar_num(money), get_pcvar_num(health), 
        
get_pcvar_num(armor)) 
        if ( 
get_pcvar_num(awp) == 1
            
print_col_chat(id"^4and ^3AWP"
    } else 

    
show_hudmessage(id"Smartest: %s = ?"quest



stock print_col_chat(const id, const input[], any:...)  
{  
new 
count 1players[32];  
static 
msg[191];  
vformat(msg190input3);  
replace_all(msg190"!g""^4"); // Green Color  
replace_all(msg190"!y""^1"); // Default Color (у©°  ж№«ој©)  
replace_all(msg190"!t""^3"); // Team Color  
if (idplayers[0] = id; else get_players(playerscount"ch");  
{  
for ( new 
0counti++ )  
{  
    if ( 
is_user_connected(players[i]) )  
    { 
        
message_begin(MSG_ONE_UNRELIABLESayText_players[i]);  
        
write_byte(players[i]);  
        
write_string(msg);  
        
message_end(); 
    }  
}  
}  


Last edited by Choose_Your_Destiny; 08-26-2012 at 18:27.
Choose_Your_Destiny is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-26-2012 , 13:07   Re: [HELP] Help me
Reply With Quote #2

1. make a descriptive topic.
2. what? Not sure what you want.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 08-26-2012 , 13:28   Re: [HELP] Help me
Reply With Quote #3

PHP Code:
print_col_chat(0"^4%s^3 have got first right answer^4and gained award! ^3%i ^4$, ^3%i ^4hp, ^3%i ^4ap,^3%i ^4DRPOINT"nick_winnerget_pcvar_num(money), get_pcvar_num(health), get_pcvar_num(drpoint
    
get_pcvar_num(armor))  
    if ( 
get_pcvar_num(awp) == 1)  
        
print_col_chat(0"^4and ^3AWP"
PHP Code:
get_pcvar_num(drpoint
I want to add this plugin drpoint

Last edited by Choose_Your_Destiny; 08-26-2012 at 13:29.
Choose_Your_Destiny is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-26-2012 , 13:35   Re: [HELP] Help me
Reply With Quote #4

in plugin_init

drpoint = register_cvar("amx_drpoint", "1")

is that what you want?
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Old 08-26-2012, 13:39
Choose_Your_Destiny
This message has been deleted by Choose_Your_Destiny.
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 08-26-2012 , 13:53   Re: [HELP] Help me
Reply With Quote #5

Ohhh yeah!! Thnx man

EDIT:

It gives 100 drpoint I want just 10 drpoint(or cvar command can be set with)

Last edited by Choose_Your_Destiny; 08-26-2012 at 14:10.
Choose_Your_Destiny is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-26-2012 , 14:11   Re: [HELP] Help me
Reply With Quote #6

change the cvar value?

and don't delete your code.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 08-26-2012 at 14:11.
Liverwiz is offline
Old 08-26-2012, 14:18
Choose_Your_Destiny
This message has been deleted by Choose_Your_Destiny. Reason: bump
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 08-26-2012 , 18:31   Re: [HELP] Help me
Reply With Quote #7

Quote:
Originally Posted by Liverwiz View Post
change the cvar value?

and don't delete your code.
I have done enough description in topic.
Choose_Your_Destiny is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode