---------------------------------------------------------------------- -- Filename: myguid.lua ---------------------------------------------------------------------- -- MyGUID - Prints your silEnT GUID just like /cl_guid would for etkey based GUIDs. ---------------------------------------------------------------------- -- Created by =F|A=Chuckun -- If you use it, please donate to our clan to help fund the servers -- Any amount will help!! -- Fearless-Assassins.com ---------------------------------------------------------------------- -- For use with shrubbot, exec 'getmyguid' ----------------------------------------------------------------------
description = "silEnT GUID Command" version = "1.0" -- is not used in any function
function et_InitGame(levelTime,randomSeed,restart) local modname = string.format("%s", description) et.G_Print(string.format("%s loaded\n", modname)) et.RegisterModname(modname) end
function et_ConsoleCommand(clientNum, command) if et.trap_Argv(0) == "getmyguid" then local guid = et.Info_ValueForKey(et.trap_GetUserinfo(playerID),"sil_guid") et.trap_SendServerCommand(clientNum, "print \"^osilEnT GUID: ^7"..guid.."\n") return 1 ---return 1 here...if not have getmyguid comand will be 0..unreconize comand end end
im begginer too...usualy i hunt logs for errors ....but i thik like this will work gaoesa solution is better no lua
Hello silent devs and all ppl around here... first ...sorry for my english... and .. i have a lua script active like 1 year on our silent server..and its works...if 1 team have 2 or more players avantage ...the script moves first plwyer who die from oponent team....i share whit you and i hope is help..credits for this script go to DMG Deevious
-- [ Local Functions ]
function GetPlayerGUID(client)
local player_guid = et.Info_ValueForKey(et.trap_GetUserinfo(client), "sil_guid" )
if player_guid == "NO_GUID" or player_guid == "unknown" then
return true
end
return player_guid
end
function GetPlayerName(client)
return et.Q_CleanStr(et.gentity_get(client, "pers.netname"))
end
-- [ Wolf Callbacks ]
function et_InitGame(levelTime,randomSeed,restart)
et.RegisterModname("DMG Team Balance #1")
players = { }
players[0] = 0 --all
players[1] = 0 --axis
players[2] = 0 --allies
players[3] = 0 --spectators
end
function et_ShutdownGame(restart)
-- nimic
end
function et_Obituary(client, killer, death)
local player_guid = GetPlayerGUID(client)
local player_name = GetPlayerName(client)
local game_state = tonumber(et.trap_Cvar_Get("gamestate"))
local player_team = et.gentity_get(client, "sess.SessionTeam")
if player_guid == nil then
return nil
end
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
else
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
-- Axis > allies si player la axis sau allies > axis si player la axis
if player_team == 1 then
-- player la axis - mut la allies
et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. player_name .. " b")
else
-- player la allies - mut la axis
et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. player_name .. " r")
end
et.G_globalSound( "sound/loudness/teams.wav" )
et.trap_SendServerCommand(-1, "chat \"^1URAAA...^8 FII FERICIT ,^7 " .. player_name .. " ^8SERVERUL TE-A ^1SACRIFICAT ^8SI MUTAT IN SPIRITUL FAIRPLAY-ULUI! ^0DMG ^4FAIRPLAY ^8SCRIPT IN ACTION ... \"")
et.G_globalSound( "sound/loudness/hurrah.wav" )
end
end
return nil
end
is not perfect but teams are always even visualy(number of players) ....and now i need help to make a function or condition...i want to capture in lua the !howfair result...and use in script like condition.... tks..
btw - you must moodify this line for your server ..write anything you want there..and the sound
et.trap_SendServerCommand(-1, "chat \"^1You have been moved ,^7 " .. player_name .. " ^8tks for being fairplay \"") enjoy