Jump to content

sckatchof

Members
  • Posts

    394
  • Joined

  • Last visited

Everything posted by sckatchof

  1. You can't. Read this: https://wiki.multitheftauto.com/wiki/SetVehicleColor
  2. Use this : vehicle1 = createVehicle ( ID, X, Y, Z, Rx, Ry, Rz ) setVehicleColor ( vehicle1, getColorFromString("#FF0000") )
  3. it's work , thanks snake again and sorry for your trouble with me
  4. sckatchof

    need help

    hello, I make a script to reaper cars but i have some errors. i want just for team Army for free function repairArmy() rparmy = createMarker ( 137.19999694824, 1762.6999511719, -29.39999961853, "cylinder", 2.5, 255, 255, 255, 75 ) addEventHandler ( "onMarkerHit", rparmy , onOneHit ) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), repairArmy) function armyHit ( player ) if source == rparmy then local vehicle = getPlayerOccupiedVehicle ( player ) if vehicle then fixVehicle ( vehicle ) outputChatBox ( "Your vehicle was fixed!", player, 0, 255, 0 ) else outputChatBox ( "You need to be in a vehicle", player, 255, 0, 0 ) end end end
  5. sckatchof

    code!

    @snake sorry for replying but i want to help him
  6. sckatchof

    code!

    try this : gate = createObject(969, 209.69999694824, 1875.5, 12.39999961853, 0, 0, 0) function moveGate() moveObject(gate, 3000, 210.10000610352, 1875.5999755859, 8.8999996185303) setTimer(moveObject, 6000, 1, gate,3000, 210.10000610352, 1875.5999755859, 8.8999996185303) end addCommandHandler("open", moveGate)
  7. sckatchof

    code!

    i think that should be work try this function onStartup () myMarker = createMarker( 207.69999694824, 1875.5, 12.39999961853, 'corona', 15.0, 0, 0, 255, 0) gate1 = createObject (969, 209.69999694824, 1875.5, 12.39999961853, 0, 0, 0) addEventHandler( "onMarkerHit", myMarker, MarkerHit1 ) addEventHandler( "onMarkerLeave", myMarker, MarkerLeave1 ) end function MarkerHit1(thePlayer, hitElement, matchingDimension ) moveObject ( gate1, 2000, 210.10000610352, 1875.5999755859, 8.8999996185303) end function MarkerLeave1( leaveElement, matchingDimension ) moveObject ( gate1, 2000, 209.69999694824, 1875.5, 12.39999961853) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStartup)
  8. The gate move its work thanks but there is some errors in cosole
  9. I am in the 'Police' team !!
  10. The gate move its work thanks but there is some errors in cosole
  11. hello, why this code does not work ! WARNIG: TNS/Police/gate.lua:5: bad 'player' pointer @ 'getplayerteam'<1> WARNIG: TNS/Police/gate.lua:11: bad argument @ ''getplayerteam' local MarkerPolice = createMarker( 1588.4000244141, -1637, 11.39999961853, 'corona', 12.0, 0, 0, 255, 0) local Policegate1 = createObject(980, 1590.1999511719, -1638.4000244141, 15.199999809265, 0, 0, 0) function MarkerHit1 ( hitElement, matchingDimension ) if ( getPlayerTeam(hitElement) and getPlayerTeam(hitElement) == getTeamFromName("Police") ) then moveObject(Policegate1, 2000, 1598.1999511719, -1638.4000244141, 15.199999809265 ) end end function MarkerLeave1( leaveElement, matchingDimension ) if ( getPlayerTeam(leaveElement) and getPlayerTeam(leaveElement) == getTeamFromName("Police") ) then moveObject(Policegate1, 2000, 1590.1999511719, -1638.4000244141, 15.199999809265 ) end end addEventHandler( "onMarkerHit", MarkerPolice, MarkerHit1 ) addEventHandler( "onMarkerLeave", MarkerPolice, MarkerLeave1 )
  12. Thank you for help it fixed
  13. thnx snake for ur help but when the vehicle enter the cylinder, it comes to another cylinder and it fliped
  14. I cannot enter to marker not vehicles or on the legs (sorry for english). There are no errors
  15. i try many but does not work Like this ?! local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if getElementType(hitPlayer) == "vehicle" then if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if getElementType(hitPlayer) == "vehicle" then if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end addEventHandler( "onMarkerHit", Carlde5el, Sortie )
  16. i work but i mean just vehicles can enter. Then as TAPL said, use this, if getElementType(hitPlayer) == "vehicle" then Ok thnxx i will try
  17. it work but i mean just vehicles can enter.
  18. hi all i need same , i want just vehicle entry to the marker ! local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) function Entrer( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) else outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer ) end end addEventHandler( "onMarkerHit", Carlbara, Entrer ) function Sortie( hitPlayer, matchingDimension ) local team = getPlayerTeam(hitPlayer) if (not team) then return end if (getTeamName(team) == "Army") then setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) end end addEventHandler( "onMarkerHit", Carlde5el, Sortie )
  19. thnx for help . but when i get near the gate opens but when I leave the region does not close the gate ! WARNIG: TNS/Police/gate.lua:5: bad 'player' pointer @ 'getplayerteam'<1> WARNIG: TNS/Police/gate.lua:11: bad argument @ ''getplayerteam'
  20. I make ather script with teams and i have many gate !! teampolice = createTeam ( "Police", 0, 50, 255 ) teampolice = createTeam ( "Criminal", 0, 50, 255 )
  21. hi all i some help again in server consol WARNIG: TNS/Police/gate/gate.lua:11: bad 'player' pointer @ getplayer team' <1> local MarkerPolice = createMarker( 1588.4000244141, -1637, 11.39999961853, 'corona', 12.0, 0, 0, 255, 0) local Policegate1 = createObject(980, 1590.1999511719, -1638.4000244141, 15.199999809265, 0, 0, 0) function MarkerHit1 ( hitElement, matchingDimension ) if getPlayerTeam(hitElement) == teampolice then moveObject(Policegate1, 2000, 1598.1999511719, -1638.4000244141, 15.199999809265 ) end end function MarkerLeave1( leaveElement, matchingDimension ) if getPlayerTeam(leaveElement) == teampolice then moveObject(Policegate1, 2000, 1590.1999511719, -1638.4000244141, 15.199999809265 ) end end addEventHandler( "onMarkerHit", MarkerPolice, MarkerHit1 ) addEventHandler( "onMarkerLeave", MarkerPolice, MarkerLeave1 )
  22. thnnnnxx for ur help , it's work
×
×
  • Create New...