| This topic has not yet been rated!
|
You have not rated this topic. Select a rating:
|
|
Author |
Topic: Poison smoke grenade (Read 169 times)
|
anuanu
Level 0 Beginner
Offline
 United States
Posts: 9
|
 |
« on: December 27, 2009, 04:13:42 AM » |
|
With the following code it kills the player, How would I go about changing it so that it show that I killed him so that XP is given. "skill1_setting" "es_xsetinfo ep_radius 0.7;es_xsetinfo ep_damage 1|es_xsetinfo ep_radius 0.9;es_xsetinfo ep_damage 1|es_xsetinfo ep_radius 1;es_xsetinfo ep_damage 1|es_xsetinfo ep_radius 1.2;es_xsetinfo ep_damage 1" "skill1_cmd" "es es_xkeysetvalue WCSuserdata event_var(userid) poisonsmoke 1;es es_xdelayed 3 es_xtell event_var(userid) #multi #green[Poison Smoke Grenades] #lightgreenYour Smoke grenades will release a #greenPoison Gas" "skill1_sfx" "0"
event smokegrenade_detonate { es_xset poisonsmoke 0 es es_xkeygetvalue poisonsmoke WCSuserdata event_var(userid) poisonsmoke es es_xif (server_var(poisonsmoke) = 1) do { es_xset ep_radius2 150 es_xset ep_damage2 1 es_xset smoke_loc 0 if (server_var(ep_radius) greaterthan "0") then es_xmath ep_radius2 * server_var(ep_radius) if (server_var(ep_damage) greaterthan "0") then es_xmath ep_damage2 * server_var(ep_damage) es_format ep_radius2 "DamageRadius %1" server_var(ep_radius2) es_format ep_damage2 "Damage %1" server_var(ep_damage2) es_give event_var(userid) point_hurt es_setinfo hurt_index server_var(eventscripts_lastgive) es_fire event_var(userid) point_hurt addoutput "OnUser1 !self,kill,-1,20" es_fire event_var(userid) point_hurt addoutput server_var(ep_damage2) es_fire event_var(userid) point_hurt addoutput server_var(ep_radius2) es_fire event_var(userid) point_hurt addoutput "DamageType 32" es_createvectorstring smoke_loc event_var(x) event_var(y) event_var(z) es_setindexprop server_var(hurt_index) "CBaseEntity.m_vecOrigin" server_var(smoke_loc) es_fire event_var(userid) point_hurt TurnOn es_fire event_var(userid) point_hurt FireUser1 es est_playplayer event_var(userid) ambient/machines/gas_loop_1.wav es es_delayed 8 es_stopsound event_var(userid) ambient/machines/gas_loop_1.wav } }
|
|
|
|
|
Logged
|
|
|
|
|
DanMister
|
 |
« Reply #1 on: December 27, 2009, 04:56:07 AM » |
|
sorry mate, If it was python i could help ya. Ermm… send a message to someone, were a helpful community (as long as your willing to actually read tutorials and not just dump all your problems on us and expect us to fix them). Textno, Avast, Oddity, CA.Berettonawak, and Yiyas would be the top go to guys for you.
hope you can get some help. and hey, while your waiting for a respond, why don't you go and read some tutorials! I hear there good reading XD. good luck,
-Dan-
|
|
|
|
|
Logged
|
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister "Genius may have its limitations, but stupidity is not thus handicapped." Elbert Hubbard
|
|
|
|
[Oddity]TeacherCreature
|
 |
« Reply #2 on: December 27, 2009, 05:38:29 PM » |
|
You really wouldnt, that is like making a hurt entity where teh smoke it I bet that code would hurt your teamates also!
Instead of using that create a loop using the location of the detonation and jsut use est_nearcoords
|
|
|
|
|
Logged
|
|
|
|
anuanu
Level 0 Beginner
Offline
 United States
Posts: 9
|
 |
« Reply #3 on: December 28, 2009, 02:17:41 AM » |
|
You really wouldnt, that is like making a hurt entity where teh smoke it I bet that code would hurt your teamates also!
Instead of using that create a loop using the location of the detonation and jsut use est_nearcoords
Bare with me on this as I'm still learning how all of this works...Im like the noob of all noobs when it comes to this. But once I got it...I got it.
|
|
|
|
|
Logged
|
|
|
|
|
DanMister
|
 |
« Reply #4 on: December 28, 2009, 08:31:31 AM » |
|
well, In python terminology what he's saying is: GeSHi (python): def smokegrenade_detonate(ev): # this will call out the below every time a smoke grenade is detonated. userid = ev['userid'] # named ev['userid'] to userid for quicker reference. attacker = ev['attacker'] # named ev['attacker'] to attacker for quicker reference. x = event_var(x) # the x coordinate of the smoke grenade detonation location. y = event_var(y) # the y coordinate of the smoke grenade detonation location. z = event_var(z) # the z coordinate of the smoke grenade detonation location. command = wcs.Command(userid) # just named it for easier reference. if ev['es_userteam'] == 2: filtername = '#ct' else: filtername = '#t' # gets the enemy team and stores it as "filtername' (note: if ev['es_userteam'] == 2 then that team is the terrorist, if it == 3 then its the counter-terrorist, if it == 1, the its specs. while playerlib.nearCoord((x, y, z), 50, filtername): # while is a loop command in python. playerlib = is a ESP() module which can be used for MANY things. .nearCoord = a ESP() module command that gets a list of players within a specifed area. x = event_var(x), the x coordinate of the smoke grenade detonation. y = event_var(y), the y coordinate of the smoke grenade detonation. z = event_var(z), the z coordinate of the smoke grenade detonation. (side note: when x, y, and z are next to each other like this, we call it a vector also known as the location coord's). 50 = diameter from the "vector" and out, to check for players entering the smoke. filtername = a filtername is a value we have to "filter" playernames out of the playerlist (note: playerlib.nearCoord is a list of all players in the diameter of 50 in-game units of vector. in this case filter is = to the opposite of your team so that it hurts the other team, not your team. command.Damage( 1, 131072, attacker) # command = wcs.Command (a name used to call out a WCS Python Command). .Damage( The WCS Python Command were calling out). 1 = damage, (since the python loop module "while" loops very quick, setting it to one will drain his health at a better rate). 131072 = the type of damage being done (its just extra, its not actually neccesary). attacker = the attacker who actually threw the smoke grenade in the first place.[code] well I hope this helped you out at atleast i little bit. :D Best of luck, -Dan-
[/code]
|
|
|
|
|
Logged
|
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister "Genius may have its limitations, but stupidity is not thus handicapped." Elbert Hubbard
|
|
|
|
|
|
DanMister
|
 |
« Reply #6 on: December 28, 2009, 08:42:16 AM » |
|
it deffinately makes me feel good  , I like being one of the only one on these forums who know he is really fluent at it. I like to help other people, not get helped. 
|
|
|
|
|
Logged
|
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister "Genius may have its limitations, but stupidity is not thus handicapped." Elbert Hubbard
|
|
|
|
gimik
|
 |
« Reply #7 on: December 28, 2009, 08:47:05 AM » |
|
Well thats cool  However, i don't know if that will help him much since i don't think hes using Python O.o Could be wrong tho haha
|
|
|
|
|
Logged
|
|
|
|
|
DanMister
|
 |
« Reply #8 on: December 28, 2009, 08:48:12 AM » |
|
*whispers* he's already told us he's a noob at both so i don't think it'll matter which one i put it in…. XD *unwhisper*
|
|
|
|
|
Logged
|
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister "Genius may have its limitations, but stupidity is not thus handicapped." Elbert Hubbard
|
|
|
|
gimik
|
 |
« Reply #9 on: December 28, 2009, 08:52:00 AM » |
|
*whispers back* I'm picking up what your puttin down *unwhispers back*
|
|
|
|
|
Logged
|
|
|
|
|
DanMister
|
 |
« Reply #10 on: December 28, 2009, 09:04:05 AM » |
|
*ponders…* what is gimick talking about? *stops pondering…*
|
|
|
|
|
Logged
|
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister "Genius may have its limitations, but stupidity is not thus handicapped." Elbert Hubbard
|
|
|
|
gimik
|
 |
« Reply #11 on: December 28, 2009, 09:10:24 AM » |
|
*ponders...* Hmm, should i kill Dan for spell my name wrong? *stops pondering...*
|
|
|
|
|
Logged
|
|
|
|
|
DanMister
|
 |
« Reply #12 on: December 28, 2009, 09:11:36 AM » |
|
 *wonders why gimick spelled his name wrong in his forum userid….*
|
|
|
|
|
Logged
|
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister "Genius may have its limitations, but stupidity is not thus handicapped." Elbert Hubbard
|
|
|
|
[Oddity]TeacherCreature
|
 |
« Reply #13 on: December 28, 2009, 05:14:10 PM » |
|
Dan i dontk now python but does that loop for "x" seconds? it should
Basically for non python what I am saying is you make a serpentwardwhere the detonation occurs just make it an invisible serpent ward.
Pretty easy.
|
|
|
|
|
Logged
|
|
|
|
anuanu
Level 0 Beginner
Offline
 United States
Posts: 9
|
 |
« Reply #14 on: December 30, 2009, 08:37:31 PM » |
|
yea I have no idea of anything you just said lol. I do know that its the ES version not PY.
Yea I dont even know where to begin to change stuff or anything. So far for that smoke grenade code I posted is just a C/P from another race I found on these forums. If you can by chance just walk me through it I should be able to understand whats actually needed for the future.
|
|
|
|
|
Logged
|
|
|
|
|
|
|