Scripts / Hiding in the light trigger zone

Author
Message
Sergg
9
Years of Service
User Offline
Joined: 25th Aug 2015
Location:
Posted: 13th Dec 2015 08:05 Edited at: 13th Dec 2015 08:06
Hello everybody. I started writing the script to ensure that when entering the trigger zone switches off the light. That is HideLight (e). A test light is not hidden. What to do?


function offlight_init(e)
end

function offlight_main(e)
if g_Entity[e]['plrinzone']==1 then
PlaySound(e,0)
HideLight(e)
Destroy(e)
end
end
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 13th Dec 2015 09:58
The 'e' refers to the entity number running the script - in this case the trigger zone, you need to either store the light 'e' in a variable from the light's script (or move this script to the light and store the zone 'e' with a different script) and then put the variable in the HideLight()

Or hover over the light you wish to turn off in the editor, at the bottom will show the entity number (the first number)
Place this number in HideLight()
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-12-22 10:44:15
Your offset time is: 2024-12-22 10:44:15