Raised This Month: $12 Target: $400
 3% 

USP Reloaded v5.1 [Last Update: 31/10/09]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
metallicawOw
Veteran Member
Join Date: Jun 2009
Location: Anywhere
Old 10-24-2009 , 11:26   USP Reloaded v5.1 [Last Update: 31/10/09]
Reply With Quote #1

[IMG]http://img41.**************/img41/3553/uspr.jpg[/IMG]


[][][] Description [][][]

- This is my First Plugin!

- USPR (USP Reloaded) its based on a plugin that detects when a user wants to buy an usp, the plugin block the command and opens a new menu in which the user can buy two types of USPs, the "Normal USP" and the "Reloaded USP", the difference between one and other one is that with the "Reloaded USP" you will get GLOW gilded (optional with a cvar), more hp (controlled in one cvar), more damage (controlled in one cvar), models of usp of style v_ and p_ differents to those of the normal usp, and Effects/Sounds while shooting Enemys.

- The USPs cannot be bought if the user this one out of the zone of purchase or if this- one died.

- The USPs last until you die.

- The plugin also possesses(relies on) a file .cfg in which(whom) you can edit in a Simple form the cvars.

[][][] Includes [][][]


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <fun> 
[][][] Cvars [][][]

Quote:
gc_uspr_enable 1 // Enable/Disable the plugin

gc_cost_normal_usp 800 // Normal USP Cost

gc_cost_uspr 5000 // Reloaded USP Cost

gc_uspr_glow 1 // Enable/Disable Reloaded USP PLAYER GLOW

gc_uspr_dmg_multiplied 6.0 // Reloaded USP DMG Multiplied

gc_uspr_player_hp 1 // Enable/Disable Reloaded USP MORE HP FOR PLAYER

gc_uspr_player_hp_amount 150 // Reloaded USP AMOUNT OF HP FOR PLAYER

gc_uspr_effects_enable 1 // Enable/Disable USPR Effects

gc_uspr_light_color 0 200 0 // Reloaded USP Light Color Effect
[][][] ChangeLog [][][]

Quote:
v1.0: Creation of the plugin [23/10/09]
v2.0: Removed Colorchat & Fakemeta [24/10/09]
v3.0: Fixed Some Bugs and added a new cvar tu customize the amount of hp the player have with the USPR [24/10/09]
v4.0: Added Some Effects and Sounds when you shoot whith the USPR [24/10/09]
v5.0: I improve the plugin integrating CallBacks for a better functioning and classification of the plugin [24/10/09]
v5.1: Changed a thing of Curweapon and added event round start for the information message [31/10/09]

[][][] Images [][][]
[][][] Thanks to [][][]

Quote:
- Asd' (For helping me to fix one problem with the takedamage)
- Larito (For helping me to fix other problem with the takedamage)
- GladiuS (For helping me with the colorchat stock)
I will not give more support to this plugin because to many personals problems

Thanks for the Help
Attached Files
File Type: cfg USPR.cfg (739 Bytes, 126 views)
File Type: sma Get Plugin or Get Source (USPRv51.sma - 692 views - 13.5 KB)
__________________


Last edited by metallicawOw; 11-23-2009 at 15:36.
metallicawOw is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-24-2009 , 12:15   Re: USPR v2.0
Reply With Quote #2

PHP Code:
 if (is_user_connected(players[i])) 
In GC_Chat() is useless, remove it.
-
Why you're broadcasting screenfade when someone buys usp?
__________________
xPaw is offline
metallicawOw
Veteran Member
Join Date: Jun 2009
Location: Anywhere
Old 10-24-2009 , 12:20   Re: USPR v2.0
Reply With Quote #3

Quote:
Originally Posted by xPaw View Post
PHP Code:
 if (is_user_connected(players[i])) 
In GC_Chat() is useless, remove it.
-
Why you're broadcasting screenfade when someone buys usp?

Fixed!


I put a Screenfade when you buy the "Reloaded USP" Because i like that effect =D.
__________________

metallicawOw is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-24-2009 , 12:24   Re: USPR v2.0
Reply With Quote #4

Things you should/could do in the code:
  • Indent the code properly.
  • Since you included cstrike, you could use cs_get_user_team() instead of get_user_team().
  • Callback the menu, using menu_makecallback(), dont use if and elses.
  • The replace_all() in the color stock is not needed, since you use ^x0* in your text messages.

Suggestions:
  • Make a cvar for the extra amount of health the player recieves.

There is a lot to mention, but start with that.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
metallicawOw
Veteran Member
Join Date: Jun 2009
Location: Anywhere
Old 10-24-2009 , 13:05   Re: USPR v2.0
Reply With Quote #5

Quote:
Originally Posted by Xellath View Post
Things you should/could do in the code:
  • Indent the code properly.
  • Since you included cstrike, you could use cs_get_user_team() instead of get_user_team().
  • Callback the menu, using menu_makecallback(), dont use if and elses.
  • The replace_all() in the color stock is not needed, since you use ^x0* in your text messages.

Suggestions:
  • Make a cvar for the extra amount of health the player recieves.
There is a lot to mention, but start with that.
Fixed!
__________________

metallicawOw is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-24-2009 , 13:24   Re: USPR v3.0
Reply With Quote #6

1. The code is still not indented properly.

2. Your menu should be callbacked.

Code:
new g_Callback[ 2 ]; public plugin_init( ) {     g_Callback[ 0 ] = menu_makecallback( "MenuCallbackEnabled" );     g_Callback[ 1 ] = menu_makecallback( "MenuCallbackDisabled" ); } public USPMenu( id ) {     new USP = menu_create( "\yChoose Your Type of \rUSP", "USPMenu_Handler" );         menu_additem( USP, "\wNormal USP \r[$800]^n", "1", cs_get_user_money( id ) > get_pcvar_num( cost_Normal_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );     menu_additem( USP, "\wReloaded USP \r[$5000]^n", "2", cs_get_user_money( id ) > get_pcvar_num( cost_Reloaded_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );         menu_display( id, USP, 0 ); } public MenuCallbackEnabled( id, menu, item ) {     return ITEM_ENABLED; } public MenuCallbackDisabled( id, menu, item ) {     return ITEM_DISABLED; }
__________________
Achievements API - a simple way for you to create your OWN custom achievements!

Last edited by Xellath; 10-24-2009 at 13:25. Reason: typo
Xellath is offline
metallicawOw
Veteran Member
Join Date: Jun 2009
Location: Anywhere
Old 10-24-2009 , 14:56   Re: USPR v3.0
Reply With Quote #7

Quote:
Originally Posted by Xellath View Post
1. The code is still not indented properly.

2. Your menu should be callbacked.

Code:
new g_Callback[ 2 ];

public plugin_init( ) { &nbsp;&nbsp;&nbsp;&nbsp;g_Callback[ 0 ] = menu_makecallback( "MenuCallbackEnabled" );
&nbsp;&nbsp;&nbsp;&nbsp;g_Callback[ 1 ] = menu_makecallback( "MenuCallbackDisabled" );
} public USPMenu( id ) { &nbsp;&nbsp;&nbsp;&nbsp;new USP = menu_create( "\yChoose Your Type of \rUSP", "USPMenu_Handler" );
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;menu_additem( USP, "\wNormal USP \r[$800]^n", "1", cs_get_user_money( id ) > get_pcvar_num( cost_Normal_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );
&nbsp;&nbsp;&nbsp;&nbsp;menu_additem( USP, "\wReloaded USP \r[$5000]^n", "2", cs_get_user_money( id ) > get_pcvar_num( cost_Reloaded_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;menu_display( id, USP, 0 );
} public MenuCallbackEnabled( id, menu, item ) { &nbsp;&nbsp;&nbsp;&nbsp;return ITEM_ENABLED; } public MenuCallbackDisabled( id, menu, item ) { &nbsp;&nbsp;&nbsp;&nbsp;return ITEM_DISABLED; }

i dont understand your callbacks metod, i try to do it but I do not work like i was waiting.

New Version v4.0!
__________________

metallicawOw is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 10-24-2009 , 15:15   Re: USP Reloaded v4.0
Reply With Quote #8

Good idea
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
metallicawOw
Veteran Member
Join Date: Jun 2009
Location: Anywhere
Old 10-24-2009 , 15:31   Re: USP Reloaded v4.0
Reply With Quote #9

Quote:
Originally Posted by crazyeffect View Post
Good idea
thanks, if you have more ideas feel free to post.
__________________

metallicawOw is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 10-24-2009 , 20:12   Re: USP Reloaded v4.0 [Last Update: 24/10/09]
Reply With Quote #10

http://forums.alliedmods.net/showthread.php?t=98762

See Exolent's code.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 09:44.


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