Raised This Month: $94 Target: $400
 23% 

Weapon Chance by Exolent


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   v3x (159)
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-02-2008 , 01:14   Weapon Chance by Exolent
Reply With Quote #1

Weapon Chance
Version 2.8
by Exolent



Introduction:
  • This is a Counter-Strike 1.6 mod where players get free weapons and equipment by chance when they spawn.

Weapon Names:
  • p228
  • shield
  • scout
  • hegrenade
  • xm1014
  • c4
  • mac10
  • aug
  • smokegrenade
  • elite
  • fiveseven
  • ump45
  • sg550
  • galil
  • famas
  • usp
  • glock18
  • awp
  • mp5navy
  • m249
  • m3
  • m4a1
  • tmp
  • g3sg1
  • flashbang
  • deagle
  • sg552
  • ak47
  • knife
  • p90
  • armor
  • nightvision
  • defuser
  • health

Admin Commands:
  • wc_list
    - shows a list of all weapon names
    - requires amx_cvar flag "g"

Cvars:
  • wc_on <0|1>
    - is weapon chance enabled?
    • 0=OFF
    • 1=ON
  • wc_delay <seconds>
    - delay to wait after player spawns to give weapons
    - Note: The minimum delay is 0.3
  • wc_prefix <prefix>
    - the prefix for all messages when it tells player's when a player received a weapon
    - Example: wc_prefix "[CHANCE]"
  • wc_weaponcount <num>
    - number of random weapons player can receive

Requirements:
  • AMX Mod X version 1.8.1 or higher
  • HamSandwich Module
  • Fakemeta Module
  • Cstrike Module
  • Fun Module

Notes:
  • For information about how to add weapons, just look in the weapon_chance.cfg
  • You MUST put the cvars in the weapon_chance.cfg for them to work.
  • If you do not add any weapons in the weapon_chance.cfg, none will be given.
  • In the weapon_chance.cfg, it describes how to add weapons.

Plugin API:
You can now add custom items for weapon chance from other plugins.
This can be useful for plugins that enhance existing weapons like FrostNades or Heat-Seeking grenades.

Attached is the weapon_chance.inc file which contains the functions used for these features.
The plugins which use this include must be after weapon_chance.amxx in the plugins.ini.
Also, these plugins must be compiled locally with this include.

For an example on using the plugin API, you can see the wc_item_example.sma file attached.
For details on the functions, please read the include file first.

Any questions asked that can be answered with information from this post will be ignored.
Attached Files
File Type: cfg weapon_chance.cfg (2.5 KB, 4320 views)
File Type: sma Get Plugin or Get Source (weapon_chance.sma - 7134 views - 19.8 KB)
File Type: inc weapon_chance.inc (1.9 KB, 3113 views)
File Type: sma Get Plugin or Get Source (wc_item_example.sma - 5105 views - 739 Bytes)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 03-30-2011 at 04:27. Reason: Update to v2.8
Exolent[jNr] is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-02-2008 , 02:22   Re: Weapon Chance
Reply With Quote #2

wow x-olent, great plugin... this work good with HnS?
Alucard^ is offline
Send a message via Skype™ to Alucard^
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-02-2008 , 02:49   Re: Weapon Chance
Reply With Quote #3

A lot of people want weapon chance for their HideNSeek servers, but there isn't an official one that includes everything like this one.
I might even add C4 and shield support in a later version.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Blubb
Member
Join Date: May 2008
Location: Germany | Hamburg
Old 07-03-2008 , 07:46   Re: Weapon Chance
Reply With Quote #4

very nice idea to make this seperate, so everybody can use it not only for hide n seek

+karma
Blubb is offline
Send a message via ICQ to Blubb
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 07-03-2008 , 07:49   Re: Weapon Chance
Reply With Quote #5

Nice
I was gonna do a menu kinda thing so u can choose what weapon u want, then it would do a random number, but people would blatently spam it and end up with every weapaon possible
Good work
__________________
minimiller is offline
Send a message via MSN to minimiller
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 07-03-2008 , 15:46   Re: Weapon Chance
Reply With Quote #6

Don't check for task_exists, just remove_task

Code:
	if( g_bNonSpawnEvent[plr] )
	{
		g_bNonSpawnEvent[plr] = false;
	}
Just set it to false
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-03-2008 , 16:24   Re: Weapon Chance
Reply With Quote #7

Quote:
Originally Posted by Emp` View Post
Don't check for task_exists, just remove_task
Okay.

Quote:
Originally Posted by Emp` View Post
Code:
	if( g_bNonSpawnEvent[plr] )
	{
		g_bNonSpawnEvent[plr] = false;
	}
Just set it to false
But it must be an if() statement because the fwdPlayerSpawn() is in an else.

Code:
public eventResetHUD(plr)
{
	if( g_bNonSpawnEvent[plr] )
	{
		g_bNonSpawnEvent[plr] = false;
	}
	else
	{
		fwdPlayerSpawn(plr);
	}
	
	return PLUGIN_CONTINUE;
}




Updated to v1.1!
Whats new?

This was removed
Code:
Cvars:
-------------------
wc_oneweapon		<0|1>
-- should player be allowed more than one weapon by chance?
-- 0=YES
-- 1=NO
This was added
Code:
Cvars:
-------------------
wc_weaponcount		<num>
-- number of random weapons player can receive
And if enough people want shields and bombs, I'll add them to it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
mullekurden
Member
Join Date: Apr 2008
Old 07-03-2008 , 17:03   Re: Weapon Chance
Reply With Quote #8

this is nice

now peoples dont need to change the .sma to change percent and stuffs.
__________________

mullekurden is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 07-03-2008 , 17:08   Re: Weapon Chance
Reply With Quote #9

Quote:
Originally Posted by X-olent View Post
But it must be an if() statement because the fwdPlayerSpawn() is in an else.
meh, sorry, was looking at too much code at the time.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Blubb
Member
Join Date: May 2008
Location: Germany | Hamburg
Old 07-04-2008 , 09:29   Re: Weapon Chance
Reply With Quote #10

add shields but c4 not
Blubb is offline
Send a message via ICQ to Blubb
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 05:18.


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