teleport spawn protection

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

teleport spawn protection

Post by Tazz »

hey again guys...i was wondering how to add spawn protection to a teleports....i have the htele workign fine but too many people are tele camping so trying to get some relief on this situation.....i tried to search for it but kept telling me nothing found and i thought i saw spawn protection on here before....either way here is my script for the teleport but i need to add protection for when u come out the other end

Code: Select all

teletrig:
local.smoke1 = spawn script_model model "static/corona_reg.tik"
local.smoke1 origin ( 1941 104 509  )
local.smoke1 light 1 1 1 35 // r g b radius  
local.smoke1 scale 1
local.smoke1 notsolid
local.trig = spawn trigger_multiple
local.trig.origin = ( 1941 104 509 )
local.trig setsize ( -50 -50 -50 ) ( 50 50 50 )
local.trig targetname port
$port setthread teleport
end
teleport:
self waittill trigger
local.player = parm.other
local.player tele ( 5933 -2103 539 ) 
they only need to be protected for like 3-5 secs and thats it....just so they cant be killed coming right thru


thx for the help again guys



Tazz
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Re: teleport spawn protection

Post by Aprop »

Code: Select all

teletrig:
local.smoke1 = spawn script_model model "static/corona_reg.tik"
local.smoke1 origin ( 1941 104 509  )
local.smoke1 light 1 1 1 35 // r g b radius  
local.smoke1 scale 1
local.smoke1 notsolid
local.smoke1 targetname big_smoke
local.trig = spawn trigger_multiple
local.trig.origin = ( 1941 104 509 )
local.trig setsize ( -50 -50 -50 ) ( 50 50 50 )
local.trig targetname port
$port setthread teleport
end

teleport:
self waittill trigger
local.player = parm.other
local.player tele ( 5933 -2103 539 ) 
$big_smoke remove
$port remove
wait 5

thread teletrig
end
if u want se smoke when tele off just delete remove and make other spawn thread for trigger.. or you can use triggerable, like heere

Code: Select all

teleport:
self waittill trigger
local.player = parm.other
local.player tele ( 5933 -2103 539 ) 
self nottriggerable
wait 5
self triggerable





Second's better, buy your choice.
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Aprop, your first script demolishes the trigger and the second one just turned the trigger off for 5 seconds... Telecamping means, some idiots are camping at the destination of a teletrigger.

I still wonder why people prefer thread and goto for loops, it causes the engine to continuously break and build new threads, Use a nice and healthy while statement instead besides you're using a setthread so the while statement, destroying your teletrigger and building it up again is completely pointless.

Code: Select all

teletrig:
local.smoke1 = spawn script_model model "static/corona_reg.tik"
local.smoke1 origin ( 1941 104 509  )
local.smoke1 light 1 1 1 35 // r g b radius 
local.smoke1 scale 1
local.smoke1 notsolid
local.trig = spawn trigger_multiple
local.trig.origin = ( 1941 104 509 )
local.trig setsize ( -50 -50 -50 ) ( 50 50 50 )
local.trig targetname port
$port setthread teleport
end

teleport:
self waittill trigger
local.player = parm.other
local.player tele ( 5933 -2103 539 ) 
local.player nodamage
wait 3 //change how long you want the player to be protected
local.player takedamage
end
Cheers Tazz.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Tazz
Second Lieutenant
Posts: 155
Joined: Fri Feb 16, 2007 1:29 pm
Contact:

Post by Tazz »

thx sor ill try the local.player nodamage and see how that pans out....thats all i need is a few secs of protection....thx again
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

$oldier Of Ra wrote:Aprop, your first script demolishes the trigger and the second one just turned the trigger off for 5 seconds... Telecamping means, some idiots are camping at the destination of a teletrigger.
My bad, sorry, I didnt understand what he want exacly... i never play on those funny childish servers with teleports and unlimited ammo... its ridiculous.
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Aprop wrote: i never play on those funny childish servers with teleports and unlimited ammo... its ridiculous.
Amen, brother!! :P
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Post Reply