Raised This Month: $32 Target: $400
 8% 

Solved Solved


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
khalil15832
Member
Join Date: Dec 2013
Location: Tunisia
Old 12-31-2017 , 15:26   Solved
Reply With Quote #1

Solved

Last edited by khalil15832; 06-04-2018 at 11:02. Reason: Solved
khalil15832 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 12-31-2017 , 16:11   Re: Plugin Guess The Number
Reply With Quote #2

Tested it, enjoy!

I added 4 cvars and set their default to your requests.

Take a note that the time until a quiz starts again is 5 minutes after a player won, not after it started.
Attached Files
File Type: sma Get Plugin or Get Source (GuessTheNumber.sma - 171 views - 1.8 KB)

Last edited by eyal282; 12-31-2017 at 16:54.
eyal282 is offline
khalil15832
Member
Join Date: Dec 2013
Location: Tunisia
Old 12-31-2017 , 21:02   Re: Plugin Guess The Number
Reply With Quote #3

Quote:
Originally Posted by eyal282 View Post
Tested it, enjoy!

I added 4 cvars and set their default to your requests.

Take a note that the time until a quiz starts again is 5 minutes after a player won, not after it started.
Thanx, worked
but can you add when player say /200 just add "/" to don't spam in chat and thanx

Last edited by khalil15832; 12-31-2017 at 21:27.
khalil15832 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-01-2018 , 01:08   Re: Plugin Guess The Number
Reply With Quote #4

Quote:
Originally Posted by khalil15832 View Post
Thanx, worked
but can you add when player say /200 just add "/" to don't spam in chat and thanx
Until I reach a computer, might not even compile:

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

#define PLUGIN "Guess the number"
#define VERSION "1.0"
#define AUTHOR "FuckTheSchool ( Eyal282 )"

new bool:GuessActive;
new 
ChosenNumber;
new 
hcvarDelayhcvarPrizehcvarMinimumNumberhcvarMaximumNumber;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say""CmdSay");
    
hcvarDelay register_cvar("guess_number_delay""300.0");
    
hcvarPrize register_cvar("guess_number_prize""5000");
    
hcvarMinimumNumber register_cvar("guess_number_min""0");
    
hcvarMaximumNumber register_cvar("guess_number_max""500");
    
set_task(get_pcvar_float(hcvarDelay), "StartGuess");
}

public 
StartGuess()
{
    
GuessActive true;
    
ChosenNumber random_num(get_pcvar_num(hcvarMinimumNumber), get_pcvar_num(hcvarMaximumNumber));
    
client_print_color(0print_team_red"^3Guess the number^1 game has started!^4 Write down a number to get directions!");
}

public 
CmdSay(id)
{
    if(!
GuessActive)
        return;
        
    new 
Args[50];
    
read_args(Argscharsmax(Args));
    
remove_quotes(Args);
    
    if(
Args[0] != '/')
        return 
PLUGIN_CONTINUE;

    new 
PlayerGuess str_to_num(Args);
    if(
PlayerGuess == ChosenNumber)
    {
        new 
Name[32];
        
get_user_name(idNamecharsmax(Name));
        
GuessActive false;
        
client_print_color(0print_team_red"^3We have a winner!^4 %s^1 won the quiz!"Name);
        
cs_set_user_money(idcs_get_user_money(id) + get_pcvar_num(hcvarPrize));
        
set_task(get_pcvar_float(hcvarDelay), "StartGuess");
    return 
PLUGIN_CONTINUE;
    }
    else
    {
        
client_print_color(idprint_team_red"^1Your number is^4 %s^1 than the actual^3 number."PlayerGuess ChosenNumber "higher" "lower");
    )
    return 
PLUGIN_HANDLED;
}    
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
eyal282 is offline
khalil15832
Member
Join Date: Dec 2013
Location: Tunisia
Old 01-01-2018 , 09:34   Re: Plugin Guess The Number
Reply With Quote #5

Solved

Last edited by khalil15832; 06-04-2018 at 11:02. Reason: Solved
khalil15832 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-01-2018 , 13:21   Re: Solved & Thanx.
Reply With Quote #6

Why did you make your thread title "solved & thanks"?! Imagine what it would look like if everyone did that.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Elprah
Junior Member
Join Date: Jun 2009
Old 01-01-2018 , 16:10   Re: Solved & Thanx.
Reply With Quote #7

I was going to say the same thing about the thread title xD!
__________________
Sry for my bad english because i am from Chile
Up: Zombie Plague Down: Normal Mod

Dont use hacks is too bad and is for newbies Using sXe Injected is too good
Elprah is offline
khalil15832
Member
Join Date: Dec 2013
Location: Tunisia
Old 01-01-2018 , 18:07   Re: Solved & Thanx.
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
Why did you make your thread title "solved & thanks"?! Imagine what it would look like if everyone did that.
when i test the plugin, it's work but many peaple spam the chat , that's why forget to back title thread.
i need to fix this if you want to help me thanx .
khalil15832 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-01-2018 , 18:49   Re: Spam Chat Guess The Number
Reply With Quote #9

You completely failed to understand my point. Even if the problem is solved, you DON'T do such a thing to your title
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
khalil15832
Member
Join Date: Dec 2013
Location: Tunisia
Old 01-01-2018 , 19:43   Re: Spam Chat Guess The Number
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
You completely failed to understand my point. Even if the problem is solved, you DON'T do such a thing to your title
If you want to help , Thanx , if no don't waste my time ...
khalil15832 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 19:08.


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