Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    staff

    addEventHandler ( "onResourceStart", resourceRoot, function () local gate1 = createObject(971, 0, 0, 5) local gate2 = createObject(971, 0, 0, 5) local Car1 = createVehicle ( 567, -1736, -2895, 55, 0, 0, 236 ) local Car2 = createVehicle ( 567, -1744, -2913.3000488281, 55, 0, 354.488, 220 ) attachElements( gate1, Car1, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( gate2, Car1, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( Car1, 1087 ) addVehicleUpgrade ( Car2, 1087 ) end) function attach(thePlayer) if not isPedInVehicle(thePlayer) then return end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then local vehicle = getPedOccupiedVehicle(thePlayer) local car1gate1 = createObject(971, 0, 0, 5) local car1gate2 = createObject(971, 0, 0, 5) attachElements( car1gate1, vehicle, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( car1gate2, vehicle, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( vehicle, 1087 ) end end addCommandHandler ( "spatula", attach) You can't check onResourceStart if is admin, that makes no sense.
  2. I doubt that's a gate that can be opened, you can try opening all gates and see if it opens too. for i=0, 49 do setGarageOpen(i, true) end
  3. Are you even using the script as you should? it has exported functions, you must use them with another resource.
  4. Well, as you may know, scripting takes time, the scripter's time, he could be doing something else.
  5. You can't do that, you must create your own. I suggest you to take a look at the DX drawing functions. https://wiki.multitheftauto.com/wiki/DxDrawText
  6. That won't work, Dev-Point.
  7. set element data when you jail the player and then check it when they try to suicide.
  8. I just tested the script and works perfectly, I got moved to the red team. "You've been moved to the red team!"
  9. teamRed = createTeam ( "Red", 255, 0, 0 ) teamBlue = createTeam ( "Blue", 0, 0, 255 ) function balanceTeams ( ) local RedCount = countPlayersInTeam ( teamBlue ) local BlueCount = countPlayersInTeam ( teamRed ) if RedCount ~= BlueCount then if RedCount > BlueCount then setPlayerTeam ( source , teamBlue ) elseif RedCount < BlueCount then setPlayerTeam ( source , teamRed ) end outputChatBox ( "You've been moved to the "..getTeamName ( getPlayerTeam ( source ) ):lower ( ).." team!", source ) outputChatBox ( "teamBlue: ".. tostring ( teamBlue ).. "; teamRed: ".. tostring ( teamRed) ) -- You had ouputChatBox end end addEventHandler ( "onPlayerJoin", getRootElement ( ), balanceTeams )
  10. function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 16.3 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) else outputChatBox ("You cannot use this command!", player, 255, 0, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setElementFrozen (ped1inside, false ) setPedRotation (ped1inside, 180)
  11. function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then local thePlayer = getPlayerFromPartOfName(name) if not thePlayer then return end if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 16.3 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setElementFrozen (ped1inside, false ) setPedRotation (ped1inside, 180)
  12. Castillo

    Jail

    function getPlayerFromPartOfName(playerPart) local pl = getPlayerFromName(playerPart) if isElement(pl) then return pl else for i,v in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(v),playerPart)) then return v end end end end function Jail (player, command, name) local thePlayer = getPlayerFromPartOfName(name) if thePlayer then if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) toggleAllControls ( thePlayer, false ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) local thePlayer = getPlayerFromPartOfName(name) if thePlayer then if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 17 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) toggleAllControls ( thePlayer, true ) end end addCommandHandler("unjail",Unjail)
  13. Castillo

    Jail

    function Jail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then if getElementData( thePlayer, "isJailed") then outputChatBox("This player is already in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 52, 2483, 21 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 0, 0, true ) toggleAllControls ( thePlayer, false ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then if not getElementData( thePlayer, "isJailed") then outputChatBox("This player is not in jail.",player,255,0,0) return end setElementPosition ( thePlayer, 72, 2484, 17 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed. Be good now, "..name, getRootElement(), 0, 255, 0, true ) toggleAllControls ( thePlayer, true ) end end addCommandHandler("unjail",Unjail) Should work.
  14. Castillo

    Jail

    function Jail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then setElementPosition ( thePlayer, 3, 4, 20 ) setElementData ( thePlayer, "isJailed", true ) outputChatBox (name.." has been jailed", getRootElement(), 255, 255, 255, true ) end end addCommandHandler("jail",Jail) function Unjail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then setElementPosition ( thePlayer, 3, 4, 20 ) setElementData ( thePlayer, "isJailed", false ) outputChatBox (name.." has been unjailed", getRootElement(), 255, 255, 255, true ) end end addCommandHandler("unjail",Unjail) Then in your script you check the "isJailed" element data.
  15. Castillo

    Jail

    I suggest setting a element data to the player and then check it when they type /kill and try to open F1.
  16. vehicle1 = createVehicle ( 490, 1474.3525390625, 2836.5068359375, 10.8203125 ) function enterVehicle ( thePlayer, seat, jacked ) if ( source == vehicle1 ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "Admin" ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "Admin vehicle", thePlayer ) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle )
  17. Heat Seeking also explodes before reach it's target?
  18. s2 = createBlip( -2519, -623, 133, 23) dutymarker = createMarker(-2519, -623, 131, 'cylinder', 2.0, 255, 0, 0, 150) function interior(thePlayer) setElementInterior ( thePlayer, 5) end addEventHandler("onMarkerHit",dutymarker,interior)
×
×
  • Create New...