Monthly Target: $400 Donations: $123
 30% 

CS Shop v5.0 - [05/24/09]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Exolent[jNr] (179)
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 09-29-2008 , 23:17   CS Shop v5.0 - [05/24/09]
Reply With Quote #1

CS Shop v5.0
by iNeedHelp

.: Description :.
Welcome to the CS Shop!
Here, you can buy all kind of things with your money, all accessible with menus! (all is defined with cvars!)

.: Modules :.
- CStrike
- Fun
- HamSandwich
- FakeMeta

.: Cvars :.
The cvars are located on the shop.cfg.
All the cvars are with each explanation, and some extra notes.

.: Installation :.
  1. Download the zip file
  2. Place the plugin in the plugins folder
  3. Add the "shop.txt" to the data/lang folder
  4. Add the "shop.cfg" to the configs folder
  5. Add "CS_Shop.amxx" in the plugins.ini (without the "")
  6. Restart your server and enjoy!

.: Additional Information :.

- The plugin was tested on AMXx 1.8.0 (Linux)
- Open to Suggestions and Bug Reports

.: For the Translators :.
I've made a huge multi-lingual update, so, if the old translators want to translate the new shop.txt, PM me with the language translated and the txt. Thanks, and sorry for re-making the shop.txt, but It's shorter and it's better.

Translations Thread: Link

.: Credits :.
PvtSmithFSSF - Original idea, Principal Code
VEN
- Fakemeta Utilities
Dr. Jan Itor
- Gravity Menu help
Minimiller - Lot of things
MeRcyLeZZ - For his svc_bad and models tutorial (Tutorial Link)
ConnorMcLeod - Little fix with user spawn
XxAvalanchexX - Some code of the gungame colored print


.: Changelog :.

PHP Code:
/*
    ChangeLog:
    
    v1.0
    - First Release
    
    v1.5
    - Converted some things to fakemeta
    - Fixed some menus
    
    v2.0
    - Added more menus
    - Added more stocks
    
    v3.0
    - Fixed Menu bugs
    - Fixed Model reset
    - Added new Cvars
    - Added ML Support
    
    v3.5
    - Added cstrike module for the skins
    - Added customizable cfg with cvars
    
    v3.6   
    - Fixed rendering bug with the invisibility menu
    
    v3.7
    - Fixed some fakemeta & cstrike convertions
    
    v3.8
    - Added ML Translations

    v4.0
    - Replaced all with fakemeta and ham modules
    - Fixed a ML Bug
    - Fixed some stocks (thanks to Exolent)
        
    v4.0a
    - Added: is the user alive to open the menu ? 
    - is the plugin enabled to show the msg ?
        
    v4.0b
    - Changed: Ham_Spawn to Post hook (Thanks ConnorMcLeod)
    
    v4.2
    - Now the Fakemeta Utilities are included
    - Removed the Fakemeta Utilities stocks
    - Added one more menu (Speed menu)
    - Added more cvars
    - Updated Multi-Lingual Translations
    
    v4.5
    - The items can be disabled if you set the item cvar to 0
    - Now plugin supports Unlimited Money by Ramono
    - Huge update on the Multi-Lingual translations (sorry translators)
    
    v5.0
    - All Menus Updated using global variables to store the name-weapons-other data
    - CStrike and Fun Modules restored (efficiency > fakemeta conversions)
    
    Plugin Thread: http://forums.alliedmods.net/showthread.php?t=78224
    Licensed under the GPL - http://www.gnu.org/copyleft/gpl.html
    
    ---------------------------------------------------------------------
*/  

// Uncomment this to enable Unlimited Money support by Ramono
//#define UL_COMPAT

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

#if defined UL_COMPAT
    #include <money_ul>
#endif 


+917 views (CS Shop v4.0)
+922 views (CS Shop v4.5)
Attached Files
File Type: zip CS Shop.zip (7.7 KB, 14774 views)
__________________

Last edited by IneedHelp; 05-24-2009 at 14:42. Reason: CS Shop UPDATED !
IneedHelp is offline
sreddoMlabolG
BANNED
Join Date: Aug 2008
Location: +Karma If I helped you i
Old 09-30-2008 , 00:14   Re: CS Shop 3.5 [30/09/08]
Reply With Quote #2

First reply , w00t Good job tho.
sreddoMlabolG is offline
Exolent[jNr]
AMX Mod X Moderator
Join Date: Feb 2007
Location: Tennessee
Old 09-30-2008 , 11:37   Re: CS Shop 3.5 [30/09/08]
Reply With Quote #3

1. The array size for each item name in the menu (200) is unnecessary. 64 should be enough.

2. You don't need to create a new array for each item, just create 1 array and format it for each item you add.

3. You have a lot of cstrike -> fakemeta conversions, but not all of them.
I saw that you defined OFFSET_TEAM, but never used it.
If you don't know some conversions, a lot of other plugins have them, just look for it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 09-30-2008 , 15:41   Re: CS Shop 3.5 [30/09/08]
Reply With Quote #4

Good job. :-)
Thanks for taking up the dead project and reviving it.
PvtSmithFSSF is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 09-30-2008 , 16:19   Re: CS Shop 3.5 [30/09/08]
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
1. The array size for each item name in the menu (200) is unnecessary. 64 should be enough.

2. You don't need to create a new array for each item, just create 1 array and format it for each item you add.

3. You have a lot of cstrike -> fakemeta conversions, but not all of them.
I saw that you defined OFFSET_TEAM, but never used it.
If you don't know some conversions, a lot of other plugins have them, just look for it.
Fixed. If i could make it all to fakemeta i'll do it. But i don't find the cs_get|set|reset_user_model()
__________________
IneedHelp is offline
Exolent[jNr]
AMX Mod X Moderator
Join Date: Feb 2007
Location: Tennessee
Old 09-30-2008 , 16:35   Re: CS Shop 3.8 [30/09/08]
Reply With Quote #6

http://forums.alliedmods.net/showthread.php?t=69386
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 09-30-2008 , 16:54   Re: CS Shop 3.8 [30/09/08]
Reply With Quote #7

Code:

Update to version 4.0

Changelog:
- Now the plugin uses hamsandwich and fakemeta modules
- Fixed skins menu bug on team detect
- Fixed the alpha amount on the invisibility menu
- Fixed a bug in the translations menu
__________________

Last edited by IneedHelp; 01-07-2009 at 02:34.
IneedHelp is offline
Exolent[jNr]
AMX Mod X Moderator
Join Date: Feb 2007
Location: Tennessee
Old 09-30-2008 , 21:48   Re: CS Shop 4.0 [30/09/08]
Reply With Quote #8

1.
Code:
#define SECONDARY_WEAPONS_BIT_SUM ((2<<CSW_P228)|(2<<CSW_ELITE)|(2<<CSW_FIVESEVEN)|(CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE))
This bit sum is not necessary. Just use:
if( !(PRIMARY_WEAPONS_BIT_SUM & weapon) )


2.
Code:
stock primary_wpn_drop(index) {     new weapons[32], num     get_user_weapons(index, weapons, num)         for (new i = 0; i < num; i++)     {         if (PRIMARY_WEAPONS_BIT_SUM & (1<<weapons[i]))         {             static wname[32]             get_weaponname(weapons[i], wname, sizeof wname - 1)                         engclient_cmd(index, "drop", wname)         }     } } stock secondary_wpn_drop(index) {     new weapons[32], num     get_user_weapons(index, weapons, num)         for (new i = 0; i < num; i++)     {         if (!(PRIMARY_WEAPONS_BIT_SUM & (1<<weapons[i])))         {             static wname[32]             get_weaponname(weapons[i], wname, sizeof wname - 1)                         engclient_cmd(index, "drop", wname)         }     } }

Don't re-index arrays.
Code:
stock primary_wpn_drop(index) {     new weapons[32], num     get_user_weapons(index, weapons, num)     new weapon;     for (new i = 0; i < num; i++)     {         weapon = weapons[i];         if (PRIMARY_WEAPONS_BIT_SUM & (1<<weapon))         {             static wname[32]             get_weaponname(weapon, wname, sizeof wname - 1)                         engclient_cmd(index, "drop", wname)         }     } } stock secondary_wpn_drop(index) {     new weapons[32], num     get_user_weapons(index, weapons, num)     new weapon;     for (new i = 0; i < num; i++)     {         weapon = weapons[i];         if (!(PRIMARY_WEAPONS_BIT_SUM & (1<<weapon)))         {             static wname[32]             get_weaponname(weapon, wname, sizeof wname - 1)                         engclient_cmd(index, "drop", wname)         }     } }

3.
Code:
stock fm_set_user_money(index, money, flash=1) {     set_pdata_int(index, OFFSET_MONEY, money, OFFSET_LINUX);     message_begin(MSG_ONE, get_user_msgid("Money"), {0,0,0}, index)     write_long(money);     write_byte(flash);     message_end(); }

Place get_user_msgid("Money") in plugin_init() and store the value in a global variable.

Code:
new g_msgid_Money; public plugin_init() {     g_msgid_Money = get_user_msgid("Money"); } stock fm_set_user_money(index, money, flash=1) {     set_pdata_int(index, OFFSET_MONEY, money, OFFSET_LINUX);     message_begin(MSG_ONE, g_msgid_Money, {0,0,0}, index)     write_long(money);     write_byte(flash);     message_end(); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 09-30-2008 , 22:00   Re: CS Shop 4.0 [30/09/08]
Reply With Quote #9

Fixed the stocks. Thanks
__________________
IneedHelp is offline
Exolent[jNr]
AMX Mod X Moderator
Join Date: Feb 2007
Location: Tennessee
Old 09-30-2008 , 22:04   Re: CS Shop 4.0 [30/09/08]
Reply With Quote #10

The code looks fine. I'll give it a few days for user confirmation that it works without any bugs or issues.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 01:25.


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