Raised This Month: $ Target: $400
 0% 

Need help with a simple plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Claw
Member
Join Date: Sep 2004
Old 10-21-2007 , 19:10   Need help with a simple plugin
Reply With Quote #1

Hey, i got this plugin running on my Hide n Seek server.
Its a chance to get items at start of each round plugin ;) I got some extra health, scout, dgl. armor and shield added atm.

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

#define Plugin "Weapon Chance"
#define Version "1.0"
#define Author "Doombringer"

#define TIME_TO_WAIT 5.0

public plugin_init()
{
	register_plugin(Plugin, Version, Author)
	register_logevent("round_start", 2, "1=Round_Start")
}

public main_func()
{
	new players[32], num
	get_players(players, num)

	new player
	for(new i = 0; i < num; i++)
	{
		player = players[i]
		
		if(random_num(0, 100) <= 1)
		{			
			give_item(player, "weapon_scout")
			
			cs_set_user_bpammo(player, CSW_SCOUT, 0)
			client_print(player, print_chat, "You were lucky, you got a scout with 1 bullet")
		}
		
		if(random_num(0, 100) <= 5)
		{
			give_item(player, "weapon_deagle")	
			
			cs_set_user_bpammo(player, CSW_DEAGLE, 0)
			client_print(player, print_chat, "You were lucky, you got a deagle with 1 bullet")
		}
		
		if(random_num(0, 100) <= 15)
		{
			give_item(player, "weapon_hegrenade")
			client_print(player, print_chat, "You were lucky, you got a HE-grenade")
		}
		
		if(random_num(0, 100) <= 10)
		{
			give_item(player, "weapon_shield")			
			client_print(player, print_chat, "You were lucky, you got a shield")
		}
		
		if(random_num(0, 100) <= 2)
		{
			set_user_health(player, 200)
			client_print(player, print_chat, "You were lucky, you got 100 extra health, if you walk on a healer you will loose this extra health")
		}

		if(random_num(0, 100) <= 4)
		{
			set_user_health(player, 150)
			client_print(player, print_chat, "You were lucky, you got 50 extra health, if you walk on a healer you will loose this extra health")
		}

		if(random_num(0, 100) <= 8)
		{
			set_user_health(player, 125)
			client_print(player, print_chat, "You were lucky, you got 25 extra health, if you walk on a healer you will loose this extra health")
		}

		if(random_num(0, 100) <= 25)
		{
			cs_set_user_armor(player, 100, CS_ARMOR_VESTHELM)	
			client_print(player, print_chat, "You were lucky, you got a kevlar and helmet")
		}
}
}

public round_start()
{
	set_task(TIME_TO_WAIT, "main_func")
}
My question is if its possible to make the shield "chance to get" only work for T's?
Claw is offline
 



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 01:14.


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