Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. Sorry for the bump I was curious if the source code to this software could be released? This is just a thought (not 100% sure ofcourse, if you have MTA 1.4) MTA:SE might still be written for the MTA 1.3 directory when you have the 1.4 files.
  2. xXMADEXx

    [Q] Network

    Not sure if it's useful to you, but there is also getNetworkUsageData.
  3. cancelEvent doesn't work for onPlayerJoin: https://wiki.multitheftauto.com/wiki/OnPlayerJoin -- There isn't a cancel effect. Make sure the script has access to function.kickPlayer in the ACL.
  4. xXMADEXx

    Questions

    There isn't a client side for this part. You need to go into scoreboard/dxscoreboard_client.lua and add another "elseif ( column.name = ... ) then .... end"
  5. Uhm, those functions would be better to round to an integer, but actually there is a function called that someone wrote. https://wiki.multitheftauto.com/wiki/ConvertNumber incase you need it
  6. Wasn't suppose to be. Thanks.
  7. You could also do something like this, using the eventName pre-defined variable. function justatest ( ) local text; if ( eventName == "onClientResourceStart" ) then text = "This is just a test!"; end if ( text ) then outputChatBox ( tostring ( text ) ) end end addEventHandler('onClientResourceStart', resourceRoot, justatest )
  8. Hey guys. Today I was bored so I made a little script like our good old friend Gate Maker, but instead of having to use commands to build the gates, I made an interface to add, remove and preview gates. The script can use MySQL to save the gates, but it's default setup for SQLite. I made it very easy to enable MySQL, all you have to do is change the settings in the meta. If the script fails to connect to the MySQL server, it will just connect to SQLite. The script also has a self-update checker, so you won't need to keep checking the community for updates. Download: https://community.multitheftauto.com/index.php?p= ... ls&id=9963 Images: Enjoy.
  9. That function is a bit buggy. You need to use the client function setElementCollidableWith.
  10. You could use setElementData in the onPlayerLogin event. You can set the group for example "AccountName" and then the value equal to their account name, then on the client side you can use getElementDatato get their account name.
  11. I don't understand why you would put a while loop in the getOnlineAdmins ( ) function. It's completely useless... Try using this code: function isPlayerInACL ( player, acl ) local account = getPlayerAccount ( player ) if ( isGuestAccount ( account ) ) then return false end return isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup ( acl ) ) end addCommandHandler ( "staffchat", function ( p, _, ... ) if ( not isPlayerInACL ( p, "Admin" ) ) then return end local msg = string.lower ( tostring ( table.concat ( { ... }, " " ) ) ):gsub ( "#%x%x%x%x%x%x", "" ) if ( msg:gsub ( " ", "" ) == "" ) then return end for i, v in pairs ( getElemetnsByType ( "player" ) ) do if ( isPlayerInACL ( v, "Admin" ) ) then outputChatBox ( "(Staff) "..getPlayerName ( p )..": #ffffff"..msg, v, 0, 255, 0 ) end end end )
  12. Method 1 (which i recommend) would be to put all of the file names into a table, and loop the table to check if the file exists. Another method (not sure if it would work) would be to use scanDir in the FileSystem module.
  13. Try just adding tostring to the script.
  14. Actually that code is what you want, although it's a bit sloppy. Try using this, it should work. addEventHandler ( "onPlayerChat", root, function ( message ) for i=1, string.len ( message ) do local n = message:sub ( i, i ) if ( n:byte ( ) < 32 or n:byte ( ) > 127 ) then cancelEvent ( ) outputChatBox ( "English characters only...", source, 255, 0, 0 ) return; end end end ) In The Netherlands ( so Dutch ) we also use English letters... it's quite hard to actually make a script like that haha! Well yes, a lot of Spanish does too. I actually don't think you can fully block other languages unless well you want to write an English dictionary in a table lol. I could be wrong though.
  15. Actually that code is what you want, although it's a bit sloppy. Try using this, it should work. addEventHandler ( "onPlayerChat", root, function ( message ) for i=1, string.len ( message ) do local n = message:sub ( i, i ) if ( n:byte ( ) < 32 or n:byte ( ) > 127 ) then cancelEvent ( ) outputChatBox ( "English characters only...", source, 255, 0, 0 ) return; end end end )
  16. Yes, I have noticed that with new scripters, lol. I'll go back later and add a "Table Efficiency" section
  17. Can you please post the following functions: checkMySQLTable commandSystemMySQLInit likeSystemDatabaseInit Thanks.
  18. try this function getPlayerPoints ( player, cmd, target ) if ( saveMethod == "database" ) then local target = getPlayerFromName ( tostring ( target ) ) if ( target ) then local serial = getPlayerSerial ( target ) local points = executeSQLSelect ( "Punktesystem", "points","serial = '" .. serial .. "'") outputChatBox ( tostring ( points[1].points ), target, 255, 0, 0, true ) if ( points ) then return tonumber ( points [ 1 ] [ "points" ] ) else outputDebugString ( "Pointsystem - getPlayerPoints (Db Problem" ) end else outputChatBox ( "Error: /getp [player name]", player, 255, 0, 0 ) end end end addCommandHandler ( "getp", getPlayerPoints )
×
×
  • Create New...