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

Buy Stealth [v1.6.1]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff        Approver:   Exolent[jNr] (178)
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 12-14-2009 , 18:52   Buy Stealth [v1.6.1]
Reply With Quote #1

BUY STEALTH
Version 1.6.1
Requested HERE

This plugin allows clients to say /buy_stealth to become invisible for 10 seconds.
Admin can set cost and length of time that client is in stealth mode.
It also prints a chat line telling everyone when someone buys stealth

.:CVARS:.
-amx_stealth <0|1> - Turns plugin OFF|ON
-amx_stealthCOST <value> - sets cost of buying invisibility (default $5000)
-amx_stealthTIME <value> - sets invisiblity time (default 10s)
-amx_stealthVISI <0 - 255> - sets degree of visibility 0 being completely invisible and 255 being fully visible(default 10)

.:SAY:.
-/buy_stealth - makes client invisible for set time

Change Log:
Quote:
v1.6.1
-added Toggle_plugin capabilities
v1.6
-added new cvar for invisibility percentage
v1.5
-Code Completely optimized (thanks to Nextra)
v1.4
-fixed simple code bugs
v1.3
fixed fatal chatting block error
v1.2
-Added Cvar so admin can change length of time client is invisible (made possible by Zombiezzz)
v1.1
-bugs fix/testing
v1.0
-initial release
Attached Files
File Type: sma Get Plugin or Get Source (LZB_Buy_Stealth.sma - 1992 views - 1.8 KB)
__________________
Taking a break from modding dunno when i will be back

FAIL, RIGHT HERE

Last edited by laziboi72; 12-23-2009 at 16:50.
laziboi72 is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 12-14-2009 , 19:01   Re: Client Buy Steath!
Reply With Quote #2

Your topic title failed.
__________________

Home of the AMX SUPER
Discord
DruGzOG is offline
Send a message via AIM to DruGzOG
Old 12-14-2009, 19:06
laziboi72
This message has been deleted by laziboi72. Reason: FIXED ALL BUGS!
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-14-2009 , 21:22   Re: Buy Steath!
Reply With Quote #3

not anything new but im sure no one has made it yet. + its useful
__________________
Zombiezzz is offline
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 12-14-2009 , 21:25   Re: Buy Steath!
Reply With Quote #4

Quote:
Originally Posted by Zombiezzz View Post
not anything new but im sure no one has made it yet. + its useful
could you give me some pointers for how to make it so that the admin is able to edit how long the client is invisible for?
__________________
Taking a break from modding dunno when i will be back

FAIL, RIGHT HERE
laziboi72 is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-14-2009 , 21:33   Re: Buy Stealth!
Reply With Quote #5

PHP Code:
/* 
.:CVARS:.
-amx_stealthCOST <value> - sets cost of buying invisibility
-amx_stealthTIME <value> - sets invisiblity time
.:SAY COMMANDS.:
-/buy_stealth - makes client invisible for set amount of time
*/
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <engine>
#define PLUGIN "Buy_Stealth"
#define VERSION "1.0"
#define AUTHOR "Laziboi72"
new BuyTimer
new Time
public plugin_init(){
 
register_plugin("Buy_Stealth""1.0""Laziboi72")
 
 
Buy register_cvar("amx_stealthCOST""5000")
 
Time register_cvar("amx_invisble_time""10.0")
 
 
register_clcmd("say""buyS")
 
register_clcmd("say_team""buyS"
}
public 
buyS(id){
 if(!
is_user_connected(id)) return PLUGIN_CONTINUE
 
if(cs_get_user_money(id)<5000){
  
client_print (idprint_chat"NOT ENOUGH MONEY TO BUY STEALTH!")
 return 
PLUGIN_HANDLED
 
}
 new 
args[32], user[32]
 new 
bCOST get_pcvar_num(Buy)
 
read_args(args31)
 
remove_quotes(args)
 
get_user_name(id,user,31)
 
 if (
equali(args"/buy_stealth")) {
   
set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,0)
   
cs_set_user_money(idcs_get_user_money(id) - bCOST
   
set_task(get_pcvar_float(Time), "endinvis"
   
)
   
   
client_print (0print_chat"%s bought stealth!",user)
   
   
set_task(10.0"removestealth"id)
 }
 return 
PLUGIN_HANDLED
}
public 
removestealth(id){
 
set_user_rendering(id,kRenderFxNone,0,0,0,kRenderNormal,0)
 return 
PLUGIN_HANDLED

it compires but idk if it works...
__________________
Zombiezzz is offline
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 12-14-2009 , 21:43   Re: Buy Stealth!
Reply With Quote #6

Quote:
Originally Posted by Zombiezzz View Post
[PHP]/*

it compires but idk if it works...
thanks
__________________
Taking a break from modding dunno when i will be back

FAIL, RIGHT HERE
laziboi72 is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-14-2009 , 21:48   Re: Buy Stealth!
Reply With Quote #7

good luck! ^_^
__________________
Zombiezzz is offline
Old 12-15-2009, 23:03
laziboi72
This message has been deleted by laziboi72. Reason: [v1.3] had bugs that were not fixed and code was not optimized
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-16-2009 , 00:01   Re: Buy Stealth [v1.4 FINAL]
Reply With Quote #8

WOOT! nice work. Dose the sound i made work good?
__________________
Zombiezzz is offline
laziboi72
Senior Member
Join Date: Aug 2009
Location: deathrun_temple
Old 12-16-2009 , 16:01   Re: Buy Stealth [v1.4 FINAL]
Reply With Quote #9

Quote:
Originally Posted by Zombiezzz View Post
WOOT! nice work. Dose the sound i made work good?
what sound? i dont see that in your code
__________________
Taking a break from modding dunno when i will be back

FAIL, RIGHT HERE
laziboi72 is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 12-16-2009 , 17:52   Re: Buy Stealth [v1.4 FINAL]
Reply With Quote #10

- Since you now register say /buy_stealth directly you can remove all the arg stuff from the buyS function.
- Store cs_get_user_money in a variable so you don't need to call the native twice.
- Your enough-money-check is still hardcoded to 5000.
- Don't get_user_name when you are not sure you are needing it (-> place it behind the money check).
- You may want to be consistent with either the [STEALTH] (which I'd prefer) or the [ADMIN] tag. Mixing them doesn't make sense.
- Why include engine?
- You don't need to return PLUGIN_HANDLED in the remove function.
__________________
In Flames we trust!
Nextra 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:00.


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