Raised This Month: $105 Target: $400
 26% 

Pistol Rounds


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Exolent[jNr] (178)
thatguyzp
Junior Member
Join Date: Mar 2009
Old 03-02-2009 , 20:49   Pistol Rounds
Reply With Quote #1

Pistol Rounds

Description
Pistol Rounds is a plugin that will turn your server into a match style pistol round server.

Features
Resets to default Terrorist/Counter Terrorist weapon on round start.
Resets money to 800 on round start.
Resets armor to 0 on round start.
Resets all grenades on round start.
Takes away defuse kits for Counter Terrorist on round start.

Installation
Place pistolrounds.amxx in your plugins directory.
Add pistolrounds.amxx in your plungins.ini file.

Changelog
1.0 Initial Commit
1.1 Changed strip code to the one posted by Exolent[jNr].
1.2 Use fm_give_item now instead of ham_give_item.
1.3 Even better code thanks to ConnorMcLeod.
1.4 Fixes.
1.5 Added cvar amx_pistolrounds [0/1] to toggle plugin.

Disclaimer
This is my first plugin for amxx, so it's probably not the best, also extremely simple since my plugin writing skills are not good.
I made this because I like pistol rounds ALOT.

Seems to work fine on a win32 platform. Tested with amxx 1.8.1

Let me know what you guys think, or what I can do to improve it.
Attached Files
File Type: sma Get Plugin or Get Source (pistolrounds.sma - 3763 views - 1.1 KB)

Last edited by thatguyzp; 03-03-2009 at 18:40.
thatguyzp is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 03-02-2009 , 21:50   Re: Pistol Rounds
Reply With Quote #2

Add deathmatch, so you can have pistols deathmatch
__________________

Home of the AMX SUPER
Discord
DruGzOG is offline
Send a message via AIM to DruGzOG
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-02-2009 , 22:08   Re: Pistol Rounds
Reply With Quote #3

Code:
    if(user_has_weapon(id, CSW_P228))     {         ham_strip_weapon(id, "weapon_p228");     }     if(user_has_weapon(id, CSW_ELITE))     {         ham_strip_weapon(id, "weapon_elite");     }     if(user_has_weapon(id, CSW_FIVESEVEN))     {         ham_strip_weapon(id, "weapon_fiveseven");     }     if(user_has_weapon(id, CSW_DEAGLE))     {         ham_strip_weapon(id, "weapon_deagle");     }     if(user_has_weapon(id, CSW_SMOKEGRENADE))     {         ham_strip_weapon(id, "weapon_smokegrenade");     }     if(user_has_weapon(id, CSW_FLASHBANG))     {         ham_strip_weapon(id, "weapon_flashbang");     }     if(user_has_weapon(id, CSW_HEGRENADE))     {         ham_strip_weapon(id, "weapon_hegrenade");     }

Oh wow.
Why not just do this:
Code:
#include <fakemeta_util> // ... fm_strip_user_weapons(id); ham_give_weapon(id, "weapon_knife");
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 03-02-2009, 22:53
thatguyzp
This message has been deleted by thatguyzp.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-02-2009 , 23:26   Re: Pistol Rounds
Reply With Quote #4

Quote:
Originally Posted by thatguyzp View Post
Installation
Place zp_pistol_core.amxx in your plugins directory.
Add zp_pistol_core.amxx in your plungins.ini file.
Thats it.
FYI, the amxx file will be called "Pistol Rounds.amxx". If you want it to be as you stated change the sma file to "zp_pistol_core.sma".
__________________
fysiks is offline
fang
Senior Member
Join Date: Nov 2007
Location: New Jersey
Old 03-02-2009 , 23:38   Re: Pistol Rounds
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
Code:
if(user_has_weapon(id, CSW_P228)) { ham_strip_weapon(id, "weapon_p228"); } if(user_has_weapon(id, CSW_ELITE)) { ham_strip_weapon(id, "weapon_elite"); } if(user_has_weapon(id, CSW_FIVESEVEN)) { ham_strip_weapon(id, "weapon_fiveseven"); } if(user_has_weapon(id, CSW_DEAGLE)) { ham_strip_weapon(id, "weapon_deagle"); } if(user_has_weapon(id, CSW_SMOKEGRENADE)) { ham_strip_weapon(id, "weapon_smokegrenade"); } if(user_has_weapon(id, CSW_FLASHBANG)) { ham_strip_weapon(id, "weapon_flashbang"); } if(user_has_weapon(id, CSW_HEGRENADE)) { ham_strip_weapon(id, "weapon_hegrenade"); }


Oh wow.
Why not just do this: Code:
#include <fakemeta_util> // ... fm_strip_user_weapons(id); ham_give_weapon(id, "weapon_knife");
He wishes to be sophisticated :p I did the same thing once, and then I realized I could do the same thing that you did so I changed it. But otherwise good idea .
fang is offline
thatguyzp
Junior Member
Join Date: Mar 2009
Old 03-02-2009 , 23:44   Re: Pistol Rounds
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
FYI, the amxx file will be called "Pistol Rounds.amxx". If you want it to be as you stated change the sma file to "zp_pistol_core.sma".
Yeah, forgot that I was using a different file name locally.
thatguyzp is offline
thatguyzp
Junior Member
Join Date: Mar 2009
Old 03-03-2009 , 01:47   Re: Pistol Rounds
Reply With Quote #7

New version up, should work alot better thanks to Exolent.
thatguyzp is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-03-2009 , 02:17   Re: Pistol Rounds
Reply With Quote #8

You could do :

PHP Code:
            fm_strip_user_weapons(id);
            
cs_set_user_moneyid,800,0);
            
ham_give_weaponid"weapon_knife" );
            
cs_set_user_armor(id,0,CS_ARMOR_NONE);
            switch( 
cs_get_user_teamid ) )
            {
                        case 
TEAM_T:
                        {
                                    
ham_give_weaponid"weapon_glock18" );
                                    
cs_set_user_bpammo(id,CSW_GLOCK18,40);
                        } 
But then you'll have to check if user is alive before strip weapons.
__________________
- tired and retired -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-03-2009 , 08:22   Re: Pistol Rounds
Reply With Quote #9

Like Connor said, the switch statement should also be inside the is_user_alive check along with the stripping weapons and others.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
thatguyzp
Junior Member
Join Date: Mar 2009
Old 03-03-2009 , 11:28   Re: Pistol Rounds
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
Like Connor said, the switch statement should also be inside the is_user_alive check along with the stripping weapons and others.
Done.
thatguyzp 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 15:43.


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