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

/hprollthedice


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gstan
BANNED
Join Date: Apr 2007
Old 04-12-2007 , 13:16   /hprollthedice
Reply With Quote #1

I'm new with my cs server but I love it. My favorite plugin is probably Roll The Dice, and I have another idea for one.

I'd like a plugin that when a player said " /hprollthedice" it would be just like the original RTD except it was for gaining or losing hp. Examples...:

\\GOOD STUFF\\
-Gain Kevlar + Helmet
-Gain 20 HP
-Gain 50 HP
-Gain 100 HP

\\BAD STUFF\\
-Lose 10 HP
-Lose 30 HP
-Lose 75 HP
-DIE!

I don't want this added onto the original /rollthedice, i want it a new plugin called /hprollthedice.

Hopefully you understand what I mean. Please help me with this!
gstan is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-12-2007 , 14:22   Re: /hprollthedice
Reply With Quote #2

I'm on my cell but ill make it.
Styles is offline
Send a message via AIM to Styles
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-12-2007 , 17:51   Re: /hprollthedice
Reply With Quote #3

I dont know if this wlil work but I made it really fast try it out: Untested.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "HP RTD"
#define VERSION "1.0"
#define AUTHOR "Styles"

new timeDelay;
new userTime[33];
new bool:canGamble[33];

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /hprollthedice","hprtd")
    register_clcmd("say /hprtd","hprtd")
    register_clcmd("say hprollthedice","hprtd")
    register_clcmd("say hprtd","hprtd")
    timeDelay = register_cvar("amx_hpdice_delay","180.0");
    set_task(1.0,"hp_timer",69,"",0,"b");
}

public hp_timer()
{
	new maxPlayers = get_maxplayers();
	for(new i=0; i < maxPlayers;i++)
	{
		if(canGamble[i] == false)
		{
			userTime[i]++;
			if(userTime[i] < get_pcvar_num(timeDelay))
			{
				canGamble[i] = true;
			}
		}
	}
}

public hprtd(id)
{
	new randomNum = random_num(1, 8);
	new name[32];
	get_user_name(id,name,32);
	new Heath = get_user_health(id);
	new timeLeft = get_pcvar_num(timeDelay) - userTime[id];
	if(!canGamble[id])
	{
		client_print(id, print_chat, "[HP RTD] You must wait %i to use hp rtd.", timeLeft);
		return PLUGIN_HANDLED
	}	
					
	switch(randomNum)
	{
		case 0:
			{	
				give_item(id,"item_assaultsuit");
				client_print(0, print_chat, "[HP RTD] %s has been given an Assault Suit.", name);
			}
		case 1:
			{
				set_user_health(id,Heath + 20);
				client_print(0, print_chat, "[HP RTD] %s has been given 20 health.", name);
			}
		case 2:
			{
				set_user_health(id,Heath + 50);
				client_print(0, print_chat, "[HP RTD] %s has been given 50 health.", name);
			}
		case 3:
			{
				set_user_health(id,Heath + 100);
				client_print(0, print_chat, "[HP RTD] %s has been given 100 health.", name);
			}
		case 4:
			{
				set_user_health(id,Heath - 10);
				client_print(0, print_chat, "[HP RTD] %s has lost 10 health.", name);
			}
		case 5:
			{
				set_user_health(id,Heath - 30);
				client_print(0, print_chat, "[HP RTD] %s has lost 30 health.", name);
			}
		case 6:
			{
				set_user_health(id,Heath - 70);
				client_print(0, print_chat, "[HP RTD] %s has lost 70 health.", name);
			}
		case 7:
			{
				user_kill(id,1);
				client_print(0, print_chat, "[HP RTD] %s has been killed been killed.", name);
			}
	}
	canGamble[id] = false;
	userTime[id] = 0;
	
	return PLUGIN_HANDLED
}
Styles is offline
Send a message via AIM to Styles
gstan
BANNED
Join Date: Apr 2007
Old 04-12-2007 , 20:11   Re: /hprollthedice
Reply With Quote #4

erm, im new and uh.. where exactly do i put that code???
:\
gstan is offline
Martin1
BANNED
Join Date: May 2006
Old 04-12-2007 , 20:47   Re: /hprollthedice
Reply With Quote #5

You copy and compile it, either web compiler or in amxx studio and get the amxx which you put in plugins and add hprollthedice.amxx in plugins.ini in configs
Martin1 is offline
datwinkle
BANNED
Join Date: May 2006
Location: Virginia
Old 04-12-2007 , 21:05   Re: /hprollthedice
Reply With Quote #6

does it work?
datwinkle is offline
Send a message via AIM to datwinkle
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-13-2007 , 00:11   Re: /hprollthedice
Reply With Quote #7

loL I don't Know i just wrote it fast. You tell me. ..

The timer is what I'm worried about.
Styles is offline
Send a message via AIM to Styles
datwinkle
BANNED
Join Date: May 2006
Location: Virginia
Old 04-13-2007 , 07:12   Re: /hprollthedice
Reply With Quote #8

lol...im testing it later
datwinkle is offline
Send a message via AIM to datwinkle
gstan
BANNED
Join Date: Apr 2007
Old 04-13-2007 , 17:53   Re: /hprollthedice
Reply With Quote #9

erm lol im not understanding how to compile or even what "compiling" is. But if it works please let me know I'd love this addon for my wc3FT server.

Last edited by gstan; 04-13-2007 at 18:05.
gstan is offline
datwinkle
BANNED
Join Date: May 2006
Location: Virginia
Old 04-13-2007 , 18:57   Re: /hprollthedice
Reply With Quote #10

just download in the attached files.
Attached Files
File Type: sma Get Plugin or Get Source (hprtd.sma - 535 views - 2.3 KB)

Last edited by datwinkle; 04-13-2007 at 18:59.
datwinkle is offline
Send a message via AIM to datwinkle
Reply


Thread Tools
Display Modes

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 15:47.


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