Jump to content

Leonard.DC

Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by Leonard.DC

  1. Continue without work, have 0 pizzas and cant refill D:
  2. mmm, im tried onPlayerSpawn, its something like onClientPlayerSpawn
  3. Dont work sir, i was tryed this, but it doesn't move me to the team Edit: This is an example from the wiki spawnTeam = createTeam ("Teamname", 255, 0, 0) -- Create team to spawn. function spawnOnLogin (prevA, curA, autoLogin) outputChatBox ("Welcome to ...", source, 255, 0, 0, false) spawnPlayer (source, 0, 0, 5, 0, math.random (0,288), 0, 0, spawnTeam) -- spawns player with random skin fadeCamera (source, true) setCameraTarget (source, source) end addEventHandler("onPlayerLogin", getRootElement(), spawnOnLogin) They say it set the player to the team, but i think something is wrong
  4. Hi, i know this problem is too stupid, but i cant fix it by myself Server Side: function spawnFirst () local mySkins = { 7, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 35, 33, 34, 37, 40, 41, 43, 45, 41, 46, 47, 48, 51, 52, 59, 60, 66, 67, 78, 98, 101, 123, 124, 125, 128,138, 143, 144 } spawnPlayer (source, 1684.73242, -2330.71021, 13.54688, 360, mySkins[math.random(1, #mySkins)], 0, 0, OffDuty) setCameraTarget (source, source) fadeCamera(source, true, 2.0) end function odTeam () OffDuty = createTeam ( "OffDuty", 0, 0, 0 ) end addEventHandler("onResourceStart", resourceRoot, odTeam) When the player connect and spawn for the first time to the server, he doesn't move to the OffDuty team, He be in the original place, on the top, Why? What i do wrong, please respond
  5. If you can't make a role playing server then don't bother. If you can make a Race or freeroam then do it. Server alredy done, thanks
  6. Im tryed, but make a rol is too dificult alone, my other friends dont know scripting a shit, no offence, and a freeroam/race its to simple and easy for me
  7. Hi, im looking to buy a Roleplay/RPG server, and i need you to say me what are the normal prices or cheap prices and names of nice scripters and mappers to make it, it is for the future because just now im earning some cash, regards and sorry if i place the topic in the incorrect place
  8. EPIC FAIL! Sry, I use the one code i was created 1 mouth ago for all the jobs, it is more easy for me, and i make a mistake because my last job is the Medic Job, i will see and try your solution, and i will say it later if it works or not, regards
  9. Hi, im making a pizza delivery job for a ROL server, and i need little help to finish it, i was testing with /debugscript 3, but it doesn't say me any error. When i enter to the marker to refill pizzas, nothing happen, and when the job start, i have 0 filled pizzas Client Side: local pizzaSkins = { [155]=true; } local pizzaVehicles = { [448]=true; } local pizza_money = 500 local max_pizzas = 8 local pizzaLocations = { { 1183.80920, -1259.07385, 15.17969 }; { 818.37964, -1345.92249, 13.52533 }; { 609.48016, -1349.53735, 13.77307 }; { 1222.46191, -1814.00232, 16.59375 }; { 1719.80371, -1837.48755, 13.55041 }; { 1894.84570, -1883.25708, 13.47901 }; { 2121.47607, -2166.66943, 13.54688 }; } function randomHouse () return unpack (pizzaLocations [math.random (#pizzaLocations)]) end local markerpz = createMarker ( 2110.32104, -1788.62524, 13.56085, "cylinder", 2, 193, 218, 81, 56 ) local markerpz1 = createMarker ( 1363.36572, 258.25174, 19.56693, "cylinder", 2, 193, 218, 81, 56 ) local markerpz2 = createMarker ( 2335.77515, 80.98492, 26.48217, "cylinder", 2, 193, 218, 81, 56 ) local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; addEventHandler ( 'onClientRender', root, function ( ) -- local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( markerpz ); local x2, y2, z2 = getElementPosition ( markerpz1 ); local x3, y3, z3 = getElementPosition ( markerpz2 ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance_2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); local distance_3 = getDistanceBetweenPoints3D( x, y, z, x3, y3, z3 ); -- -- Marker #1 if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "*****", x1_, y1_, x1_, y1_, tocolor ( 0, 0, 0, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end -- Marker #2 elseif distance_2 <= gMaxDistance then local x2_, y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ); if x2_ and y2_ then -- local scale = 1 / ( gScale * ( distance_2 / gMaxDistance ) ); local alpha = ( ( distance_2 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "******", x2_, y2_, x2_, y2_, tocolor ( 0, 0, 0, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end -- Marker #3 elseif distance_3 <= gMaxDistance then local x3_, y3_ = getScreenFromWorldPosition( x3, y3, z3 + 0.95, 0.06 ); if x3_ and y3_ then -- local scale = 1 / ( gScale * ( distance_3 / gMaxDistance ) ); local alpha = ( ( distance_3 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "*********", x3_, y3_, x3_, y3_, tocolor ( 0, 0, 0, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end ); function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end Wnd = guiCreateWindow ( 0.2, 0.2, 0.50, 0.60, "********", true ) guiSetAlpha( Wnd, 1 ) button = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "******", true, Wnd ) button1 = guiCreateButton ( 0.01, 0.8, 0.45, 0.15, "*******", true, Wnd ) label = guiCreateLabel ( 0.05, 0.1, 0.9, 0.2, "********.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) skins = { {"Repartidor", 155}, } skinG = guiCreateGridList(0.01, 0.3, 0.99, 0.5, true, Wnd) guiGridListAddColumn(skinG, "Skin", 0.85) for i,skins in ipairs(skins) do row = guiGridListAddRow(skinG) -- guiGridListSetItemText(skinG, row, 1, tostring(skins[1]), false, false) guiGridListSetItemData(skinG, row, 1, tostring(skins[2])) end function pizzaJob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(Wnd) then guiSetVisible(Wnd, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", markerpz, pizzaJob) addEventHandler("onClientMarkerHit", markerpz1, pizzaJob) addEventHandler("onClientMarkerHit", markerpz2, pizzaJob) function takeJobPz() local row, col = guiGridListGetSelectedItem(skinG) if (row and col and row ~= -1 and col ~= -1) then local models = tonumber(guiGridListGetItemData(skinG, row, 1)) if model ~= "" then triggerServerEvent("getJobPz", localPlayer, models) guiSetVisible(Wnd,false) showCursor(false) addEventHandler ("onClientRender", getRootElement(), pzDx) setTimer(function() removeEventHandler("onClientRender",getRootElement(),pzDx) end,5000,1) end end end addEventHandler("onClientGUIClick", button1, takeJobPz, false) function pzDx () dxDrawText("*******", 197, 338, 765, 393, tocolor(193, 218, 81, 255), 1.40, "diploma", "left", "top", false, false, true, false, false) end function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function joinTeam(source) triggerServerEvent("setRep", localPlayer, localPlayer) guiSetVisible(windowjob, false) showCursor(false) end function removeMedicWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler ("onClientVehicleEnter", root, function () local pizzadriver = getVehicleController (source) if pizzaVehicles [getElementModel (source)] and pizzaSkins [getElementModel (pizzadriver)] then if getElementData (source, "pizzajob.pizzas") then pizzasLeft = guiCreateLabel (0.02, 0.7, 5, 5, "*******" .. getElementData (source, "pizzajob.pizzas"), true) elseif not getElementData (source, "pizzajob.pizzas") then pizzasLeft = guiCreateLabel (0.02, 0.7, 5, 5, "********", true) end if not pizzadriver then return end outputChatBox ("********", 255, 255, 0, true) guiSetFont (pizzasLeft, "default-bold-small") guiLabelSetColor (pizzasLeft, 255, 100, 0) bindKey ("mouse1", "down", throwPizza, pizzadriver) refillPizza = createMarker (2096.6, -1807, 12.5, "cylinder", 3.5, 255, 255, 50, 90, pizzadriver) if isElement (pizzaHouse) and isElement (pizzaHouseBlip) then return end triggerEvent ("startPizzaboy", pizzadriver) end end ) addEventHandler ("onClientVehicleExit", root, function () if pizzaVehicles [getElementModel (source)] and pizzaSkins [getElementModel (localPlayer)] then unbindKey ("mouse1", "down", throwPizza) if isElement (pizzasLeft) then destroyElement (pizzasLeft) end if isElement (refillPizza) then destroyElement (refillPizza) end outputChatBox ("*******", 0, 0, 255) end end ) addEventHandler ("onClientMarkerHit", root, function (hitElement) if not source == refillPizza then return end if hitElement == "player" and isPedInVehicle (hitElement) and pizzaVehicles [getElementModel (getPedOccupiedVehicle (hitElement))] and pizzaSkins [getElementModel (hitElement)] then setElementData (getPedOccupiedVehicle (hitElement), "pizzajob.pizzas", tonumber(max_pizzas)) guiSetText (pizzasLeft, "*********".. getElementData (getPedOccupiedVehicle (hitElement), "pizzajob.pizzas")) if not hitElement then return end outputChatBox ("********", 193, 218, 81) end end ) function throwPizza () if not localPlayer then return end local playerVehicle = getPedOccupiedVehicle (localPlayer) if not playerVehicle then return end local pizzaboy = getVehicleController (playerVehicle) if not pizzaboy then return end local x3, y3, z3 = getElementPosition (pizzaHouse) if not x3 then return end local x2, y2, z2 = getElementPosition (playerVehicle) if not x2 then return end if isPedInVehicle (localPlayer) and pizzaVehicles [getElementModel (playerVehicle)] and pizzaSkins [getElementModel (pizzaboy)] and not isTimer (pizzaCooldown) then if getElementData (playerVehicle, "pizzajob.pizzas") and getElementData (playerVehicle, "pizzajob.pizzas") > 0 then setElementData (playerVehicle, "pizzajob.pizzas", getElementData (playerVehicle, "pizzajob.pizzas") - 1)
×
×
  • Create New...