Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/14/15 in all areas

  1. Nachz

    Need help with a lua script.

    The new getXP fonction you gave me, works pretty well. And I added this to my setskills function: local gamestate = tonumber( et.trap_Cvar_Get('gamestate') ) if gamestate == 0 then et.G_AddSkillPoints(playerID, 0, 500) et.G_AddSkillPoints(playerID, 1, 500) et.G_AddSkillPoints(playerID, 2, 500) et.G_AddSkillPoints(playerID, 3, 500) et.G_AddSkillPoints(playerID, 4, 500) et.G_AddSkillPoints(playerID, 5, 500) et.G_AddSkillPoints(playerID, 6, 500) et.G_AddSkillPoints(playerID, 1, 500) And the good gamestate number was 0, because 1 is for warmup and 0 is for when the game is started. Thanks a lot, my problem is fixed !
    1 point
  2. Zelly

    Need help with a lua script.

    Hmm... to fix warmup xp gain is pretty simple just check gamestate I always forget the correct number though. I think it is this: local gamestate = tonumber( et.trap_Cvar_Get('gamestate') ) if gamestate == 1 then -- do xp stuff here. end So are you saying it gives xp to players that have more than 1000 xp every spawn? or Just once.If it is just once then I assume it is related to a small bug, where xp from lua is 0 until at least one xp is gained: http://mygamingtalk.com/forums/topic/3346-lua-get-xp-value/ I would have to do some more testing my self again to verify a good method to get xp in lua, I forget which method I normally use. Try this: (Disclaimer this is off the top of my head not sure if this is right) function getXP(clientNum) local xp = 0 for k=0, 6 do xp = xp + tonumber(et.gentity_get(clientNum,"sess.skillpoints",k)) end return xp end Hope that helps, I didn't do any fact checking.
    1 point
  3. Purple

    Automove

    Always see some sort of automove talk on here, so here is a simple automove that works well and i have been using on my server for months, modified quiet a bit to be usable by anyone. -- automove redone. function et_InitGame(levelTime,randomSeed,restart) et.RegisterModname("^1D^0Ri Team Balance") players = { } players[0] = 0 --all players[1] = 0 --axis players[2] = 0 --allies players[3] = 0 --spectators end function et_Obituary(client, killer, death) axiskilled = 0 allieskilled = 0 count2 = 0 player_name2 = GetPlayerName(client) local game_state = tonumber(et.trap_Cvar_Get("gamestate")) local player_team = et.gentity_get(client, "sess.SessionTeam") if game_state ~= 1 and game_state ~= 2 then players[0] = 0 --all players[1] = 0 --axis players[2] = 0 --allies players[3] = 0 --spectators for i = 0, tonumber(et.trap_Cvar_Get("sv_maxclients")) -1, 1 do local teamnumber = tonumber(et.gentity_get(i,"sess.sessionTeam")) if et.gentity_get(i,"pers.connected") == 2 then players[0] = players[0] + 1 players[teamnumber] = players[teamnumber] + 1 end end if (( (players[1] - players[2]) > 1 and player_team == 1 ) or ( (players[2] - players[1]) > 1 and player_team == 2 )) then if player_team == 1 then axiskilled = 1 else allieskilled = 1 end et.trap_SendServerCommand(-1, "chat \"^3Automoving " .. player_name2 .. " ^3as teams were uneven... \"") end end return nil end function et_RunFrame() if axiskilled == 1 then delayaxis() elseif allieskilled == 1 then delayallies() end end function delayaxis() count2 = count2 + 1 if count2 >= 5 then --every 5 deaths move the next player that dies et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. player_name2 .. " b") count2 = 0 axiskilled = 0 end end function delayallies() count2 = count2 + 1 if count2 >= 5 then--every 5 deaths move the next player that dies et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. player_name2 .. " r") count2 = 0 allieskilled = 0 end end function GetPlayerName(client) return et.Q_CleanStr(et.gentity_get(client, "pers.netname")) end function et_ShutdownGame(restart) end
    1 point
×
×
  • Create New...