Jump to content

joedajoester

Members
  • Posts

    256
  • Joined

  • Last visited

Everything posted by joedajoester

  1. joedajoester

    Easing

    Hi, i am using a gate script and need to add easing and need help with it. https://wiki.multitheftauto.com/wiki/Easing edit*anyone? no one knows how to use this? col = createColTube ( 2919.8000488281, -790.9, 10.300000190735, 15, 15) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. root = getRootElement () lift = createObject ( 968, 2919.8000488281, -790.9, 11.300000190735, 0, -90, 88) -- enter the ID of the object followed by the coordinates -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. function Open ( pla ) if getElementType ( pla ) == "player" then --here you can alter the group from Admin to whatever you require in your server but remember the rest must be the same i.e change everything where it says Admin to your desired group and add the users to that group. if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then moveObject (lift, 1800, 2919.8000488281, -791, 11.300000190735, 0, 90, 0) -- here is where you enter the coordinatess of the new location of the object, 2500 = the speed of the movent. end end end addEventHandler ( "onColShapeHit", col, Open) addEventHandler ( "Open", root, Open) function Close ( pla ) if getElementType ( pla ) == "player" then if vehicle or not vehicle then if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then moveObject (lift, 3500, 2919.8000488281, -790.9, 11.300000190735, 0, -90, 0) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. else return 0 end end end end addEventHandler ( "onColShapeLeave", col, Close ) addEventHandler ( "Close", root, Close)
  2. joedajoester

    offset

    How do i calculate offset for attachElements? https://wiki.multitheftauto.com/wiki/AttachElements
  3. joedajoester

    offset

    Hi, i have a question with offset, for attachelement for offset, you use math, you would subtract the spawn position coordinates from where you want the location to be. Is that right? I need to attach stuff to an andromada. https://wiki.multitheftauto.com/wiki/AttachElements
  4. joedajoester

    Skin

    for this, i need to getElementModel and then set the elementmodel and when unjailed to give back same clothes, so when jailed it changes skin and when unjailed changes the skin to the original the player had. Dont do it for me yet please, tell me where i am going wrong, i need to learn this Also i get no error 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 getElementModel ( thePlayer ) setElementModel ( thePlayer, 4 ) setElementPosition ( thePlayer, 52, 2483, 21 ) takeAllWeapons ( getRootElement() ) 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 unjail yourself!", player, 255, 0, 0, true ) end end addCommandHandler("unjail",Unjail) ped1inside = createPed ( 71, 69, 2503, 17) setElementFrozen (ped1inside, false ) setPedRotation (ped1inside, 180)
  5. How did you have it before, it was perfect?
  6. No, i dont understand how its attaching the same object to each car for the bottom part, i think it has to be like the bottom part where it recreates the object so it can be attached to multiple cars at once
  7. Theres 1 gate attached to each car lol
  8. joedajoester

    huh?

    The spatula script solidsnake14 helped with ALOT(mostly made ) it doesnt attach the objects to the car, it attaches them to 1 car and when i use the command, the second car that spawns with it does not have anything attached to it, i tried even getting the past working script and it still doesnt work.. 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)
  9. Thank you, i put it in the top part were it spawns the cars, and the bottom attaches the objects, silly mistake, and i tried after you posted and i realized my mistake, i tried doing it again, i was close i just put if isobjectinacl that line above if notispedinvehicle and my ends were switched around, its good to learn from your mistakes. thanks you
  10. joedajoester

    staff

    Okay, i tried making this script for staff only, and i get errors, unexpected symbol at ') when i delete that symbol, i get this error, 'end' expected (too close 'function' at line 2) can someone tell me where i am making a mistake? 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 ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then 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 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 addCommandHandler ( "spatula", attach)
  11. Doesnt work, end expected too close 'function' at line 14
  12. I tried this so it outputs chatbox when a non staff tries to use the command. It doesnt work 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 outputChatBox (name..",you cannot use this command!", getRootElement(), 255, 0, 0, true ) 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)
  13. I need this script to work only for staff, i get an error. getPlayerAccount at argument 1 getAccountName at argument 1 And to output a message if a non staff member tries to do it. 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 isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) 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 ) 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, 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)
  14. Oh my god, thank you ALL SOOOOO MUCH! Thank you omg thanks! You guys helped me so much, that im afraid to ask for more help, thinking it might annoy you guys, will it lol thanks!
  15. And also, partial name i tried but it doesnt work. Do you know anything bout that?
  16. I have this script, i need it so if someone is already jailed, they cannot be jailed again, also for unjailing. function Jail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then 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 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) thanks
  17. I have no idea what that means. Sorry, can you explain this or another way. Well, i know what it means, but i never had experience with it.
  18. joedajoester

    Jail

    I have a jail script TAPL helped with and i edited, now i need to disable peoples f1 menu and /wt and /kill. How would i do that and enable that all when theyre unjailed? Also how to make everyone get jailed in random coordinates? function Jail (player, command, name) local thePlayer = getPlayerFromName(name) if thePlayer then setElementPosition ( thePlayer, 3, 4, 20 ) 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 ) outputChatBox (name.." has been unjailed", getRootElement(), 255, 255, 255, true ) end end addCommandHandler("unjail",Unjail)
  19. 1 more thing, how would i make it so is says has been jailed? i tried it but failed... *****EDIT**** i got it Also how would i do unjail? ******EDIT**** Im so happy i did all this! i feel like im gonna get to be a good scripter soon
  20. It works thank you so much
  21. joedajoester

    help

    This script doesnt work, i need to teleportsomeone to the jail when someone types, /jail . function jail (player, command) setElementPosition ( player, thePlayer, 3, 4, 20 ) addCommandHandler ( "jail", jail) end I get no error in console soo this is a tough one ;D
  22. That one was for setting coordinated lol this one is for interiors. Thanks snake:D (Again:D)
  23. I use this script and tried making it put the player in an interior when they enter the marker. s2 = createBlip( -2519, -623, 133, 23) function interior() dutymarker = createMarker(-2519, -623, 131, 'cylinder', 2.0, 255, 0, 0, 150) setElementInterior ( thePlayer, 5) end addEventHandler("onMarkerHit",dutymarker,duty)
×
×
  • Create New...