banimod / etpro / ettv forums Forum Index banimod / etpro / ettv forums
Bani's Discussion Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

spawning players

 
Post new topic   Reply to topic    banimod / etpro / ettv forums Forum Index -> ET Modding
View previous topic :: View next topic  
Author Message
crazyfrag



Joined: 01 Oct 2004
Posts: 105

PostPosted: Tue Jun 09, 2009 8:15 am    Post subject: spawning players Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
crazyfrag



Joined: 01 Oct 2004
Posts: 105

PostPosted: Mon Jun 15, 2009 10:41 pm    Post subject: Re: spawning players Reply with quote

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 ?

hmn... any clues?
someone has a code how to revive dead persons?



crazyfrag wrote:

2nd..

is it possible to detect who did dmg with what wapon on a person ( exactly i want to detect falling dmg)

no need anymore

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


ok that works for me!
Back to top
View user's profile Send private message MSN Messenger
McSteve



Joined: 12 Sep 2006
Posts: 112

PostPosted: Tue Jun 16, 2009 12:04 pm    Post subject: Reply with quote

Sort of relevant thread.

Sorry I couldn't be more help, I only touched on it and didn't persist in a solution.
_________________
GhosT:McSteve
Ghostworks Gaming Community
Back to top
View user's profile Send private message
crazyfrag



Joined: 01 Oct 2004
Posts: 105

PostPosted: Wed Jun 17, 2009 10:15 am    Post subject: Re: spawning players Reply with quote

crazyfrag wrote:



2nd..

is it possible to detect who did dmg with what wapon on a person ( exactly iw ant to detect falling dmg)



ok did it
Back to top
View user's profile Send private message MSN Messenger
gotenks



Joined: 15 Nov 2002
Posts: 4040
Location: out of my mind

PostPosted: Sat Jun 20, 2009 6:55 pm    Post subject: Reply with quote

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.
_________________
My Website

After a night of binge drinking:
=FF=im2good4u wrote:
WTF wanst i on top ?
Back to top
View user's profile Send private message Visit poster's website
crazyfrag



Joined: 01 Oct 2004
Posts: 105

PostPosted: Sun Jun 21, 2009 2:52 am    Post subject: Reply with quote

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.

maybe its not that what u want...
i do this but its a bit a mess but for what i want it works

Code:

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




after that u can look up what weapon attacker is atteched to
Back to top
View user's profile Send private message MSN Messenger
Luk4ward



Joined: 30 Jul 2006
Posts: 236
Location: Poland

PostPosted: Mon Jul 13, 2009 2:59 pm    Post subject: Reply with quote

You can spawn at default spawns and move a player after respawn to whatver u want location. This is tricky but works.
_________________
wolFTeam.pl
Back to top
View user's profile Send private message Visit poster's website
crazyfrag



Joined: 01 Oct 2004
Posts: 105

PostPosted: Thu Jul 16, 2009 3:10 am    Post subject: Reply with quote

Luk4ward wrote:
You can spawn at default spawns and move a player after respawn to whatver u want location. This is tricky but works.


u`re using et.gspawn ?
u have a code for this?

i checked etsource and tryied to rebuild reviveentity(ent, ent) but its not working imo...
Back to top
View user's profile Send private message MSN Messenger
Luk4ward



Joined: 30 Jul 2006
Posts: 236
Location: Poland

PostPosted: Wed Jul 29, 2009 10:09 am    Post subject: Reply with quote

try this:

Code:

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


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):

Code:

function entgoto (ent_num, norigin)

   local origin = et.gentity_get(ent_num,"origin") --a vec3 value
   et.gentity_set( ent_num, "origin", norigin )
   
end


There is somewhere here mine topic about this problem Wink, check TJ mods for more code.
_________________
wolFTeam.pl
Back to top
View user's profile Send private message Visit poster's website
crazyfrag



Joined: 01 Oct 2004
Posts: 105

PostPosted: Thu Jul 30, 2009 7:05 am    Post subject: Reply with quote

Luk4ward wrote:
try this:

Code:

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




u spawn players with this out of spawntime? am i right...
im not that lua expert i tried this and its not working.. maybe i understood something wrong? ty 4 ur great help <3


Code:



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

 
Back to top
View user's profile Send private message MSN Messenger
Luk4ward



Joined: 30 Jul 2006
Posts: 236
Location: Poland

PostPosted: Fri Aug 07, 2009 4:46 pm    Post subject: Reply with quote

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
_________________
wolFTeam.pl
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    banimod / etpro / ettv forums Forum Index -> ET Modding All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Powered by phpBB © 2001, 2005 phpBB Group