Jump to content

trustno1

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by trustno1

  1. function grav (mister) if mister == getLocalPlayer() then theVehicle = getPedOccupiedVehicle(mister) setVehicleGravity(theVehicle,0,1,0) end end addEventHandler("onClientVehicleEnter",getRootElement(),grav)
  2. So what I want to do is: Let random pictures appear on the screen for 1 single frame continuous. Something isn't working though and Debug doesn't show any errors. I'm not a very experienced scripter so it would be cool if you could help me out on this. local rootElement = getRootElement() local screenWidth,screenHeight = guiGetScreenSize() local frame = {} frame[1] = "pic/01.png" frame[2] = "pic/02.png" frame[3] = "pic/03.png" frame[4] = "pic/04.png" frame[5] = "pic/05.png" frame[6] = "pic/06.png" frame[7] = "pic/07.png" frame[8] = "pic/08.png" frame[9] = "pic/09.png" frame[10] = "pic/10.png" frame[11] = "pic/11.png" frame[12] = "pic/12.png" frame[13] = "pic/13.png" frame[14] = "pic/14.png" frame[15] = "pic/15.png" frame[16] = "pic/16.png" frame[17] = "pic/17.png" frame[18] = "pic/18.png" frame[19] = "pic/19.png" frame[20] = "pic/20.png" frame[21] = "pic/21.png" frame[22] = "pic/22.png" frame[23] = "pic/23.png" frame[24] = "pic/24.png" frame[25] = "pic/25.png" frame[26] = "pic/26.png" frame[27] = "pic/27.png" frame[28] = "pic/28.png" frame[29] = "pic/29.png" frame[30] = "pic/30.png" frame[31] = "pic/31.png" frame[32] = "pic/32.png" frame[33] = "pic/33.png" frame[34] = "pic/34.png" frame[35] = "pic/35.png" frame[36] = "pic/36.png" frame[37] = "pic/37.png" frame[38] = "pic/38.png" frame[39] = "pic/39.png" frame[40] = "pic/40.png" frame[41] = "pic/41.png" frame[42] = "pic/42.png" frame[43] = "pic/43.png" frame[44] = "pic/44.png" frame[45] = "pic/45.png" frame[46] = "pic/46.png" frame[47] = "pic/47.png" frame[48] = "pic/48.png" frame[49] = "pic/49.png" frame[50] = "pic/50.png" frame[51] = "pic/51.png" frame[52] = "pic/52.png" frame[53] = "pic/53.png" function randomframe() local randF = math.random (#frame) randx = dxDrawImage (0, 0, screenWidth, screenHeight, 'randF') end function HandleTheRendering ( ) addEventHandler("onClientRender",rootElement, randomframe) end addEventHandler("onClientResourceStart",rootElement, HandleTheRendering) setTimer(HandleTheRendering, 50, 0) meta.xml
  3. ^^ What I tried to do is: If the checkpoint the player crossing is "checkpoint (1)" then it should do the stuff below (createvehicle etc.)
  4. So what I'm trying to do is trigger events via reaching checkpoints. The problem I have is: how do I get the checkpoint IDs out of the .map data and how do I trigger a event on a certain checkpoint (i.e. on CP 1). I've tried some stuff but it looks kinda messy and wrong. I checked a few tutorials and used the search function to find something similar but there wasn't. So this is what I've got so far: local checkpoint = getElementsByType ( "checkpoint",getRootElement()) function CP1 () if checkpoint == checkpoint (1) then CP1FBI = createVehicle (490 , -2222.6044921875, -718.970703125 , 65.950073242188 , 355.869140625 , 3.9715576171875, 275.77331542969 ) CP1PED = createPed ( 285, 0, 0, 0 ) warpPedIntoVehicle ( CP1PED, CP1FBI) setElementData (CP1FBI, 'race.collideothers', 1 ) setVehicleEngineState (CP1FBI,true) setElementVelocity (CP1FBI,0,1,0) setElementHealth (CP1FBI, 1) setTimer(destroyElement,10000,1,CP1FBI) end end addEvent('onPlayerReachCheckpoint') addEventHandler('onPlayerReachCheckpoint', getResourceRootElement(getThisResource()), CP1)
×
×
  • Create New...