Jump to content

Patrick

Moderators
  • Posts

    1,143
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by Patrick

  1. Maybe something like that: local checkpoints = { { -316.20703125, 1398.3125, 71.81689453125 }, { -348.99221801758, 1459.1591796875, 64.749496459961 }, { -410.787109375, 1697.8046875, 39.512222290039 } } local activeRaces = {} function nextMarker(thePlayer) -- there is an active race if activeRaces[thePlayer] then -- remove previous marker if exists if activeRaces[thePlayer].marker then destroyElement(activeRaces[thePlayer].marker) end -- next marker's index activeRaces[thePlayer].checkpoint = activeRaces[thePlayer].checkpoint + 1 -- this was the last marker -> race finished if activeRaces[thePlayer].checkpoint > #checkpoints then activeRaces[thePlayer] = nil -- remove race session -- you can do anything here, give money to player for example outputChatBox("finished") else -- there is more markers in table, create the next local pos = checkpoints[ activeRaces[thePlayer].checkpoint ] local marker = createMarker(pos[1], pos[2], pos[3], 'checkpoint', 2.0, 209, 13, 13, 100 ) local blip = createBlipAttachedTo(marker, 0) activeRaces[thePlayer].marker = marker addEventHandler("onMarkerHit", marker, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then nextMarker(hitElement) end end) end end end function Racing( thePlayer ) if not activeRaces[thePlayer] then local x, y, z = -301.59182739258, 1497.7869873047, 75.678192138672 setElementPosition(thePlayer, x, y, z) local RaceVehicle = createVehicle ( 411, x, y, z ) setElementRotation ( RaceVehicle, 0, 0, 180) warpPedIntoVehicle ( thePlayer, RaceVehicle ) -- save current marker's index in the table activeRaces[thePlayer] = { checkpoint = 0 } -- create the next marker (the first in this case) nextMarker(thePlayer) end end local raceStart = createMarker(-303.2841796875, 1521.22265625, 75.359375, "checkpoint", 2) addEventHandler("onMarkerHit", raceStart, function(thePlayer, matchingDimension) if getElementType(thePlayer) == "player" and matchingDimension and not isPedInVehicle(thePlayer) then Racing(thePlayer) -- start a race end end)
  2. Patrick

    character

    local num = "1111222233334444" local formatted = num:gsub("(....)(....)(....)(....)", "%1-%2-%3-%4") Not the most beautiful way, but works.
  3. I think it's not possible. But maybe try to use setControlState after onVehicleStartEnter, because the movement cancels it as far as I know.
  4. It's hard to tell what's wrong without seeing it. Maybe there are too many objects in one place.
  5. Patrick

    Cuenta unica.

    Wrong language, moved to Spanish section.
  6. Patrick

    PayPal Buy TopList

    Hi. Unfortunately, there is no other payment option. I think the only way is if you are looking for someone who has PayPal and can send it for you.
  7. Hi. I think this function still not works with markers.
  8. Hi! It's possible, but not a simple task. You have to do it for yourself with dxDrawPrimitive in your custom radar script.
  9. Wrong section and language, moved to Portuguese scripting.
  10. Sorry, "leaked" wasn't accurate, simply I just thought of random scripts.
  11. No one will debug your script, it's way too long. Try to debug the code for yourself, help: https://forum.multitheftauto.com/topic/95654-tut-debugging/ When you find where is the problem, maybe we can help you to fix it.
  12. This is scripting forum, where you can ask. We can't help you to fix random leaked scripts.
  13. WARNING: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] - fireExtinguishedHandler function is not exists, so you can't attach an event to this function. - What can you do? 1) Create this function. 2) Remove the addEvent(...) and addEventHandler(...) in 1st and 2nd lines. (of course it's not a real solution, just eliminate the warning message) ERROR: Client (USAR|Plk.NovaCrew) triggered serverside event doCreateFire, but event is not added serverside. - Server try to trigger a client sided custom event, doCreateFire. But this event is not exists. - What can you do? 1) Make sure this event is exists on client side.
  14. Are you talking about vehicles on Groove Street? I think these are spawned by play resource. You can find the code in server/mods/deathmatch/resources/[gamemodes]/[play]/play/broph.lua
  15. The problem is somewhere else where you set this element data, here you can do only a value check. addCommandHandler("vipsurem",function(plr) if plr:getData("loggedin") == 1 then if plr:getData("vip") <= 0 then plr:outputChat("[!]#ffffff Vip değilsiniz.",255,0,0,true) return end local dbid = getElementData(plr, "dbid") local zaman = plr:getData("vip_zaman") if zaman and tonumber(zaman) then -- is it a number? local remainingSeconds = secondsToTimeDesc(math.ceil(tonumber(zaman)/10000000000)) plr:outputChat("[!]#ffffff "..remainingSeconds.." sonra sona erecek.", 100,100,255,true) end end end)
  16. plr:getData("vip_zaman") returns nil/false/true and you can't divide a boolean by a number.
  17. Wrong language and section, looks like a scripting related question so I moved it to Portuguese scripting for better results.
  18. I guess you are trying to play the video in embed player to avoid ads. But it's blocked for a lot of videos by the author. I think you can do nothing with this.
  19. It works, but "Va" is not in the list.
  20. Hi! This is the Scripting section for scripting related questions(!), I moved your thread to Resources.
  21. You can find all of them with getAccountsBySerial and remove with removeAccount.
×
×
  • Create New...