spawning players
Moderators: Forum moderators, developers
spawning players
is it possible to spawn players outside of theire spawntime via lua?
cause setting hp will bug the players...
and reviving is not possible by server...
et.GSpawn ?
2nd..
is it possible to detect who did dmg with what wapon on a person ( exactly iw ant to detect falling dmg)
and 3rd:
can i godmode someone for a defined numer of time without activating the cheat
et.gentity_set(clientNum, "ps.powerups", 1, time ) seems not to work
ty guys
cause setting hp will bug the players...
and reviving is not possible by server...
et.GSpawn ?
2nd..
is it possible to detect who did dmg with what wapon on a person ( exactly iw ant to detect falling dmg)
and 3rd:
can i godmode someone for a defined numer of time without activating the cheat
et.gentity_set(clientNum, "ps.powerups", 1, time ) seems not to work
ty guys
Re: spawning players
hmn... any clues?crazyfrag wrote: is it possible to spawn players outside of theire spawntime via lua?
cause setting hp will bug the players...
and reviving is not possible by server...
et.GSpawn ?
someone has a code how to revive dead persons?
no need anymorecrazyfrag wrote: 2nd..
is it possible to detect who did dmg with what wapon on a person ( exactly i want to detect falling dmg)
ok that works for me!crazyfrag wrote: can i godmode someone for a defined numer of time without activating the cheat
et.gentity_set(clientNum, "ps.powerups", 1, time ) seems not to work
Sort of relevant thread.
Sorry I couldn't be more help, I only touched on it and didn't persist in a solution.
Sorry I couldn't be more help, I only touched on it and didn't persist in a solution.
GhosT:McSteve
Ghostworks Gaming Community
Ghostworks Gaming Community
Re: spawning players
ok did itcrazyfrag wrote:
2nd..
is it possible to detect who did dmg with what wapon on a person ( exactly iw ant to detect falling dmg)
maybe its not that what u want...gotenks wrote:i'm actually curious on that one too... haven't looked yet, but just so I have a place to look, how did you do it.
i do this but its a bit a mess but for what i want it works
Code: Select all
function et_RunFrame( levelTime )
for j = 0, (mclients - 1) do
attacker = et.gentity_get(j, "ps.persistant", 5)
if j ~= attacker then -- the persistant return starts @ 0 if u have slot 0 theres a prob
if (attacker >= 0) and (attacker < 64) then -- falling dmg has 1022
if et.gentity_get(attacker,"inuse") then
try this:
after all i was using this code to move the obj with specified ent num to new origin place (norigin is the array of x,y,z):
There is somewhere here mine topic about this problem
, check TJ mods for more code.
Code: Select all
tname = "set1_allies_8" -- targetname of spawn
et_respawn() -- pseudo code
{
setspwn (3, tname)
}
function setspwn (point, name)
for entnum = 64, 1021 do
if et.gentity_get(entnum, "targetname") == name then
oldspawnval = et.G_GetSpawnVar( entnum, "spawnflags" )
newspawnval = point
et.G_SetSpawnVar( entnum, "spawnflags", newspawnval )
spawnval = et.G_GetSpawnVar( entnum, "spawnflags" )
end
end
end
Code: Select all
function entgoto (ent_num, norigin)
local origin = et.gentity_get(ent_num,"origin") --a vec3 value
et.gentity_set( ent_num, "origin", norigin )
end
![Wink ;)](./images/smilies/icon_wink.gif)
wolFTeam.pl
u spawn players with this out of spawntime? am i right...Luk4ward wrote:try this:
Code: Select all
tname = "set1_allies_8" -- targetname of spawn et_respawn() -- pseudo code { setspwn (3, tname) } function setspwn (point, name) for entnum = 64, 1021 do if et.gentity_get(entnum, "targetname") == name then oldspawnval = et.G_GetSpawnVar( entnum, "spawnflags" ) newspawnval = point et.G_SetSpawnVar( entnum, "spawnflags", newspawnval ) spawnval = et.G_GetSpawnVar( entnum, "spawnflags" ) end end end
im not that lua expert i tried this and its not working.. maybe i understood something wrong? ty 4 ur great help <3
Code: Select all
function et_InitGame(levelTime,randomSeed,restart)
maxclients = tonumber( et.trap_Cvar_Get( "sv_maxClients" ) ) --gets the maxclients
end
function et_RunFrame( levelTime )
for cno =0 , maxclients - 1 do
if et.gentity_get(cno, "health") <= 0 then
tname = "alliedspawn" -- targetname of spawn
setspwn(3 , tname)
end
end
end
function setspwn (point, name)
for entnum = 64, 1021 do
if et.gentity_get(entnum, "targetname") == name then
oldspawnval = et.G_GetSpawnVar( entnum, "spawnflags" )
newspawnval = point
et.G_SetSpawnVar( entnum, "spawnflags", newspawnval )
spawnval = et.G_GetSpawnVar( entnum, "spawnflags" )
end
end
end
You have to know some mapscripting in order to get targetnames of spawns. Did You debug this function for example:
if et.gentity_get(entnum, "targetname") == name then
print("found entnum ["..entnum.."]" for targetname)
smth like this? Try setspwn (0, tname), 1.2.3.4.5. It was working for me, but i got good mapper :p
if et.gentity_get(entnum, "targetname") == name then
print("found entnum ["..entnum.."]" for targetname)
smth like this? Try setspwn (0, tname), 1.2.3.4.5. It was working for me, but i got good mapper :p
wolFTeam.pl