Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Read his main post again: I think he want's a function to get the elements near to him ( I think all types ).
  2. Castillo

    Help please..

    I can't help you if you don't tell me the error.
  3. Castillo

    Help please..

    I didn't meant where it printed that error, I meant IN WHICH FUNCTION. P.S: You're creating a marker with size 80, that's really big.
  4. Castillo

    Help please..

    Where's the bad argument? which line? what function?
  5. Castillo

    Help please..

    Me = getLocalPlayer() local screenWidth, screenHeight = guiGetScreenSize() function Main () marker1 = createMarker(3236.3000488281, -266.20001220703, 16, "corona", 80, 0, 0, 0, 0) addEventHandler ( "onClientMarkerHit", getRootElement(), MainFunction ) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), Main ) function MainFunction ( hitPlayer, matchingDimension ) local vehicle = getPedOccupiedVehicle ( hitPlayer ) if (hitPlayer ~= Me) then return end if source == marker1 then setElementVelocity(vehicle, 0.0, 0.2, 2) end end P.S: This should go in the "Scripting" section.
  6. As far as I remember with the key "U".
  7. Yeah, the error in the script couldn't cause that. Does it say why it can't parse?
  8. Slothman zombies resource has a exported function: createZombie ( x, y, z, rot, skin, interior, dimension ) You can use this resource: https://community.multitheftauto.com/index.php?p= ... ls&id=1604 To add more health to the zombie.
  9. Castillo

    how to...

    True, use this: function adminChat( thePlayer,_,... ) local text = table.concat( {...}, " " ) local name = getPlayerName( thePlayer ) for _,v in pairs( getPlayersInGroup( accName ) ) do outputChatBox ("#FF0000(Admin Chat) "..tostring( name )..": #FFFFFF"..tostring( text ), v, 255, 255, 255, true) end end addCommandHandler("ac", adminChat) function getPlayersInGroup( accName ) local Table = { } for _,v in pairs( getElementsByType( "player" ) ) do local accName = getAccountName ( getPlayerAccount ( v ) ) if isObjectInACLGroup ( "user." .. tostring( accName ), aclGetGroup( "Admin" ) ) or isObjectInACLGroup ( "user." .. tostring( accName ), aclGetGroup ( "SuperModerator" ) ) or isObjectInACLGroup ( "user." .. tostring( accName ), aclGetGroup ( "Moderator" ) ) then table.insert( Table,v ) end end return Table end
  10. Because the resource has a different script to output the message (really stupid).
  11. You can also try this: addEventHandler("onPlayerJoin",root, function () bindKey(source, "y", "down", "chatbox", "Faction Chat") end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player, "y", "down", "chatbox", "FactionChat") end end) function factionChat(player,cmd,...) local message = table.concat ( {...}, " " ) if(message ~= nil or message ~= "") then local FRank = tonumber(destinyGetData (player,"rang")) local ranktitle = "" if destinyGetData(player,"fraktion") == 1 then if FRank == 0 then ranktitle = "Constable" end if FRank == 1 then ranktitle = "Captian" end if FRank == 2 then ranktitle = "Marshall" end if FRank == 3 then ranktitle = "Commander" end if FRank == 4 then ranktitle = "Bureau Chief" end if FRank == 5 then ranktitle = "Chief of Department" end red = 0 green = 0 blue = 205 else triggerClientEvent ( player, "infobox", getRootElement(), "Du bist in keiner Fraktion!", 5000, 155, 0, 0 ) end local name = getPlayerName(player) for playeritem, index in pairs(fraktionsMemb[destinyGetData(player,"fraktion")]) do outputChatBox ( "[[ "..ranktitle.." | "..tostring(name)..": "..tostring(message).." ]]", playeritem, red, green, blue ) end end end addCommandHandler("FactionChat",factionChat) To see if it works with your faction system.
  12. addEventHandler("onPlayerJoin",root, function () bindKey(source, "y", "down", "chatbox", "Faction Chat") end) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player, "y", "down", "chatbox", "FactionChat") end end) function factionChat(player,cmd,...) local message = table.concat ( {...}, " " ) if(message ~= nil or message ~= "") then local name = getPlayerName(player) outputChatBox(tostring(name) ..": ".. tostring(message)) end end addCommandHandler("FactionChat",factionChat) This will overwrite the "Team say" with "FactionChat".
  13. Change the code from "teamspawn.lua" with this: local teamsTable = { [ "Police" ] = { 1553.0385742188 , -1675.7225341797 , 16.1953125 } , [ "Robber" ] = { 2249.8801269531 , -1908.4437255859 , 13.546875 } , [ "Mechanics" ] = { 1011.7614746094 , -1005.9530639648 , 32.1015625 } , [ "Whores" ] = { 1833.8845214844 , -1682.6907958984 , 13.454662322998 } , [ "Pilot" ] = { 2001.0803222656 , -2366.482910563 , 13.546875 } , [ "Trucker" ] = { -83.053352355957 , -1136.3688964844 , 1.078125 } } addEvent ( "onPlayerChooseTeam" , true ) addEventHandler ( "onPlayerChooseTeam" , root , function ( teamName ) local team = getTeamFromName ( teamName ) local account = getPlayerAccount(source) local accountName = getAccountName(account) if isObjectInACLGroup ( "user."..tostring(accountName), aclGetGroup ( teamName ) ) then setPlayerTeam ( source, team ) local spawnX, spawnY, spawnZ = unpack ( teamsTable [ teamName ] ) spawnPlayer ( source, spawnX, spawnY, spawnZ ) else outputChatBox ( "Your not in this team",source) end end )
  14. Do you mind explaining what are you trying to achieve?
  15. Castillo

    how to...

    My bad, I forgot to change something, copy it again.
  16. Yes, sorry, I used the wrong colshape . gateCol = createColTube(275.57169, 190.07436, 1006.17188, 2, 2.5) setElementInterior(gateCol, 3) gate = createObject(974, 277.03125, 189.408203125, 1007.171875) setElementInterior(gate, 3) addEventHandler("onColShapeHit",gateCol, function (hitElement) moveObject(gate, 3000, 280.03125, 189.408203125, 1007.171875) setTimer(moveObject,6000,1,gate,3000,277.03125, 189.408203125, 1007.171875) end) Now it works.
  17. It works perfectly, BUT you must be in a TEAM.
  18. Castillo

    how to...

    function adminChat(thePlayer,_,...) local text = table.concat({...}, " ") local name = getPlayerName(thePlayer) local accName = getAccountName (getPlayerAccount (thePlayer)) if ( isObjectInACLGroup ("user.".. accName, aclGetGroup("Admin")) or isObjectInACLGroup ("user." .. accName, aclGetGroup ("SuperModerator")) or isObjectInACLGroup ("user." .. accName, aclGetGroup ("Moderator")) ) then for index, player in ipairs(getElementsByType("player")) do local accName = getAccountName (getPlayerAccount (player)) if ( isObjectInACLGroup ("user." .. accName, aclGetGroup("Admin")) or isObjectInACLGroup ("user." .. accName, aclGetGroup ("SuperModerator")) or isObjectInACLGroup ("user." .. accName, aclGetGroup ("Moderator")) ) then outputChatBox ("#FF0000(Admin Chat) "..tostring(name)..": #FFFFFF"..tostring(text), player, 255, 255, 255, true) end end end end addCommandHandler("ac", adminChat)
  19. Woops, my bad, thanks for seeing that JR10 .
  20. Castillo

    how to...

    Post your code, how do you expect us to help you if you don't.
  21. You want to make a player walk or a ped? for peds: https://wiki.multitheftauto.com/wiki/SetPedControlState for players: https://wiki.multitheftauto.com/wiki/SetControlState
  22. Can you show us how you trigger the "onPlayerChooseTeam" event? addEvent ( "onPlayerChooseTeam" , true ) addEventHandler ( "onPlayerChooseTeam" , root , function ( teamName ) local team = getTeamFromName ( teamName ) local account = getPlayerAccount(source) local accountName = getAccountName(account) if isObjectInACLGroup ( "user."..tostring(accountName), aclGetGroup ( teamName ) ) then setPlayerTeam ( source, team ) outputChatBox("You have successfully been moved to "..getTeamName(team).." Team.", source, root, 0, 255, 0) else outputChatBox ( "Your not in this team",source) end end)
  23. hedit by Remi-X: https://community.multitheftauto.com/index.php?p= ... ls&id=3482 Puma Markers by Puma: https://community.multitheftauto.com/index.php?p= ... ls&id=3495 Vote maps by li7il: https://community.multitheftauto.com/index.php?p= ... ls&id=3493 Flood by Callum: https://community.multitheftauto.com/index.php?p= ... ls&id=3483
  24. local pollDidStart = exports.votemanager:startPoll { title='My question', percentage=65, timeout=10, allowchange=true, visibleTo=getRootElement(), [1]={'Answer 1'}, [2]={'Answer 2'}, }
×
×
  • Create New...