-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You said team, that means you need to use: getPlayerTeam getTeamName
-
Instead of numbers like: 245, you do 0.245 * screenWidth.
-
I had this problem too not long ago, and a friend told me to use offsets instead of pixels and that worked.
-
You just set the vehicle color with a random number between 0 and 255, like this: r = math.random ( 255 ) g = math.random ( 255 ) b = math.random ( 255 )
-
Exactly.
-
Funciones: createMarker setElementInterior Evento: onMarkerHit
-
You need only one tab panel, then you can add tabs with: guiCreateTab, and then you create the GUI elements with the tab element as parent.
-
They aren't real pickups, but objects being rotated and collisionless with a colshape. The colshape radius is 3.5.
-
Hello and welcome to the forums. MTA is the best GTA mod, you may think I'm exaggerating, but after you see the amazing things that can be done you won't think the same. You can get more information from here: https://wiki.multitheftauto.com/wiki/Multi_Theft_Auto
-
allPlayers = {} x, y, z = 2485, -1667, 13.34375 function pedFun(playa,command,male,female) triggerClientEvent(playa,"soundStart",playa) if not countnumber then countnumber = 1 else countnumber = countnumber + 1 end if not male then male = math.random(1,2) end if not female then female = math.random(0,300) end if not bed then bed = {} end bed[countnumber] = createObject(2299,x,y,z,0,0,180) if not cj then cj = {} end cj[countnumber] = createPed(male,x,y,z) while not cj[countnumber] do cj[countnumber] = createPed(math.random(0,300),x,y,z) end setPedRotation(cj[countnumber],180) addPedClothes(cj[countnumber],"player_torso","torso",0) addPedClothes(cj[countnumber],"player_legs","legs",2) addPedClothes(cj[countnumber],"foot","feet",3) if not slut then slut = {} end slut[countnumber] = createPed(female,x,y,z) while not slut[countnumber] do slut[countnumber] = createPed(math.random(0,300),x,y,z) end addPedClothes(slut[countnumber],"player_torso","torso",0) addPedClothes(slut[countnumber],"player_legs","legs",2) addPedClothes(slut[countnumber],"foot","feet",3) setElementPosition(cj[countnumber],x+2.5,y+0.5,z) setElementPosition(slut[countnumber],x+2.5,y-0.5,z) setTimer(pedFun2,100,1,cj[countnumber],slut[countnumber],bed[countnumber]) end function pedFun2(cj,slut,bed) setPedAnimation(cj,"sex","sex_1_cum_p",1,true,false) setPedAnimation(slut,"sex","sex_1_cum_w",1,true,false) if not sexy then setTimer(delPeds,14000,1,cj,slut,bed) end end end function sexBind() bindKey(source,"m","down","accion") outputChatBox("Recurso iniciado",source,0,255,0,true) end function sexBindStart() outputChatBox("Recurso iniciado",getRootElement(),0,255,0,true) players = getElementsByType("player") for i,player in ipairs (players) do bindKey(player,"m","down","accion") end end function sexKeeper() if not sexy then sexy = true outputChatBox("Stay horny!",getRootElement(),0,255,0) else sexy = nil outputChatBox("Cheap slut...",getRootElement(),255,0,0) end end addCommandHandler("accion",pedFun) addCommandHandler("sexy",sexKeeper) addEventHandler("onPlayerJoin",getRootElement(),sexBind) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),sexBindStart)
-
That makes no sense. You shouldn't post if you don't know how to help, because that'll only confuse him even more.
-
Jaysd: Your script is the same as 3ɑsн8 ɑʟsнɾq's.
-
What has zombieProof to do with dimension?
-
All you can do if that resource does not work is create your own, shouldn't be hard. You should use: dxDrawText onClientRender
-
What was the problem? and how you solved it?
-
Yeah, I though you wanted one with alpha 10. You're welcome.
-
Go to: "freeroam/vehicles.xml".
-
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() chauffeurSkins = { [253]=true, [255]=true, [165]=true } taxis = { [420]=true, [438]=true } playerClients = { } playerCols = { } playerBlips = { } jobClients = { } playerJobLocation = { }; local XMLTaxiLocations = xmlLoadFile ( "XML\\taxi_locations.xml" ) if ( not XMLTaxiLocations ) then local XMLTaxiLocations = xmlCreateFile ( "XML\\taxi_locations.xml", "taxi_locations" ) xmlSaveFile ( XMLTaxiLocations ) end local taxi_locations = xmlNodeGetChildren(XMLTaxiLocations) taxiLocations = {} for i,node in ipairs(taxi_locations) do taxiLocations[i] = {} taxiLocations[i]["x"] = xmlNodeGetAttribute ( node, "posX" ) taxiLocations[i]["y"] = xmlNodeGetAttribute ( node, "posY" ) taxiLocations[i]["z"] = xmlNodeGetAttribute ( node, "posZ" ) taxiLocations[i]["r"] = xmlNodeGetAttribute ( node, "rot" ) end xmlUnloadFile ( XMLTaxiLocations ) end ) function enterVehicle ( thePlayer, seat, jacked ) if ( taxis[getElementModel ( source )] ) and ( not chauffeurSkins[getElementModel ( thePlayer )] ) and (seat == 0) then cancelEvent() outputChatBox ( "only taxi drivers can enter!", thePlayer ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) function startJob ( playerSource ) local x, y, z = getElementPosition ( playerSource ) if ( chauffeurSkins[getElementModel ( playerSource )] ) then if not playerClients[ playerSource ] then local numLocations = #taxiLocations if ( numLocations > 0 ) then repeatCount = 0; repeat local pickupPoint = math.random(numLocations) pickupx = taxiLocations[pickupPoint]["x"] pickupy = taxiLocations[pickupPoint]["y"] pickupz = taxiLocations[pickupPoint]["z"] pickupr = taxiLocations[pickupPoint]["r"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, pickupx, pickupy, pickupz ); repeatCount = repeatCount+1 until jobDistance > 100 and jobDistance < 800 + repeatCount*100 repeat local id = math.random( 10, 270 ) ped = createPed( tonumber( id ), pickupx, pickupy, pickupz ) setPedRotation ( ped, pickupr ) until ped playerClients[ playerSource ] = { }; table.insert( playerClients[ playerSource ], ped ); table.insert( jobClients, ped ); local pedBlip = createBlipAttachedTo ( ped, 56, 2, 255, 0, 0, 255, 1, 99999.0, playerSource) playerBlips[ playerSource ] = { }; table.insert( playerBlips[ playerSource ], pedBlip ); pedMarker = createMarker ( pickupx, pickupy, pickupz, "cylinder", 5.0, 255, 255, 0, 10, playerSource) playerCols[ playerSource ] = { }; table.insert( playerCols[ playerSource ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arrivePickup ) outputChatBox ( "pickup the passenger located at the yellow blip.", playerSource ); else outputChatBox ( "no passenger pickup points specified, contact an admin!", playerSource ); end else outputChatBox ( "you allready have an assignment!", source ); end else outputChatBox ( "you don't have a job!", source ); end end addCommandHandler ("startjob", startJob); function arrivePickup ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then local x,y,z = getElementPosition(ped); local tx,ty,tz = getElementPosition(playerSource); setPedRotation(ped, findRotation(x,y,tx,ty) ); local numLocations = #taxiLocations if ( numLocations > 0 ) then local playerVehicle = getPedOccupiedVehicle ( playerSource ); if playerVehicle and taxis[getElementModel ( playerVehicle )] then local speedx, speedy, speedz = getElementVelocity ( playerSource ); local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5); if actualspeed < 0.25 then local occupants = getVehicleOccupants(playerVehicle); local seats = getVehicleMaxPassengers(playerVehicle); local freeSeats = 0; for seat = 0, seats do local occupant = occupants[seat]; if not occupant and tonumber(freeSeats) == 0 then freeSeats = freeSeats + 1; warpPedIntoVehicle ( ped, playerVehicle, seat ); if playerBlips[ playerSource ] then for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end end if playerCols[ playerSource ] then for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end end playerJobLocation[ playerSource ] = { }; playerJobLocation[ playerSource ] = { ["x"]=x, ["y"]=y, ["z"]=z }; repeat local dropOffPoint = math.random(numLocations) dropOffx = taxiLocations[dropOffPoint]["x"] dropOffy = taxiLocations[dropOffPoint]["y"] dropOffz = taxiLocations[dropOffPoint]["z"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, dropOffx, dropOffy, dropOffz ); until jobDistance > 1000 and jobDistance < 35000 local dropOffBlip = createBlip ( dropOffx, dropOffy, dropOffz, 56, 2, 255, 0, 0, 255, 1, 99999.0, playerSource) playerBlips[ playerSource ] = { }; table.insert( playerBlips[ playerSource ], dropOffBlip ); pedMarker = createMarker ( dropOffx, dropOffy, dropOffz, "cylinder", 3.5, 255, 255, 0, 0, playerSource) playerCols[ playerSource ] = { }; table.insert( playerCols[ playerSource ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arriveDropOff ) outputChatBox ( "drive your passenger to the yellow destination blip.", playerSource ); end end if tonumber(freeSeats) == 0 then outputChatBox ( "You don't have an empty seat for the passenger!", playerSource ); end else outputChatBox ( "slow down to pick up the passenger!", playerSource ); end else outputChatBox ( "you do not have a taxi vehicle!", playerSource ); end else outputChatBox ( "no passenger pickup points specified, contact an admin!", playerSource ); end end end end end function arriveDropOff ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then local pedVehicle = getPedOccupiedVehicle ( ped ); local playerVehicle = getPedOccupiedVehicle ( playerSource ); if playerVehicle and taxis[getElementModel ( playerVehicle )] then if pedVehicle == playerVehicle then local speedx, speedy, speedz = getElementVelocity ( playerSource ); local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5); if actualspeed < 0.15 then removePedFromVehicle ( ped ); if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then destroyElement( ped ); playerClients[ playerSource ] = nil; end end for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end dx = tonumber(playerJobLocation[ playerSource ]["x"]); dy = tonumber(playerJobLocation[ playerSource ]["y"]); dz = tonumber(playerJobLocation[ playerSource ]["z"]); local tx,ty,tz = getElementPosition(playerSource); local jobDistance = getDistanceBetweenPoints3D ( dx, dy, dz, tx, ty, tz ); local jobDistanceKM = round(jobDistance/1000,2); local jobReward = round(10+(jobDistanceKM^0.75)*30); givePlayerMoney ( playerSource, jobReward ); for k, jobLocation in pairs( playerJobLocation[ playerSource ] ) do if jobLocation then playerJobLocation[ playerSource ] = nil; end end outputChatBox ( "job succesful, you earned "..jobReward.." dollar.", playerSource ); end else outputChatBox ( "slow down to drop off the passenger!", playerSource ); end else outputChatBox ( "you have lost your passenger!", playerSource ); end else outputChatBox ( "you do not have a taxi vehicle!", playerSource ); end end end end end function quitJob ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then destroyElement( ped ); playerClients[ playerSource ] = nil; end end for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end if playerJobLocation[ playerSource ] then for k, jobLocation in pairs( playerJobLocation[ playerSource ] ) do if jobLocation then
-
Did that work before? because all I did was fix the marker type which had missing quotations.
-
You just add a new category: "Custom Vehicles"> "589" name="GT 500" />
-
If you want it, then learn how to do it.
-
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() chauffeurSkins = { [253]=true, [255]=true, [165]=true } taxis = { [420]=true, [438]=true } playerClients = { } playerCols = { } playerBlips = { } jobClients = { } playerJobLocation = { }; local XMLTaxiLocations = xmlLoadFile ( "XML\\taxi_locations.xml" ) if ( not XMLTaxiLocations ) then local XMLTaxiLocations = xmlCreateFile ( "XML\\taxi_locations.xml", "taxi_locations" ) xmlSaveFile ( XMLTaxiLocations ) end local taxi_locations = xmlNodeGetChildren(XMLTaxiLocations) taxiLocations = {} for i,node in ipairs(taxi_locations) do taxiLocations[i] = {} taxiLocations[i]["x"] = xmlNodeGetAttribute ( node, "posX" ) taxiLocations[i]["y"] = xmlNodeGetAttribute ( node, "posY" ) taxiLocations[i]["z"] = xmlNodeGetAttribute ( node, "posZ" ) taxiLocations[i]["r"] = xmlNodeGetAttribute ( node, "rot" ) end xmlUnloadFile ( XMLTaxiLocations ) end ) function enterVehicle ( thePlayer, seat, jacked ) if ( taxis[getElementModel ( source )] ) and ( not chauffeurSkins[getElementModel ( thePlayer )] ) and (seat == 0) then cancelEvent() outputChatBox ( "only taxi drivers can enter!", thePlayer ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle ) function startJob ( playerSource ) local x, y, z = getElementPosition ( playerSource ) if ( chauffeurSkins[getElementModel ( playerSource )] ) then if not playerClients[ playerSource ] then local numLocations = #taxiLocations if ( numLocations > 0 ) then repeatCount = 0; repeat local pickupPoint = math.random(numLocations) pickupx = taxiLocations[pickupPoint]["x"] pickupy = taxiLocations[pickupPoint]["y"] pickupz = taxiLocations[pickupPoint]["z"] pickupr = taxiLocations[pickupPoint]["r"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, pickupx, pickupy, pickupz ); repeatCount = repeatCount+1 until jobDistance > 100 and jobDistance < 800 + repeatCount*100 repeat local id = math.random( 10, 270 ) ped = createPed( tonumber( id ), pickupx, pickupy, pickupz ) setPedRotation ( ped, pickupr ) until ped playerClients[ playerSource ] = { }; table.insert( playerClients[ playerSource ], ped ); table.insert( jobClients, ped ); local pedBlip = createBlipAttachedTo ( ped, 56, 2, 255, 0, 0, 255, 1, 99999.0, playerSource) playerBlips[ playerSource ] = { }; table.insert( playerBlips[ playerSource ], pedBlip ); pedMarker = createMarker ( pickupx, pickupy, 0, "cylinder", 5.0, 255, 255, 0, 10, playerSource) playerCols[ playerSource ] = { }; table.insert( playerCols[ playerSource ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arrivePickup ) outputChatBox ( "pickup the passenger located at the yellow blip.", playerSource ); else outputChatBox ( "no passenger pickup points specified, contact an admin!", playerSource ); end else outputChatBox ( "you allready have an assignment!", source ); end else outputChatBox ( "you don't have a job!", source ); end end addCommandHandler ("startjob", startJob); function arrivePickup ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then local x,y,z = getElementPosition(ped); local tx,ty,tz = getElementPosition(playerSource); setPedRotation(ped, findRotation(x,y,tx,ty) ); local numLocations = #taxiLocations if ( numLocations > 0 ) then local playerVehicle = getPedOccupiedVehicle ( playerSource ); if playerVehicle and taxis[getElementModel ( playerVehicle )] then local speedx, speedy, speedz = getElementVelocity ( playerSource ); local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5); if actualspeed < 0.25 then local occupants = getVehicleOccupants(playerVehicle); local seats = getVehicleMaxPassengers(playerVehicle); local freeSeats = 0; for seat = 0, seats do local occupant = occupants[seat]; if not occupant and tonumber(freeSeats) == 0 then freeSeats = freeSeats + 1; warpPedIntoVehicle ( ped, playerVehicle, seat ); if playerBlips[ playerSource ] then for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end end if playerCols[ playerSource ] then for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end end playerJobLocation[ playerSource ] = { }; playerJobLocation[ playerSource ] = { ["x"]=x, ["y"]=y, ["z"]=z }; repeat local dropOffPoint = math.random(numLocations) dropOffx = taxiLocations[dropOffPoint]["x"] dropOffy = taxiLocations[dropOffPoint]["y"] dropOffz = taxiLocations[dropOffPoint]["z"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, dropOffx, dropOffy, dropOffz ); until jobDistance > 1000 and jobDistance < 35000 local dropOffBlip = createBlip ( dropOffx, dropOffy, dropOffz, 56, 2, 255, 0, 0, 255, 1, 99999.0, playerSource) playerBlips[ playerSource ] = { }; table.insert( playerBlips[ playerSource ], dropOffBlip ); pedMarker = createMarker ( dropOffx, dropOffy, 0, "arrow", 3.5, 255, 255, 0, 0, playerSource) playerCols[ playerSource ] = { }; table.insert( playerCols[ playerSource ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arriveDropOff ) outputChatBox ( "drive your passenger to the yellow destination blip.", playerSource ); end end if tonumber(freeSeats) == 0 then outputChatBox ( "You don't have an empty seat for the passenger!", playerSource ); end else outputChatBox ( "slow down to pick up the passenger!", playerSource ); end else outputChatBox ( "you do not have a taxi vehicle!", playerSource ); end else outputChatBox ( "no passenger pickup points specified, contact an admin!", playerSource ); end end end end end function arriveDropOff ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then local pedVehicle = getPedOccupiedVehicle ( ped ); local playerVehicle = getPedOccupiedVehicle ( playerSource ); if playerVehicle and taxis[getElementModel ( playerVehicle )] then if pedVehicle == playerVehicle then local speedx, speedy, speedz = getElementVelocity ( playerSource ); local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5); if actualspeed < 0.15 then removePedFromVehicle ( ped ); if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then destroyElement( ped ); playerClients[ playerSource ] = nil; end end for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end dx = tonumber(playerJobLocation[ playerSource ]["x"]); dy = tonumber(playerJobLocation[ playerSource ]["y"]); dz = tonumber(playerJobLocation[ playerSource ]["z"]); local tx,ty,tz = getElementPosition(playerSource); local jobDistance = getDistanceBetweenPoints3D ( dx, dy, dz, tx, ty, tz ); local jobDistanceKM = round(jobDistance/1000,2); local jobReward = round(10+(jobDistanceKM^0.75)*30); givePlayerMoney ( playerSource, jobReward ); for k, jobLocation in pairs( playerJobLocation[ playerSource ] ) do if jobLocation then playerJobLocation[ playerSource ] = nil; end end outputChatBox ( "job succesful, you earned "..jobReward.." dollar.", playerSource ); end else outputChatBox ( "slow down to drop off the passenger!", playerSource ); end else outputChatBox ( "you have lost your passenger!", playerSource ); end else outputChatBox ( "you do not have a taxi vehicle!", playerSource ); end end end end end function quitJob ( playerSource ) if playerClients[ playerSource ] then for k, ped in pairs( playerClients[ playerSource ] ) do if ped then destroyElement( ped ); playerClients[ playerSource ] = nil; end end for k, blip in pairs( playerBlips[ playerSource ] ) do if blip then destroyElement( blip ); playerBlips[ playerSource ] = nil; end end for k, col in pairs( playerCols[ playerSource ] ) do if col then destroyElement( col ); playerCols[ playerSource ] = nil; end end if playerJobLocation[ playerSource ] then for k, jobLocation in pairs( playerJobLocation[ playerSource ] ) do if jobLocation then