Raised This Month: $ Target: $400
 0% 

Help on Bleed to Death Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
desert
Junior Member
Join Date: Jan 2006
Location: Canada
Old 03-01-2006 , 17:49   Help on Bleed to Death Plugin
Reply With Quote #1

Hi im new to the AMXX Forums and a little new to coding plugins. i can code very simple things like hud msg's and some complex stuff like scrim starters. but i wanted to try something different. I wanted to make cs more real where if a player has 20 or less health u bleed to death unless u buy a bandage.

heres the coding i code so far:


Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <fakemeta> #include <engine> #define PLUGIN "CSRealism" #define VERSION "1.0" #define AUTHOR "Desert" new cost new money new newmoney new bandages new playerHealth new newPlayerHealth new speed new checkHealth new gainPlayerHealth new fasterspeed public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_dictionary("fun.inc")     register_dictionary("cstrike.inc")     register_dictionary("amxmodx.inc")     register_dictionary("fakemeta.inc")     register_dictionary("amxmisc.inc")     register_dictionary("engine.inc")     register_cvar("bandage_cost","300")     register_concmd("amx_buybandage", "buybandage", ADMIN_KICK, "sets up buy bandage settings") } public buybandage (id) {         money = cs_get_user_money         cost = get_cvar_num("bandage_cost")                 if (money <= cost)         {             bandages = 1             client_print(0, print_chat, "[CSRealism] You have bought a bandage")             newmoney = money - cost             cs_set_user_money(id,newmoney)         }                 if (money > cost)         {             client_print(0, print_chat, "[CSRealism] You don't have enough for a bandage.")             client_print(0, print_chat, "[CSRealism] bandage's cost $300.")         }                 set_task(2.0,"bleed") } public bleed (id) {                 playerHealth = cs_get_user_health                         if (playerHealth > 20)         {         Float:speed = - 1.5         newPlayerHealth = playerHealth - 1         set_user_health(id, newPlayerHealth)         set_user_maxspeed (id, speed)         client_print(0, print_chat, "[CSRealism] you don't have any bandages, please buy one to prevent any further loss of health.")         }                 if (bandages = 1)         {         Float:fasterspeed = - 1.3         checkHealth = cs_get_user_health            gainPlayerHealth = checkHealth + 20         set_user_health(id,gainPlayerHealth)         set_user_maxspeed ( id, fasterspeed )         bandages--         client_print(0, print_chat, "[CSRealism] you have used to bandage and won't bleed to death.")         }                 }

can anyone help me?
desert is offline
 


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 20:17.


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