[HL2:DM] spawn effect

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 403
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[HL2:DM] spawn effect

Postby Painkiller » Wed Oct 03, 2018 12:53 pm

Would it be possible that someone rewrote this in SP?

Syntax: Select all

# Valid effects: 
# EFFECT = 1
# EFFECT = 2
# EFFECT = 3


EFFECT = 3
EFFECT_TIME = 5



import es
import gamethread



def player_spawn(ev):
userid = int(ev['userid'])
if es.getplayerteam(userid):
if EFFECT == 1:
effect1(userid)
elif EFFECT == 2:
effect2(userid)
elif EFFECT == 3:
effect3(userid)


def killEffects(userid):
es.server.queuecmd('es_fire %s tornado1 Kill'%userid)
es.server.queuecmd('es_fire %s tornado2 Kill'%userid)
es.server.queuecmd('es_fire %s tornado2timer Kill'%userid)
es.server.queuecmd('es_fire %s tornado3 Kill'%userid)

def effect1(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado1"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado1"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "basespread 80"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "speed 150"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "startsize 8"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "SpreadSpeed 1"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "endsize 5"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "Rate 250"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "Jetlength 400"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "windspeed 0"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "smokematerial sprites/strider_blackball.vmt"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "twist 175"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "rendercolor 100 100 250"'%userid)
es.server.queuecmd('es_fire %s tornado1 Turnon'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)


def effect2(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado2"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado2"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "basespread 67"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "speed 500"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "startsize 10"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "SpreadSpeed 10"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "endsize 5"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "Rate 2200"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "Jetlength 150"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "windspeed 0"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "smokematerial sprites/strider_blackball.vmt"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "twist 800"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "rendercolor 255 0 0"'%userid)
es.server.queuecmd('es_fire %s tornado2 Turnon'%userid)
es.server.queuecmd('es_give %s logic_timer'%userid)
es.server.queuecmd('es_fire %s logic_timer addoutput "targetname tornado2timer"'%userid)
es.server.queuecmd('es_fire %s tornado2timer toggle'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "refiretime 1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer enable'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "startdisabled 0"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "UseRandomTime 0"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 0 0,.4,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 127 0,.4,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 255 0,.2,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,smokematerial particle/fire"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 0 255 0,.6,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 0 0 255,.8,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 75 0 130,.1,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 143 0 255,.3,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,smokematerial sprites/strider_blackball.vmt"'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)

def effect3(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado3"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado3"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "basespread 15"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "spreadspeed 1"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "initial 0"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "speed 300"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "startsize 1"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "endsize 110"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "rate 60"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "jetlength 800"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "twist 200"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "SmokeMaterial particle/particle_smokegrenade.vmt"'%userid)
#es.server.queuecmd('es_fire %s tornado3 "angles 0 0 0"'%userid)
es.server.queuecmd('es_fire %s tornado3 "renderamt 255"'%userid)
c1 = random.randint(0,255)
c2 = random.randint(0,255)
c3 = random.randint(0,255)
es.server.queuecmd('es_fire %s tornado3 "rendercolor %s %s %s"'%(userid, c1, c2, c3))
es.server.queuecmd('es_fire %s tornado3 "color %s %s %s"'%(userid, c1, c2, c3))
es.server.queuecmd('es_fire %s tornado3 turnon'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)
User avatar
Kami
Global Moderator
Posts: 143
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: [HL2:DM] spawn effect

Postby Kami » Wed Oct 03, 2018 2:49 pm

If you use Ayuto's EventScripts emulator this will just work fine. The only problem this has is that the import for random is missing. Try this with the emulator:

Syntax: Select all

# Valid effects: 
# EFFECT = 1
# EFFECT = 2
# EFFECT = 3


EFFECT = 3
EFFECT_TIME = 5



import es
import gamethread
import random


def player_spawn(ev):
userid = int(ev['userid'])
if es.getplayerteam(userid):
if EFFECT == 1:
effect1(userid)
elif EFFECT == 2:
effect2(userid)
elif EFFECT == 3:
effect3(userid)


def killEffects(userid):
es.server.queuecmd('es_fire %s tornado1 Kill'%userid)
es.server.queuecmd('es_fire %s tornado2 Kill'%userid)
es.server.queuecmd('es_fire %s tornado2timer Kill'%userid)
es.server.queuecmd('es_fire %s tornado3 Kill'%userid)

def effect1(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado1"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado1"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "basespread 80"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "speed 150"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "startsize 8"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "SpreadSpeed 1"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "endsize 5"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "Rate 250"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "Jetlength 400"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "windspeed 0"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "smokematerial sprites/strider_blackball.vmt"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "twist 175"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "rendercolor 100 100 250"'%userid)
es.server.queuecmd('es_fire %s tornado1 Turnon'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)


def effect2(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado2"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado2"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "basespread 67"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "speed 500"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "startsize 10"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "SpreadSpeed 10"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "endsize 5"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "Rate 2200"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "Jetlength 150"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "windspeed 0"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "smokematerial sprites/strider_blackball.vmt"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "twist 800"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "rendercolor 255 0 0"'%userid)
es.server.queuecmd('es_fire %s tornado2 Turnon'%userid)
es.server.queuecmd('es_give %s logic_timer'%userid)
es.server.queuecmd('es_fire %s logic_timer addoutput "targetname tornado2timer"'%userid)
es.server.queuecmd('es_fire %s tornado2timer toggle'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "refiretime 1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer enable'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "startdisabled 0"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "UseRandomTime 0"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 0 0,.4,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 127 0,.4,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 255 0,.2,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,smokematerial particle/fire"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 0 255 0,.6,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 0 0 255,.8,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 75 0 130,.1,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 143 0 255,.3,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,smokematerial sprites/strider_blackball.vmt"'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)

def effect3(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado3"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado3"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "basespread 15"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "spreadspeed 1"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "initial 0"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "speed 300"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "startsize 1"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "endsize 110"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "rate 60"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "jetlength 800"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "twist 200"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "SmokeMaterial particle/particle_smokegrenade.vmt"'%userid)
#es.server.queuecmd('es_fire %s tornado3 "angles 0 0 0"'%userid)
es.server.queuecmd('es_fire %s tornado3 "renderamt 255"'%userid)
c1 = random.randint(0,255)
c2 = random.randint(0,255)
c3 = random.randint(0,255)
es.server.queuecmd('es_fire %s tornado3 "rendercolor %s %s %s"'%(userid, c1, c2, c3))
es.server.queuecmd('es_fire %s tornado3 "color %s %s %s"'%(userid, c1, c2, c3))
es.server.queuecmd('es_fire %s tornado3 turnon'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)
User avatar
Painkiller
Senior Member
Posts: 403
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] spawn effect

Postby Painkiller » Wed Oct 03, 2018 3:48 pm

I use the emulator and it does not work.

Ayuto also told me that certain something does not work yet
User avatar
Kami
Global Moderator
Posts: 143
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: [HL2:DM] spawn effect

Postby Kami » Wed Oct 03, 2018 3:51 pm

I tried it with the emulator in CS:S and it showed me the effect. Your version did not work because you were missing the import.
User avatar
Painkiller
Senior Member
Posts: 403
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] spawn effect

Postby Painkiller » Wed Oct 03, 2018 3:55 pm

Ok, I'll try it again. Many Thanks
User avatar
Painkiller
Senior Member
Posts: 403
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] spawn effect

Postby Painkiller » Wed Oct 03, 2018 5:07 pm

Eventscripts is loaded latest SP version on it.
ese convert spawn_effect command in hlsw
es_load spawn_effect und sp plugin load es_emulator in autoexec.cfg

But nothing happens
Nothing is rewritten
User avatar
Kami
Global Moderator
Posts: 143
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: [HL2:DM] spawn effect

Postby Kami » Wed Oct 03, 2018 7:16 pm

Syntax: Select all

# Valid effects: 
# EFFECT = 1
# EFFECT = 2
# EFFECT = 3


EFFECT = 2
EFFECT_TIME = 5



import es
import gamethread
import random

def player_spawn(ev):
userid = int(ev['userid'])
if EFFECT == 1:
effect1(userid)
elif EFFECT == 2:
effect2(userid)
elif EFFECT == 3:
effect3(userid)

def player_activate(ev):
userid = int(ev['userid'])
es.server.queuecmd('mp_disable_autokick %s' % userid)


def killEffects(userid):
es.server.queuecmd('es_fire %s tornado1 Kill'%userid)
es.server.queuecmd('es_fire %s tornado2 Kill'%userid)
es.server.queuecmd('es_fire %s tornado2timer Kill'%userid)
es.server.queuecmd('es_fire %s tornado3 Kill'%userid)

def effect1(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado1"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado1"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "basespread 80"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "speed 150"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "startsize 8"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "SpreadSpeed 1"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "endsize 5"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "Rate 250"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "Jetlength 400"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "windspeed 0"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "smokematerial sprites/strider_blackball.vmt"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "twist 175"'%userid)
es.server.queuecmd('es_fire %s tornado1 addoutput "rendercolor 100 100 250"'%userid)
es.server.queuecmd('es_fire %s tornado1 Turnon'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)


def effect2(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado2"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado2"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "basespread 67"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "speed 500"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "startsize 10"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "SpreadSpeed 10"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "endsize 5"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "Rate 2200"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "Jetlength 150"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "windspeed 0"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "smokematerial sprites/strider_blackball.vmt"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "twist 800"'%userid)
es.server.queuecmd('es_fire %s tornado2 addoutput "rendercolor 255 0 0"'%userid)
es.server.queuecmd('es_fire %s tornado2 Turnon'%userid)
es.server.queuecmd('es_give %s logic_timer'%userid)
es.server.queuecmd('es_fire %s logic_timer addoutput "targetname tornado2timer"'%userid)
es.server.queuecmd('es_fire %s tornado2timer toggle'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "refiretime 1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer enable'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "startdisabled 0"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "UseRandomTime 0"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 0 0,.4,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 127 0,.4,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 255 255 0,.2,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,smokematerial particle/fire"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 0 255 0,.6,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 0 0 255,.8,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 75 0 130,.1,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,rendercolor 143 0 255,.3,-1"'%userid)
es.server.queuecmd('es_fire %s tornado2timer addoutput "ontimer tornado2,addoutput,smokematerial sprites/strider_blackball.vmt"'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)

def effect3(userid):
es.server.queuecmd('es_give %s env_smokestack'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "classname tornado3"'%userid)
es.server.queuecmd('es_fire %s env_smokestack addoutput "targetname tornado3"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "basespread 15"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "spreadspeed 1"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "initial 0"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "speed 300"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "startsize 1"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "endsize 110"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "rate 60"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "jetlength 800"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "twist 200"'%userid)
es.server.queuecmd('es_fire %s tornado3 addoutput "SmokeMaterial particle/particle_smokegrenade.vmt"'%userid)
#es.server.queuecmd('es_fire %s tornado3 "angles 0 0 0"'%userid)
es.server.queuecmd('es_fire %s tornado3 "renderamt 255"'%userid)
c1 = random.randint(0,255)
c2 = random.randint(0,255)
c3 = random.randint(0,255)
es.server.queuecmd('es_fire %s tornado3 "rendercolor %s %s %s"'%(userid, c1, c2, c3))
es.server.queuecmd('es_fire %s tornado3 "color %s %s %s"'%(userid, c1, c2, c3))
es.server.queuecmd('es_fire %s tornado3 turnon'%userid)
gamethread.delayed(EFFECT_TIME, killEffects, userid)
User avatar
Painkiller
Senior Member
Posts: 403
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] spawn effect

Postby Painkiller » Thu Oct 04, 2018 9:08 am

Thanks Kami, work.

Ps.: I have here the same probleme

But nothing happens
Nothing is rewritten

Syntax: Select all

EFFECT_TIME = 8         # How long will the effect last once started
STRIKE_INTERVAL = 0.3 # Intervall of the point_tesla lightnings to strike

import es
import gamethread

counter = 0

def player_death(event_var):
global counter
weapon = event_var['weapon']
userid = event_var['userid']
if weapon != "combine_ball": # combine_ball
return
position = es.getplayerlocation(userid)
index = es.createentity('point_tesla')
name = '%i_pt' %index
es.entitysetvalue(index, 'targetname', name)
es.entitysetvalue(index, 'origin', "%s %s %s" %(position[0], position[1], position[2]))
es.entitysetvalue(index, 'texture', 'effects/bluespark.vmt')
es.entitysetvalue(index, 'm_SoundName', 'DoSpark')
es.entitysetvalue(index, 'm_Color', '255 255 255')
es.entitysetvalue(index, 'm_flRadius', 300)
es.entitysetvalue(index, 'beamcount_min', 20)
es.entitysetvalue(index, 'beamcount_max', 100)
es.entitysetvalue(index, 'thick_min', 10)
es.entitysetvalue(index, 'thick_max', 18)
es.entitysetvalue(index, 'lifetime_min', 0.3)
es.entitysetvalue(index, 'lifetime_max', 0.6)
es.entitysetvalue(index, 'interval_min', 0.01)
es.entitysetvalue(index, 'interval_max', 0.03)
# es.InsertServerCommand('es_xfire %s %s TurnOn' %(userid, name))
counter = 0
do_effect(index, name)

def do_effect(index, name):
global counter
userid = es.getuserid()
es.InsertServerCommand('es_xfire %s %s DoSpark' %(userid, name))
counter += STRIKE_INTERVAL
if counter >= EFFECT_TIME:
es.InsertServerCommand('es_xremove ' + str(index))
return
gamethread.delayed(STRIKE_INTERVAL, do_effect, (index, name))

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 1 guest