Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You can't use "-" in a function name: Respawn-function1() Should be: Respawnfunction1()
  2. Castillo

    Race help

    You can use the "onPlayerWasted" event or "onRacePlayerWasted".
  3. You can try one of these: exports.votemanager:voteMap ( resource1, resource2 ) exports.votemanager:startPoll ( poll )
  4. What do you mean? you can replace aircrafts and boats with this resource.
  5. Go to "race/race_server.lua" and search for: exports.scoreboard:addScoreboardColumn('checkpoint') Then remove it or comment it out with: -- --exports.scoreboard:addScoreboardColumn('checkpoint')
  6. setVehicleColor ( abcvehicle, 0, 0, 0, 0, 0, 0 )
  7. I already sent a PM, but still. Happy Birthday! enjoy it as you deserve it .
  8. 1: https://wiki.multitheftauto.com/wiki/CountPlayersInTeam 2: You can make a table with words, and every time a chat mesage is sent ( onPlayerChat ) you check if the word is on the table.
  9. addEventHandler ( "onClientPlayerWeaponFire", root, function ( ) local x, y, z = getElementPosition ( source ) local lx, ly, lz = getElementPosition ( localPlayer ) local distance = getDistanceBetweenPoints3D ( x, y, z, lx, ly, lz ) outputChatBox ( getPlayerName ( source ) .." fired a weapon at distance: ".. distance ) end ) Test that, I don't know if it'll work.
  10. I think that you can use the weapon fire event plus the function to calculate the distance. onClientPlayerWeaponFire getDistanceBetweenPoints3D
  11. function update() for k, v in ipairs(getElementsByType('player')) do local money = getPlayerMoney(v) setElementData(v,"Money",money ) end for g, v in ipairs(getElementsByType('player')) do local gang = getElementData(v,"spawnedAs") or "N/A" setElementData(v,"Class",gang ) end end setTimer(update, 100, 0) That function is really inefficient, reasons: 1: You are looping twice, that's not required, you can use the same loop for both. 2: You are using a 100 ms timer, that's not efficient at all. About your problem, where's the login part?
  12. Maybe it only works with running resources? Edit: I tried it with a stopped map, returned false, then started the map, and worked.
  13. Are you sure that 'theMap' is a resource element?
  14. function toggleVisible ( ) guiSetVisible ( GUIEditor.window[1] , not guiGetVisible(GUIEditor.window[1]) ) end bindKey( "F1", "down", toggleVisible) Tenias un 'end' de mas.
  15. addEventHandler ( "onPlayerChat", root, function ( msg, msgType ) if ( msgType == 0 ) then local Tag = getPlayerNametagText ( source ) local Team = getPlayerTeam ( source ) local teamName = ( Team and getTeamName ( Team ) or "" ) outputChatBox ( "[".. teamName .."] ".. Tag ..": ".. msg, root, 255, 0, 0, true ) cancelEvent ( true ) end end )
  16. Yeah, I noticed about some typos and fixed them, copy my code again, Pres.
  17. addEventHandler ( "onPlayerChat", root, function ( msg, msgType ) if ( msgType == 0 ) then local Tag = getPlayerNametagText ( source ) local Team = getPlayerTeam ( source ) local teamName = ( Team and getTeamName ( Team ) or "Prestege" ) outputChatBox ( "[".. teamName .."] ".. Tag ..": ".. msg, root, 255, 0, 0, true ) cancelEvent ( true ) end end ) Errors: 1: 'thePlayer' is not defined. 2: 'getPlayerTeam' returns a team element, not it's name. 3: The string at 'outputChatBox' was wrong.
  18. outputChatBox ( "#EE0000 Only army members can drive this car!", thePlayer, 255, 255, 255, true ) I said on the last argument, not a comma and 'true' on the string
  19. Castillo

    judge script

    Yes, that's used to connect both to a own SQLite file or a MySQL server.
  20. Castillo

    judge script

    Well, that's different, you must use the MySQL functions for that.
  21. Castillo

    judge script

    It should only insert once for each map and nick.
  22. Castillo

    judge script

    addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS votes (nick TEXT, map TEXT, vote TEXT)" ) end ) function vote ( p, command, vote ) local nick = getPlayerNametagText ( p ) local mapName = getResourceName ( exports [ "mapmanager" ]:getRunningGamemodeMap ( ) ) local check = executeSQLSelect ( "votes", "*", "nick = '".. tostring ( nick ) .."' AND map = '".. mapName .."'" ) if ( type ( check ) == "table" and #check == 0 ) or not check then executeSQLQuery ( "INSERT INTO votes VALUES (?,?,?)", nick, mapName, vote ) end end addCommandHandler ( "vote", vote ) Try that.
×
×
  • Create New...