|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Mar 28, 2007 6:11 am Post subject: killlvz |
|
|
|
|
I really hate kill lvz that obscure my view, like covering my ship or some giant blood splat. Anyway I was reading this thread Image random changing and thought I should just make it in py to show how easy it is.
If you didn't read the thread this module will toggle a random image on when a player dies.
Here is the entire code with useless stuff removed:
# change these settings, the range is inclusive
ImageRangeMin=200
ImageRangeMax=202
from asss import *
objs = get_interface(I_OBJECTS)
prng = get_interface(I_PRNG)
def kill(arena, killer, killed, bty, flags, pts, green):
randomid = prng.Number(ImageRangeMin, ImageRangeMax)
objs.Toggle(killed, randomid, 1)
return pts, green
def mm_attach(arena):
arena.killlvz_ref1 = reg_callback(CB_KILL, kill, arena)
def mm_detach(arena):
arena.killlvz_ref1 = None |
I've attached the full code zipped with an example .lvz. _________________ ss news
py + lvz
killlvz.zip - 5.75 KB
File downloaded or viewed 45 time(s)
|
|
Back to top |
|
|
laww Newbie
Age:41 Gender: Joined: Mar 22 2007 Posts: 10 Offline
|
Posted: Wed Mar 28, 2007 8:46 am Post subject: |
|
|
|
|
thanks alot... btw is there a way you can make it when someone kill and a image pop up also?
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Mar 28, 2007 10:34 am Post subject: |
|
|
|
|
Yeah that can be done by copy/pasting some code, renaming ImageRangeMin/ImageRangeMan and editing killed to be killer.
# change these settings, the range is inclusive
ImageRangeKilledMin=200
ImageRangeKilledMax=202
ImageRangeKillerMin=200
ImageRangeKillerMax=202
from asss import *
objs = get_interface(I_OBJECTS)
prng = get_interface(I_PRNG)
def kill(arena, killer, killed, bty, flags, pts, green):
randomid = prng.Number(ImageRangeKilledMin, ImageRangeKilledMax)
objs.Toggle(killed, randomid, 1)
randomid = prng.Number(ImageRangeKillerMin, ImageRangeKillerMax)
objs.Toggle(killer, randomid, 1)
return pts, green
def mm_attach(arena):
arena.killlvz_ref1 = reg_callback(CB_KILL, kill, arena)
def mm_detach(arena):
arena.killlvz_ref1 = None |
|
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 893 page(s) served in previous 5 minutes.
|