AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help on Bleed to Death Plugin (https://forums.alliedmods.net/showthread.php?t=24736)

desert 03-01-2006 17:49

Help on Bleed to Death Plugin
 
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?

GHW_Chronic 03-01-2006 17:55

A. use [small] tags.
B. our definition of complex and simple are completely different O_o
C. don't need any of those register_dictionary lines
D. your coding makes no sense to me O_o

o_O

desert 03-01-2006 18:03

lol like i said im kinda new to small and plugin making but im picking it up rather quickly. i know someone has probably made this but i feel making things like this helps ppl learn. and as far as u not understanding the code sorry if its not all of one language like i could mix it up with my java coding once and a while, is bandage-- even allowed in pawn?

GHW_Chronic 03-01-2006 18:07

I know what you want, the code doesn't make sense, is setup wrong, is posted wrong, and use [small] tag instead of [code] (again)

desert 03-01-2006 18:08

i've read and dled alot of your plugins that you've made, i know your extremely good at making plugins maybe u can add me to aim, and u can help me get to learn the language if its cool with you.

my aim is: WFCDesert

well im off to work for now if u add me guess i'll talk to you later.


All times are GMT -4. The time now is 20:17.

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