-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Remove it only from "inVEH" function.
-
Did you get it to work?
-
Why wouldn't it be possible? save them on death, then load on spawn.
-
local x, y, z = unpack ( pickups [ math.random ( #pickups ) ] ) markers [ thePlayer ] = createMarker ( x, y, z, "cylinder", 3.5, 255, 0, 0 ) local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) That's what it has to go inside startJob function.
-
viewtopic.php?f=91&t=34239&p=356668
-
Yeah, well, I guess I didn't expressed myself right. You can return many values though, like this: test1, test2 = unpack ( fromJSON ( getAccountData ( account, "testData" ) ) )
-
Go to line 262 of the file at: "race/textlib.lua" and replace it with: dxDrawText ( self.strText, l, t, r, b, tocolor(unpack(self.tColor)), self.fScale, self.strFont, self.bHorizontalAlign, self.bVerticalAlign, self.bClip, self.bWordWrap, self.bPostGUI, true ) @csiguusz: He wants HEX color codes.
-
Well, you can always save a JSON string, then convert it into a table and it would be more than one value. Like this: setAccountData ( account, "testData", toJSON ( { "Hello", "World" } ) ) Then you can get it like this: testData = fromJSON ( getAccountData ( account, "testData" ) ) outputChatBox ( testData [ 1 ] ) outputChatBox ( testData [ 2 ] ) Or you can use split function: setAccountData ( account, "testData", "Hello, World" ) testData = split ( getAccountData ( account, "testData" ), "," ) outputChatBox ( testData [ 1 ] ) outputChatBox ( testData [ 2 ] )
-
This would be the main function: function startJob ( thePlayer ) -- Code here end And you would need to put your random marker generation inside it, then execute startJob passing 'thePlayer' argument from 'onVehicleEnter' and 'onMarkerHit'.
-
Most of servers draw the text without the DirectX library provided by race author. You can still edit the library to add color coded.
-
Well, it can return three values or more if you split the string.
-
Is a really simple script, so I'll give it to you: -- script.lua: local reward = 2000 addEventHandler ( "onPlayerPickUpRacePickup", root, function ( pickupID, pickupType, vehicleModel ) if ( pickupType == "vehiclechange" ) and ( vehicleModel == 425 ) then givePlayerMoney ( source, reward ) outputChatBox ( getPlayerName ( source ) .." has got the hunter and obtained $".. tostring ( reward ), root, 0, 255, 0 ) end end ) -- meta.xml: "Castillo" version="1.0" name="Hunter Reward" type="script" />
-
We don't give support with leaked scripts. Topic locked.
-
"seat" es un argumento en tu funcion.
-
Verifica si "seat" es igual a 0.
-
You can create a function instead, and execute it when they enter the vehicle, and when they finish delivery.
-
Eso no tiene el menor sentido. Tenes que usar el evento: onVehicleStartEnter Y: getElementModel cancelEvent
-
If you never try to do it, you'll never learn.
-
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 = { [1]={ 9 }, [2]={ 10 }, [3]={ 14 }, [4]={ 15 }, [5]={ 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 getElementType ( thePlayer ) == "player" then 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 end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) markers = { } blips = { } peds = { } function inVEH ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and 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 ) local skins = unpack ( pedCus [ math.random ( #pedCus ) ] ) peds [ thePlayer ] = createPed( skins, x, y, z ) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], warpit ) end else if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) triggerEvent("onMarkerHit", root, dropoff) 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 warpPedIntoVehicle ( peds [ thePlayer ], vehicle, 2 ) if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end local x, y, z = unpack ( dropoff [ math.random ( #dropoff ) ] ) markers [ thePlayer ] = createMarker ( x, y, z - 1, "cylinder", 3.5, 255, 0, 0 ) blips [ thePlayer ] = createBlipAttachedTo ( markers [ thePlayer ], 41 ) addEventHandler ( "onMarkerHit", markers [ thePlayer ], pickMeUp ) end end end function pickMeUp ( thePlayer ) if ( getElementType ( thePlayer ) == "player" and isPedInVehicle ( thePlayer ) ) then if ( isElement ( markers [ thePlayer ] ) ) then destroyElement ( markers [ thePlayer ] ) end if ( isElement ( blips [ thePlayer ] ) ) then destroyElement( blips [ thePlayer ] ) end if ( isElement ( peds [ thePlayer ] ) ) then destroyElement ( peds [ thePlayer ] ) end outputChatBox ( "Destination reached.", thePlayer ) end end
-
Search here: https://community.multitheftauto.com/ if there isn't any, then you better start learning how to do it on your own, or pay someone to do it for you.
-
That's not what I told you, read again what I told you to do.
-
I changed some other things. To do that, you need to do the same as in "inVEH" function, destroy first marker/blip, create new random one and attach the event handler of "onMarkerHit" to function "pickMeUp".