AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   USP Reloaded v5.1 [Last Update: 31/10/09] (https://forums.alliedmods.net/showthread.php?t=107236)

metallicawOw 10-24-2009 11:26

USP Reloaded v5.1 [Last Update: 31/10/09]
 
2 Attachment(s)
[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

xPaw 10-24-2009 12:15

Re: USPR v2.0
 
PHP Code:

 if (is_user_connected(players[i])) 

In GC_Chat() is useless, remove it.
-
Why you're broadcasting screenfade when someone buys usp?

metallicawOw 10-24-2009 12:20

Re: USPR v2.0
 
Quote:

Originally Posted by xPaw (Post 970819)
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.

Xellath 10-24-2009 12:24

Re: USPR v2.0
 
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.

metallicawOw 10-24-2009 13:05

Re: USPR v2.0
 
Quote:

Originally Posted by Xellath (Post 970835)
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!

Xellath 10-24-2009 13:24

Re: USPR v3.0
 
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; }

metallicawOw 10-24-2009 14:56

Re: USPR v3.0
 
Quote:

Originally Posted by Xellath (Post 970904)
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!

crazyeffect 10-24-2009 15:15

Re: USP Reloaded v4.0
 
Good idea

metallicawOw 10-24-2009 15:31

Re: USP Reloaded v4.0
 
Quote:

Originally Posted by crazyeffect (Post 971016)
Good idea

thanks, if you have more ideas feel free to post.

Alucard^ 10-24-2009 20:12

Re: USP Reloaded v4.0 [Last Update: 24/10/09]
 
http://forums.alliedmods.net/showthread.php?t=98762

See Exolent's code.


All times are GMT -4. The time now is 18:43.

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