Jump to content

JvIasterMind

Members
  • Posts

    116
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by JvIasterMind

  1. Oh, so you do both the et_ClientCommand() and the et_ConsoleCommand() in the same script and only use the et_ClientCommand() function to set the clientNum? I suppose then you would want to return 0 in the et_ClientCommand() so it doesn't appear to be a valid command to the client? And in your example, shouldn't it be et.trap_Argv(0) instead of et.trap_Argv( 1 )? So the full code would be... [command] command = sayname exec = sayname [1] desc = Say a player's name levels = 2 4 5 clientNum = 0 function et_ClientCommand(num, cmd) if et.trap_Argv(0) == "sayname" then clientNum = num end return 0 end function et_ConsoleCommand(cmd) if et.trap_Argv(0) == "sayname" then if et.trap_Argc() == 2 then local targetSlotNum = et.trap_Argv(1) local targetName = et.gentity_get(targetSlotNum, "pers.netname") et.G_Say(clientNum, et.SAY_ALL, targetName) else et.trap_SendServerCommand(clientNum, 'print "Error: Need two parameters"') end return 1 end return 0 end
  2. I like this idea as well! On our server we use the custom commands for sounds. One time on our server, when a higher ranked player was testing the various sound commands, he accidentally did a !lol command (thinking it was another sound)! And, of course, it was right in the middle of a match!
  3. I understand that part, but can you also get the clientNum of the player that executed the command? Maybe my question is better served with a simple example. Lets say that you want all players with level 2, 4, and 5 to have a command called !sayname. Now, lets define !sayname as a command that does a global chat (from the player that executed the command) of the name of the player in a slot that was passed as a parameter. Here is the code I would start with (following the examples in this thread)... [command] command = sayname exec = sayname [1] desc = bla bla bla levels = 2 4 5 function et_ConsoleCommand(command) if et.trap_Argv(0) == "sayname" then if et.trap_Argc() == 2 then local targetSlotNum = et.trap_Argv(1) local targetName = et.gentity_get(targetSlotNum, "pers.netname") local clientNum = ??? -- How do I get this? et.G_Say(clientNum, et.SAY_ALL, targetName) else -- Error: Need two parameters end return 1 end return 0 end
  4. Quick question: In defining a command like this, how do you get the clientNum that executed the command. Is it just the next unused parameter? So if the exec line was "exec = lua ammo [1]", the clientNum would be in "et.trap_Argv(3)"?
  5. I'd say a flag to change it to the old behavior would be more appropriate, although I doubt I would ever use it. I love the current behavior!
  6. Bump! Would this be possible? I'd like to implement some commands in lua, but we are already at the limit! I'd prefer not to have to remove some of our current commands to make room, but I guess it wouldn't be the end of the world.
  7. Nice! So we can do that already? I'll experiment with it later today!
  8. That sounds like a good idea!
  9. Couldn't the documentation cover the etpro documentation as well as the changes? It would be a lot better if all of it is in one place instead of needing to check both sources independently.
  10. I know about the custom commands already... I was actually asking about the calling a lua function through the exec line like in your example. Is that functionality available currently? I meant if you run the same command as the exec line through rcon, it would have the exact same effect of running the script, correct? I was just wondering how et_ConsoleCommand() worked, since I haven't looked into it yet.
  11. Is there any way you could create a wiki section for the lua api? The documentation for the api is pretty poor, especially when trying to find out what the available fields are in the gentity struct. The best resource I found was looking at etpub's source code directly (and that isn't commented very well). I think it would be a huge benefit to the ET community to have better documentation for this and all in one place. If you do create the section in the wiki, I'd be willing to help populate it with information and add examples as I learn this stuff if you would be willing to give me editing rights.
  12. Your API looks very nice! I just skimmed the file and already learned a lot! For now, though, I am going to start by manually coding so I learn it better. I'll look into it again after I feel more comfortable with the scripting. That is great to know! I know I could have coded something similar myself, but I figure it is better not to reinvent the wheel. I'll play with that command later today. Is that functionality already available, or are you thinking of possibly adding it? Either way, I think that would be great functionality to have because the '/' commands feel kind of awkward in silEnT and seem to be a lot less flexible. Just out of curiosity, I am guessing that et_ConsoleCommand() intercepts rcon commands and server console commands? Would this mean you would be able to also run the Lua script through rcon?
  13. I wasn't clicking on any links. Just typing the url in the address bar or even just clicking on the Google link to your main page was redirecting to that site. Anyways, it seems to be fixed today! Glad it wasn't a major problem!
  14. I am working on teaching myself Lua for modifying ET. So far, it has been going very well, but I ran into a problem that I am having a hard time figuring out. I'm trying to use the following function... clientnum = et.G_ClientNumberFromString( string ) Here is the code that I am using... function et_ClientCommand(clientNum, command) if et.trap_Argv(0) == "listclientnumber" then if et.trap_Argc() == 2 then local targetClientNum = et.G_ClientNumberFromString(et.trap_Argv(1)) et.trap_SendServerCommand(clientNum, string.format("cpm \"%d\"", targetClientNum)) else et.trap_SendServerCommand(clientNum, "cpm \"Error: Need two arguments!\"") end return 1 end return 0 end When I execute the command to run the above code (e.g. "/listclientnumber JvI" in my game console), ET gives an unknown command error due to the G_ClientNumberFromString line. Even if I manually put a string instead of using the argument for the parameter, I still have this problem. If I remove that line and modify the line below it to just print text, it works exactly as intended. The client number function was directly from the lua.html that's located in the silent zip archive. Am I using it incorrectly, or is the documentation possibly out of date? My second question is what is the best way to print text to a clients console? I noticed cpm acts just like echo and also flashes the text on the left side of the main screen. I'd prefer if there was a way of only printing to the console instead so my custom command behaves closer to the built in admin commands. For my last question, is there any way to define standard admin commands that start with '!' instead of the console commands that start with '/' through Lua. I know you can map the admin commands to the console commands, but then I need to restrict the level in the script as well as the shrubbot.cfg file to prevent everyone from using it. Or perhaps there is another way to do this? Thanks, JvIasterMind
  15. If I go to mygamingtalk.com in my iPhone, sometimes it redirects to the following address... https://presskit.lodestargame.com/?src=rickroll.jpg&n=s It seems to only happens on mygamingtalk.com and not mygamingtalk.com/forums/ and only in the mobile version of the site. On my computer it behaves as expected. When it redirects, Google Chrome displays a message saying "This is probably not the site you are looking for!"
  16. Alright, thanks for the information and example scripts! I'll see if I can implement this and when I finish I'll post it on the forums!
  17. Thanks for the reply! I agree that players should have the option of the alias changing at least over time. That was a problem with ETPub's aka info because it could get out of date easily with a player changing their name "permanently". On our server, offensive nicknames and people faking other players names is not a common problem, but I do see your point about players being able to hide short-lived bad names. A possible solution to the second problem you mentioned could be to keep the names that have the longest continuous playtime duration instead of total playtime. This would be a lot easier for a new name to be able to get into the database. It also seems like it would be easier to implement. If we go the route of using a high value for g_dbMaxAliases, what range of values would you say are safe numbers? Also, if we needed to change the value of the cvar in the future due to the database getting too big or not enough names being stored, I assume that it is easier to increase the value than to decrease it? If we do decrease it, does silEnT remove all the older names that are already stored above the limit? Would it do that all at once (making the database smaller right away) or as each player connects to the server? That's interesting that Lua would be able to handle something like that. I haven't really looked into the language much and didn't realize it's that powerful! I may give that a shot to make a temporary command to hold us over until you possibly add in that option to change the removal behavior of the database. To store such information, does Lua have some sort of SQLite database or something that I would use? Or is there a much better or easier way?
  18. Interesting! Just had a clan member recently ask about the same thing. Is there any way to have multiple versions of the menu that show based on the server cvars? Could even just a couple versions reflecting the more common setups. On a side note, I wonder if many people actually use that menu. Perhaps it wouldn't be missed much if it was removed from the mod (or disabled if the server isn't using the shown weapon setup)?
  19. Thanks for the answer! We use that cvar, but we like having the limit be high enough that most players can switch names if they want (I think our limit is 10 or so). Would you guys consider changing this behavior? Or would it be too difficult now that it is already released? When we were running ETPub, the main thing we used the aka name for was so that admins and certain members could figure out who a player is that is using an unknown name. How it worked in Pub was that it stored the name used at the moment of the !setlevel command. This was very helpful because the aka always told us who the disguised player really was. I believe if the database removed the names that were used the least amount of time, it would accomplish the same thing (as the names that they play under the longest are generally ones that would easily identify them). This would also have the added bonus that if a player decides to switch their standard name and/or colors for a long period, the database would adapt and the alias info would more or less stay up to date. Another way that could accomplish a similar behavior would be to add an admin command that could store a permanent version of the players name along with the current behavior (or do it on !setlevel - although it would be really nice to be able to change it without setting a new level). Maybe keep the permanent alias at the top of the list when you use the !aliases command. Would this be easier to implement since it only requires an extra field in the database? As it is currently, it seems like we would need to set the limit to a very high value to ensure that a known name shows up in the list. This is especially true if the targeted player is one that uses a lot of different names with many being short-lived.
  20. Thanks for adding this feature! It'll definitely be quite helpful for keeping track of players on the server! However, I have a question about how this database makes room for new names... The feature was proposed as dropping the least used names to make room... However, the wiki says... Does it drop the oldest aliases or the least used aliases in the released version? If it does just drop the oldest aliases and the limit is set to 3, someone could just change their names multiple times in a row and all of the stored aliases wouldn't be of much value. Dropping the least used aliases seems like it would be more useful. Also, I have seen people use name changing scripts that actually cycle through the names by changing it each time. If someone has a longer version of that type of script, it could eat through the stored names very quickly.
  21. Yep, exactly! I realize engineers are targeted far more often than the other classes, but if you numbered them similar to revive sprees with lower numbers such as 3, 5, and 10, I think you would get a few of them every once in a while. I know there has been a few times where I got on a roll and was able to complete a few objectives in a row before dying. Also, I see a lot of people asking who planted (or similar questions) at the end of maps. If the engy was getting recognition through a spree messages in game, more people will realize how valuable that player was for the team on that map. I like this proposal as well! Nothing wrong with a few more extra stats at the end of the map!
  22. That makes perfect sense. I think the one who finishes it does deserve the credit. Also, this way the message would make more sense if its along the lines of "<Player X> completed <number> objectives!". You couldn't really say completed if the players that had the most xp didn't actually finish the objective themselves. Plus, with this method, you wouldn't even need to take into account the g_constructibleXPSharing value.
  23. My other thread got me thinking some more on sprees in general. I really like the option to have revive sprees because I think it really helps to encourage teamplay for medics instead of them just going for kills. I think it would be awesome if we could have a similar spree for engineers building and destroying objectives. This way engineers could get a bit of recognition if they are doing a great job, and maybe it would also encourage more players to be engineer. One decision that would need to be made would be whether or not to count partial objectives (with g_constructibleXPSharing enabled) towards the spree. In my opinion, I think that the person that completed the biggest share of the objective should be awarded and not the other player's that only contributed a little. That way, only one player would get awarded towards a spree for each objective.
  24. I think the revive sprees help encourage more teamwork oriented play because you get recognized for something other than kills. If you are reviving almost dead teammates, that likely means you are doing your job as a medic. It is nice to be rewarded for this. Otherwise, you are better off just letting your teammate die completely before reviving if you want a high spree value. I think the same is true even with the kill/revive, since you are probably doing a good job as a medic if you are getting lots of revives that way. Revive spree ending on a teamkill is definitely an interesting idea. My vote would be to implement both as options. If you have both options enabled for awarding reviving sprees for the needle to almost dead teammates and stopping the spree on a teamkill, you further encourage people to use the g_medics 64 option over the tk/revive cycle. Another added benefit is that there would then be risk for players that try to teamdamage and needle over giving medpacks. If you would accidently deal to much damage, your spree would end anyways, so it would be less worth the risk. So, having both options may help to alleviate Chuckun's concern.
  25. I was going to try to make a new script for an enemy spawntimer, and I discovered that timerset is unable to receive the number from a variable. Here is some of my code that I tried during testing... set value "11" timerset "vstr value" Is this intended behavior? I tried a bunch of other commands, and they all seemed to take variables as the value just fine.
×
×
  • Create New...