Jump to content

Leaderboard

Popular Content

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

  1. I am curious if all your trying to accomplish is to have players start with all skills then I think it would be easier to just set the skill levels to 0. http://mygamingtalk.com/wiki/Silent_Mod_Server_Cvar#skill_soldier You then wouldn't need to bother with lua, everyone that joined would automatically have the skill levels. In your server config: set skill_soldier "0 0 0 0" set skill_medic "0 0 0 0" set skill_engineer "0 0 0 0" set skill_fieldops "0 0 0 0" set skill_covertops "0 0 0 0" set skill_battlesense "0 0 0 0" set skill_lightweapons "0 0 0 0" However if you wanted to do this for some newer players that like receiving xp.You are trying to concatenate a string into where you are supposed to be supplying an integer(the client number) Try this: function setskill(playerID) local name = et.gentity_get(playerID,"pers.netname") if isBot(playerID) or noGuid(playerID) then return end 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) et.trap_SendServerCommand(-1,"chat \"^nCongratulations ^7"..name.."^n, ^nyou have ^nbeen ^nEXP! Welcome to MC ! \"") -- et.trap_SendConsoleCommand( et.EXEC_APPEND, "readconfig\n" ) -- Pretty sure you don't need readconfig in this situation end Also you are sending your congratulations message to everyone that is connected. Not sure if this is intended or not, if not replace -1 with playerID Hope that helps, btw if you can check your console log around the time the map is getting loaded it will show if there are any errors when loading your lua. They are usually pretty useful when trying to pinpoint what is wrong.
    2 points
  2. Nachz

    Need help with a lua script.

    Hi all, I'm working on a lua script that would give xp to new player under 1000xp. So they would have all skills. But I can't make it done... I tried 2 ways and both didn't worked well. My lua is based on a other script between. So I have been using this code for when the player spawn: function et_ClientSpawn(clientNum, revived, teamChange, restoreHealth) local valXP = getXP(clientNum) if valXP < noexp then setexp(clientNum) end end The value of noexp is 1000. This is the first thing I tried (fonction setexp): function setexp(playerID) local name = et.gentity_get(playerID,"pers.netname") local silentguid = et.gentity_get(playerID,"sess.guid") if isBot(playerID) or noGuid(playerID) then return end et.trap_SendServerCommand(-1,"chat \"^nCongratulations ^7"..name.."^n, ^nyou have ^nbeen ^nEXP! \"") et.trap_SendConsoleCommand( et.EXEC_APPEND, "givexp "..silentguid.." SOLD 500 \n" ) et.trap_SendConsoleCommand( et.EXEC_APPEND, "givexp "..silentguid.." MED 500 \n" ) et.trap_SendConsoleCommand( et.EXEC_APPEND, "givexp "..silentguid.." ENG 500 \n" ) et.trap_SendConsoleCommand( et.EXEC_APPEND, "givexp "..silentguid.." FOPS 500 \n" ) et.trap_SendConsoleCommand( et.EXEC_APPEND, "givexp "..silentguid.." COV 500 \n" ) et.trap_SendConsoleCommand( et.EXEC_APPEND, "givexp "..silentguid.." LIGHT 500 \n" ) et.trap_SendConsoleCommand( et.EXEC_APPEND, "givexp "..silentguid.." BATTLE 500 \n" ) et.trap_SendConsoleCommand( et.EXEC_APPEND, "readconfig\n" ) end But I realized that the command givexp use the silent ID when I'm using the Silent GUID because I didn't find any function that allow to get the silent ID. Maybe something that would only take the 8 last characters of the silent GUID could give the Silent ID, but I don't know how. (So I didn't got xp, I only seen the message) so then I tried this using the G_AddSkillPoints... function setskill(playerID) local name = et.gentity_get(playerID,"pers.netname") if isBot(playerID) or noGuid(playerID) then return end 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) et.trap_SendServerCommand(-1,"chat \"^nCongratulations ^7"..name.."^n, ^nyou have ^nbeen ^nEXP! Welcome to MC ! \"") et.trap_SendConsoleCommand( et.EXEC_APPEND, "readconfig\n" ) end I think there are something missing, because the lua can get load when I type "/lua_status" I can see it. Thanks for you help Nachz
    1 point
  3. Purple

    Simple lua protection

    We all know there are always going to be some sort of exploit in ET always has always will so for me and my server what i've gone ahead and done just to prevent any way shape or form of guid spoofing mainly is a simple lua file that just whitelists your admin level. --[[ Simple Lua protection by purple ]] function et_InitGame( levelTime, randomSeed, restart ) local SecName = "Simple Sec" et.RegisterModname(SecName) end function et_ClientConnect( clientNum, firstTime, isBot ) local clientIp = et.Info_ValueForKey( et.trap_GetUserinfo(clientNum), "ip" ) local banTime = "300y" -- change this to your ban duration local Reason = "Not Whitelisted." -- change this to your ban reason local adminLevel = "7" -- change this to your Admin level if et.G_shrubbot_level( clientNum ) == adminLevel and clientIp ~= "YOUR IP ADDRESS HERE" then -- put your ip address here. et.trap_SendConsoleCommand( et.EXEC_APPEND, "!ban ".. clientNum.." "..banTime.." "..Reason.." \n" ) --ban the user. end end
    1 point
  4. Nachz

    Need help with a lua script.

    Thanks for the fast answer, I will try it Edit: It worked, thanks you Also to you know how to force the client to downlaod a .pk3 files in the etmain folder. The sv_pure only force the client to download pk3 files in the silent folder. Thanks you again
    1 point
  5. Also, you can get the 8 character id from the sess.guid with substring string.sub(s, i [, j]) http://lua-users.org/wiki/StringLibraryTutorial. The last 8 characters of the sess.guid is the silent id for the command.
    1 point
  6. gaoesa

    Simple lua protection

    For silEnT mod, the mod built admin level protection (http://mygamingtalk.com/wiki/Silent_Mod_Server_Cvar#g_adminProtection) works both reliably and with less inconvenience than this.
    1 point
×
×
  • Create New...