AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Back to work... (https://forums.alliedmods.net/showthread.php?t=17938)

BioHazardousWaste 09-12-2005 02:23

Back to work...
 
Hey guys,

I've been a way for a while, but now i'm out of summer school, and i'm back from vacation. It's back to work on the new Matrix Mod for me. I tackled those mines again with a buddy of mine tonight, and got them pretty much finished. Only problem is I want to be able to shoot them and have them blow up. So I used this code:

Code:

//creation
entity_set_float(entity,EV_FL_takedamage,1.0)
entity_set_float(entity,EV_FL_health,50.0)

//check hp
new float:ENTHP = entity_get_float(entity, EV_FL_health)
client_print (0, print_console, "Mine HP = %f", ENTHP)//debug print
if (ENTHP <= 0.0)
        BOOM = true

Boom is a boolean that when true the mine explodes. Obviously the mine is an entity. Everything works fine, except according to my console the mine doesn't take damage. It stays at 50.0000 hp no matter how many clips I put into it; and of course it doesn't explode. Anyone know what the problem is?

P.S. I'm loving my kara.. plz give me a bit :) I shouldn't be fucked over for going to summer school and going on vacation.

EDIT:
OK, let's take this a bit further, seems how it's for the new matrix mod, i'm toying with the idea of a minesweeper. How would I go about doing that? I could easily do it if it was a person using get_user_aiming, but it wont return entities will it? Basically I just need to know when someone is aiming at the entity, and which entity it is, then I can take it from there. Not sure how I would go about doing that though. Anybody give me a hand? Thanx

XxAvalanchexX 09-12-2005 17:58

Try these two things:

a) Create the mine entity as a func_breakable and then change it's classname to whatever so that it knows it really should take damage.

b) Set it's max_health to 50.0 first and then it's current health to 50.0

BioHazardousWaste 09-13-2005 18:52

that didn't seem to make a difference, same thing as before :(

EDIT:

Thanx for the karma :D

XxAvalanchexX 09-13-2005 20:29

Quote:

Originally Posted by BioHazardousWaste
Thanx for the karma :D

What?

BioHazardousWaste 09-13-2005 21:20

lol someone must have given me karma cuz i was at -1 yesterday. But um... on to the point, anybody have another idea why it won't take damage?

EDIT:

So noone knows? None of you know how to make an entity take damage. WTF? It can't be hard, please give me a hand.


All times are GMT -4. The time now is 14:32.

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