AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   One error... (https://forums.alliedmods.net/showthread.php?t=19767)

DarlD 10-24-2005 23:54

One error...
 
I get an error with fakedamage while compiling, here is the code:

Code:
#include <amxmodx> #include <amxmisc> #include <engine> public plugin_init() {     register_plugin("Admin_Damage", "1", "Meta")     register_cvar("amx_damage", "0")     register_event("ResetHUD","damage","be"); } public damage()     {     new damn = get_cvar_num("amx_damage")     fakedamage(+damn);     return PLUGIN_CONTINUE }

XxAvalanchexX 10-25-2005 01:08

That's not at all how fakedamage works.

http://www.amxmodx.org/funcwiki.php?go=func&id=391

DarlD 10-25-2005 01:30

i looked at that and to me it just doesnt make any more sense :S

[ --<-@ ] Black Rose 10-25-2005 07:56

Code:
fakedamage (0, Classname[]"(i have not idea what it is)", get_cvar_num("amx_damage"), damagetype"(i think this has to do if the player starts tob urn or something or when the player dies... think 29 is skull :P)")

something like that...

XxAvalanchexX 10-25-2005 12:09

fakedamage ( victim, Classname[], Float:damage, damagetype )

victim is the player the damage should be inflicted upon.

Classname is the name of the damage, ie if someone is killed by it then the console would show "Player was killed by Classname".

damage is the amount of damage to inflict upon the victim.

damagetype is the kind of damage inflicted, really it only affects the icon that appears.

0 : "GENERIC"
1 : "CRUSH"
2 : "BULLET"
4 : "SLASH"
8 : "BURN"
16 : "FREEZE"
32 : "FALL"
64 : "BLAST"
128 : "CLUB"
256 : "SHOCK"
512 : "SONIC"
1024 : "ENERGYBEAM"
16384: "DROWN"
32768 : "PARALYSE"
65536 : "NERVEGAS"
131072 : "POISON"
262144 : "RADIATION"
524288 : "DROWNRECOVER"
1048576 : "CHEMICAL"
2097152 : "SLOWBURN"
4194304 : "SLOWFREEZE"

DarlD 10-25-2005 16:59

Ok this is my script, it compiles, but when i try it on my server it doesnt make my bullets kill one shot, what i want to do is add damage to a players weapon.
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> public plugin_init() {     register_plugin("amx_damage", "1", "Meta")     register_cvar("amx_damage", "0")     register_event("ResetHUD","damage","be"); } public damage(id)     {     set_task(1.0,"todo")     return PLUGIN_CONTINUE } public todo(victim)     {     new damn = get_cvar_num("amx_damage")     fakedamage ( victim, "damage", damn, 1);     return PLUGIN_CONTINUE }

Hawk552 10-25-2005 17:31

This will never do what I think you want it to, but it should work partially. Basically, when you spawn or type "fullupdate" in your console, it'll kill you.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> public plugin_init() {     register_plugin("amx_damage", "1", "Meta")     register_cvar("amx_damage", "100.0")     register_event("ResetHUD","damage","be"); } public damage(id) {     set_task(1.0,"todo",id)     return PLUGIN_CONTINUE } public todo(victim) {     new Float:damn = get_cvar_float("amx_damage")     fakedamage ( victim, "damage", damn, 1);     return PLUGIN_CONTINUE }

DarlD 10-25-2005 17:33

so i cant add damage to a weapon?

XxAvalanchexX 10-25-2005 17:41

Code:
public plugin_init() {    register_event("Damage","event_damage","b"); } public event_damage(id) {    new weapon, hitzone, attacker = get_user_attacker(id,weapon,hitzone);    if(!attacker || attacker == id || !weapon)       return;    new playername[32];    get_user_name(attacker,playername,31);    fakedamage(id,playername,DAMAGE_TO_ADD_HERE,2); }

I use playername as the classname so it will appear as "Player A was killed by Player B" in console.


All times are GMT -4. The time now is 23:39.

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