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

TS Random Weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   The Specialists        Category:          Approver:   EKS (167)
Maddo
Member
Join Date: Dec 2004
Old 02-02-2005 , 02:28   TS Random Weapons
Reply With Quote #1

True random weapons AMXX plugin for Half-Life mod, "The Specialists" - Updated to version 1.4

I requested a plugin like this on both amx and amxx, but since no-one was keen to code it, I eventually did it myself. Unlike the standard TS random weapons function, this one is forced, and is truly random. Just spawn and you will receive your guns.

Features:
-Forces player to take a random number of guns (to a maximum of your choosing).
-Each gun they receive is also a random selection.
-50/50 chance of players receiving a random set of attachments for each gun (ie silencer, lasersight etc).
-Relative chance of no guns at all (ie Kung-fu only).

Usage:
-requires TSX, TFUN & ENGINE modules
cvars:
amx_randomweapons <Max Weapons|0> Give players random weapons, maximum no. given in the setting (1 by default)
amx_randomattachments <1|0> Give players random attachments (off by default)
amx_randomrestrictions <Restriction|0> Restricts the weapon pool to certain groups
amx_randomkungfu <1|0> Give players relative chance of kung fu (off by default)

Possible amx_weaponrestriction settings:

0: All Weapons
1: Kung-Fu only
2: Melee only
3: Pistols & Melee
4: Pistols & Shotguns & Melee
5: Pistols only (no melee)
6: Shotguns only (no melee)
7: Rifles only (no melee)
8: Sub-machineguns only (no melee)
9: Pistols & Shotguns only (no melee)
10: Shotguns & Rifles only (no melee)
11: Rifles and Sub-machineguns only (no melee)
12: All Weapons (Excluding Melee & Grenade)
13: All Weapons (Excluding Melee)
14: All Weapons (Excluding Grenade)

I recommend you set weaponrestriction to 1, but it will work fine without it.
If you turn randomweapons off, you'll have to reset weaponrestriction to the value you want, since the plugin will change it to 1 when it's running.

Credits:
Thanks to AssKicR for his powerup-spawning code, XxAvalanchexX and Knare for their help on the AMXX forums, and darkpast for his suggestion about the kungfu powerup

Thanks to eskimobob, darkpast, Sphericus and o_OR4N^_^ for their assistance in playtesting

Changelog:

version 1.4(31/3/06)
-cleaned up code (no more magic numbers, changed if/else set to switch)
-generalised give_powerup function
-added akimbo mini uzi (was missing from last version)

version 1.3 (18/11/05)
-additional weapon restrictions
-updated for AMXX 1.60
-readded Kung-Fu powerup (Thanks to AssKicR for use of his powerup-spawning code)

version 1.2 (15/7/05)
-removed single knife sets
-added cvar to turn off getting kung-fu as a weapon
-added cvar to turn off randomized attachments
-changed amx_randomweapons to specify the maximum number of guns given to a player

version 1.1 (26/5/05)
-removed kung-fu powerup for kung-fu only
-added weapon restrictions (group restrictions like TS default)
-changed akimbo guns and different knife holdouts to be seperate weapons

version 1.0 (2/2/05)
-release
Attached Files
File Type: sma Get Plugin or Get Source (randomweapons.sma - 1601 views - 10.7 KB)
Maddo is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-02-2005 , 19:13  
Reply With Quote #2

Pretty nice job.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Dorksville
Senior Member
Join Date: Feb 2005
Location: in my bed
Old 03-28-2005 , 02:59  
Reply With Quote #3

lol taht pretty cool i have tried it works alright

GOOD JOB!!!
__________________
damn right i am good in bed i can sleep for hours
Dorksville is offline
Send a message via MSN to Dorksville
Maddo
Member
Join Date: Dec 2004
Old 07-15-2005 , 08:11  
Reply With Quote #4

Updated to version 1.2

Changelog:

version 1.2 (15/7/05)
-removed single knife sets
-added cvar to turn off getting kung-fu as a weapon
-added cvar to turn off randomized attachments
-changed amx_randomweapons to specify the maximum number of guns given to a player

version 1.1 (26/5/05)
-removed kung-fu powerup for kung-fu only
-added weapon restrictions (group restrictions like TS default)
-changed akimbo guns and different knife holdouts to be seperate weapons
Maddo is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-15-2005 , 14:08  
Reply With Quote #5

You need to require_module() all of the modules you use.

Code:
public plugin_modules() {     require_module("cstrike") }


And, don't post a zip, just post the .sma file.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Maddo
Member
Join Date: Dec 2004
Old 11-18-2005 , 00:22  
Reply With Quote #6

Updated for AMXX 1.60, and several additional features added.

version 1.3 (18/11/05)
-updated for AMXX 1.60
-additional weapon restrictions
-readded Kung-Fu powerup (Thanks to AssKicR for use of his powerup-spawning code)

Thanks to AssKicR, the powerup spawning feature has been readded, and it actually works now. The plugin also no longer requires TSX, just TSFUN, and ENGINE for spawning kung-fu powerups.
Maddo is offline
swiftboy36
New Member
Join Date: Nov 2005
Old 11-19-2005 , 01:58  
Reply With Quote #7

could you provide a readme.txt file along the ways of how to edit the file before compling it so that i can get it to work properly please...


thanks,

Alex
__________________
The Only=-
swiftboy36 is offline
Send a message via AIM to swiftboy36 Send a message via MSN to swiftboy36 Send a message via Yahoo to swiftboy36
Maddo
Member
Join Date: Dec 2004
Old 11-19-2005 , 08:37  
Reply With Quote #8

It should work properly as it is, there shouldn't be a need to modify it. If there is a problem with how it runs, or it won't compile properly, I'll try to fix it if you can describe the problem.
Maddo is offline
Wayside
Member
Join Date: Sep 2005
Old 05-30-2006 , 18:02  
Reply With Quote #9

its been a while since you made this plugin, but i just downloaded it recently and noticed a couple things. No one has ever spawned with akimbo mini-uzis, sometimes people will spawn with the same gun several times in a row (3-4), and there have been a rare few anomilies where everyone in the server has spawned with the same gun. thoes last two could be coincidence i suppose, but you definetely can't get akimbo mini-uzis.
Wayside is offline
Maddo
Member
Join Date: Dec 2004
Old 05-30-2006 , 22:35  
Reply With Quote #10

Thanks for the feedback Wayside. I hadn't planned on releasing an update until after TS3 was realeased, given that I would have to modify it for this anyway. Of course, I decided this when it seemed like TS3 would be released in the near future.

As for the anomolies, I put this down to the random number function in the Small library. Unfortunately this is normal behavior for the plugin. (My clanmates complain about it all the time.)

I'll release an updated version ASAP, thanks.
Maddo is offline
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 14:32.


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