Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. But I already added the event handler attached to the random marker created, just after createMarker you can see: addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit )
  2. Could be the game mode you are using, that is messing around with it.
  3. That won't work. @Zombie: You can't use "-" character while defining a variable, like here: "NRG-500".
  4. I really don't get anything of what you said.
  5. Try to do it, and if it doesn't work, post your script and I'll help you.
  6. I haven't got any error here, it works fine.
  7. local pickups = { [1]={ 2060.7685546875, -1941.1181640625, 13.14103603363 }, [2]={ 2114.5068359375, -1611.302734375, 13.167269706726 }, [3]={ 1932.9521484375, -1776.1259765625, 13.16081237793 }, [4]={ 1057.41796875, -1568.4853515625, 13.166387557983 } } local dropoffs = { [1]={ 1965.54296875 , -1883.013671875, 13.160305023193 }, [2]={ 1467.3916015625, -1736.419921875, 13.242918014526 }, [3]={ 2376.1064453125, -1728.4091796875, 13.162055015564 }, [4]={ 1066.5029296875, -1200.86328125, 18.405519485474 } } local pedCus = { 9, 10, 14, 15, 37 } Team = createTeam("Taxi Driver", 0, 255, 0) busTeams = { [Team] = true } busVehs = { [420] = true } function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if ( busVehs[getElementModel ( source )] ) and ( not busTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin removePedFromVehicle( thePlayer )-- force the player out of the vehicle outputChatBox("Only Taxi Drivers can drive this vehicle!", thePlayer) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) markers = { } blip = { } peds = { } function inVEH(thePlayer) if isPedInVehicle ( thePlayer ) then if ( getElementModel ( source ) == 420 ) then local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 3.5, 255, 0, 0 ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) local skin = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skin, x, y, z ) blip [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) else if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end end end end addEventHandler("onVehicleEnter", getRootElement(), inVEH) function warpit ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( getElementModel ( vehicle ) == 420 ) then if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end warpPedIntoVehicle ( peds [ thePlayer ], vehicle, 2 ) end end end
  8. Post the full script ( don't use spoiler, it annoys me ).
  9. Castillo

    Maletero

    Si tenes experiencia en MySQL, entonces como es que no sabes como guardar?
  10. I don't really understand what do you want. addEventHandler ( "onMarkerHit", markers, warpit ) should be after the marker is created, but with the player index, like: markers [ player ]
  11. Here it works. Try this another one: http://pastebin.com/rM4yC83S
  12. That's a for-loop, used to loop all items in the "numberOfIndex" table.
  13. Castillo

    Maletero

    Tenes experiencia basica en Lua y MySQL/SQLite?
  14. There's no table called "john".
  15. onClientGUIClick triggerServerEvent addEvent addEventHandler getElementPosition createVehicle warpPedIntoVehicle That's all you need to do it.
  16. Start by learning Lua: viewtopic.php?f=148&t=40809
  17. http://pastebin.com/b6Z4iGUy Try it.
  18. Yes, but it won't make any difference, in fact, it'll be longer script.
  19. MTA Script Editor is just one program you can use, I personally prefer notepad++
  20. Yes, I noticed why, I forgot to return the values, replace the last function ( getRandomZombieSpeed ) with this: function getRandomZombieSpeed ( ) local ZombieSpeed = math.random( 1, 3 ) if ( ZombieSpeed == 1 ) then --super slow zombies (goofy looking) chaseanim = "WALK_drunk" checkspeed = 2000 elseif ( ZombieSpeed == 2 ) then -- normal speed chaseanim = "run_old" checkspeed = 1000 elseif ( ZombieSpeed == 3 ) then -- rocket zombies (possibly stressful on server) chaseanim = "Run_Wuzi" checkspeed = 680 end return checkspeed, chaseanim end
  21. local numberOfIndex = { 5, 4, 3, 53, 14, 33 } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for _, index in ipairs ( numberOfIndex ) do setWorldSoundEnabled ( 3, index, false ) setWorldSoundEnabled ( 5, index, false ) end setDevelopmentMode ( true ) end ) Try it.
  22. This topic has gone literally to hell. Topic locked.
  23. Change: triggerServerEvent("jail.gate.open") To: triggerServerEvent("jail.gate.open", localPlayer)
×
×
  • Create New...