Wysłany: 2016-11-26, 20:05
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
Witam mam pytanie czy mo?na zrobi? prac? dorywcz? od np x scora. Czyli jak gracz nie ma wystarczaj?cej liczby scora(pkt) wywala mu b??d. Twoje PKT jest za niskie by pracowa? w tej pracy dorywczej
Wysłany: 2016-11-26, 20:17
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
local praca = createMarker ( x , y , z )
addEventHandler ( "onMarketHit" , praca ,function()
if getElementData ( source , "punkty" )< 50 then
outputChatBox ( "Masz za malo punktow" , source )
return end
end )
Podpinasz to pod swoj? prace // strona s's
Ostatnio zmieniony przez amited 2016-11-26, 20:20, w całości zmieniany 3 razy
Wysłany: 2016-11-26, 20:17
Pumelowsky
Amator 3D
Wiek: 23 Na forum: 4181 dni Posty: 199
Nick w MP: Pumelowsky
Piwa : 1666
Tak oczywi?cie
if getElementData ( plr , "user:score" ) > 15 then -- tutaj daj swoj ? elementDate i zamie ? 15 na swoje
Kod pracy
else
outputChatBox ( "nie masz na tyle sc" , plr )
end
Podpis
Kontakt:
- Skype: live:pumapl_2
- GG: 56865468
- Discord: Pumelowsky#1126
- PW forum
[/center]
Wysłany: 2016-11-26, 20:49
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
zrobi?em co? takiego m1 to jest marker. posiadam 300 scora. i normalnie mog? wej??
addEventHandler ( "onMarketHit" , m1 ,function()
if getElementData ( source , "player:reputation" )< 1000 then
outputChatBox ( "Masz za malo punktow" , source )
return end
end )
Wysłany: 2016-11-26, 21:07
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
cyc11 , Podaj kod swojej pracy ca?ej lub tam gdzie j? zaczynasz
Podpis
"amited" napisał/a :
Wysłany: 2016-11-26, 21:13
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
SV.lua
local missionText = createElement ( "text" )
setElementData ( missionText , "name" , "Praca Dorywcza StreetView" )
setElementPosition ( missionText , - 1922.84 , 574.36 , 35.59 )
local zone = createColCuboid (- 1931.93115 , 565.16870 , 34.48125 , 6.741943359375 , 6.8533935546875 , 4.5156234741211 )
createBlip (- 1942.57 , 573.09 , 35.17 , 46 , 2 , 0 , 0 , 0 , 0 , 0 , 275 )
local m1 = createMarker (- 1922.84 , 574.36 , 33.59 , "cylinder" , 2.2 , 96 , 96 , 96 )
vehs = {}
local code = "StreetView"
function removePreviousVehicles ( plr )
for i , v in ipairs ( getElementsByType ( "vehicle" , resourceRoot )) do
local sby = getElementData ( v , "zrespilGracz" )
if sby and sby == plr and getPedOccupiedVehicle ( plr ) ~= v then
destroyElement ( v )
end
end
end
addEventHandler ( "onMarkerHit" , m1 , function( el , md )
if getElementData ( el , "zrespilGracz" ) then
outputChatBox ( "praca w trakcie poprawek" , el )
end
if not md or getElementType ( el ) ~= "player" or getPedOccupiedVehicle ( el ) then return end
if getElementData ( el , "player:job" ) then return end
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
local x , y , z = getElementPosition ( el )
local bus = createVehicle ( 400 , - 1927.28 , 569.90 , 35.29 )
setElementData ( bus , "zrespilGracz" , el )
setElementData ( bus , "vehicle:fuel" , 100 )
setElementData ( bus , "vehicle:mileage" , math . random ( 50000 , 80000 ))
setVehicleHandling ( bus , "maxVelocity" , 60 , 00 )
setElementData ( el , "player:job" , code )
warpPedIntoVehicle ( el , bus )
removePreviousVehicles ( el )
triggerClientEvent ( el , "STARTJobBus" , resourceRoot , bus )
vehs [ el ] = bus
end )
addEvent ( "STOPJobBus" , true )
addEventHandler ( "STOPJobBus" , resourceRoot , function()
local pojazd = getPedOccupiedVehicle ( client )
if pojazd then
destroyElement ( pojazd )
end
end )
addEventHandler ( "onPlayerVehicleExit" , resourceRoot ,function()
destroyElement ( source )
end )
addEvent ( "destroyVeh" , true )
addEventHandler ( "destroyVeh" , getRootElement (),
function()
if vehs [ client ] then
if isElement ( vehs [ client ]) then destroyElement ( vehs [ client ]) end
end
end )
addEvent ( "onPlayerQuit" , true )
addEventHandler ( "onPlayerQuit" , getRootElement (), function()
if vehs [ source ] then
if isElement ( vehs [ source ]) then destroyElement ( vehs [ source ]) end
end
end )
addEventHandler ( "onPlayerCommand" , getRootElement (), function(string)
if string == "hwdp" then
cancelEvent ()
end
end )
addEvent ( "givePlayerMoneySTREET" , true )
addEventHandler ( "givePlayerMoney" , getRootElement (),function( kwota )
if not tonumber ( kwota ) then return end
givePlayerMoney ( source , kwota )
end )
addEvent ( "givePlayerMoneySTREET" , true )
addEventHandler ( "givePlayerMoneySTREET" , root , function( kwota )
-- nie zalogowana osoba a fuj
if not tonumber ( kwota ) then return end
if not getElementData ( source , "player:logged" ) then return end
givePlayerMoney ( source , kwota )
local rnd ={ math . random ( 1 , 30 ), math . random ( 1 , 2 )}
if rnd [ 1 ] == 1 or rnd [ 1 ] == 15 or rnd [ 1 ] == 26 then
local rep = getElementData ( source , "player:reputation" ) or 0
local xd = rep + rnd [ 2 ]
setElementData ( source , "player:reputation" , xd )
triggerClientEvent ( source , "reputation:show" , resourceRoot , rnd )
end
end )
addEventHandler ( "onMarketHit" , m1 ,function( StreetView )
if getElementData ( source , "player:reputation" )< 1000 then
outputChatBox ( "Masz za malo punktow" , source )
return end
end )
SV_c.lua
--[[
Praca busa
]]--
local code = "StreetView"
local districtsBus = {
{- 1946.06 , 576.68 , 35.17 },
{- 1977.65 , 563.64 , 35.17 },
{- 1997.81 , 552.35 , 35.02 },
{- 1999.73 , 623.61 , 35.68 },
{- 2000.36 , 706.83 , 45.30 },
{- 2002.46 , 869.43 , 45.30 },
{- 1984.03 , 918.51 , 45.30 },
{- 1919.52 , 920.94 , 36.14 },
{- 1838.39 , 918.46 , 30.83 },
{- 1733.78 , 915.18 , 24.74 },
{- 1719.71 , 890.64 , 24.74 },
{- 1718.24 , 856.76 , 24.73 },
{- 1684.85 , 840.03 , 24.73 },
{- 1566.73 , 830.90 , 7.04 },
{- 1562.09 , 690.80 , 7.04 },
{- 1562.37 , 542.92 , 7.03 },
{- 1667.58 , 392.10 , 7.03 },
{- 1736.49 , 319.31 , 7.03 },
{- 1795.43 , 360.74 , 17.08 },
{- 1812.61 , 481.28 , 24.42 },
{- 1892.46 , 596.32 , 35.02 },
{- 1990.67 , 608.13 , 35.02 },
{- 1990.01 , 540.02 , 35.01 },
{- 1974.86 , 564.12 , 35.17 },
{- 1939.31 , 573.38 , 35.17 },
}
local jobTarget
local jobMarker
local jobVehicle
local maxTarget = #districtsBus
function finishJob ()
if jobMarker and isElement ( jobMarker ) then
destroyElement ( jobMarker )
jobMarker = nil
end
if jobTarget and isElement ( jobTarget ) then
destroyElement ( jobTarget )
jobTarget = nil
jobTarget = 0
end
if getElementData ( localPlayer , "player:job" ) == code then
setElementData ( localPlayer , "player:job" , false )
end
triggerServerEvent ( "destroyVeh" , localPlayer )
end
addEventHandler ( "onClientPlayerWasted" , getLocalPlayer (), finishJob )
addEvent ( "finishJob" , true )
addEventHandler ( "finishJob" , root ,function( plr )
if plr ~= localPlayer then return end
finishJob ()
end )
function busDriver ( el , md )
if el ~= localPlayer or not md then return end
if jobTarget > maxTarget and getPedOccupiedVehicle ( el ) then return end
if jobTarget == maxTarget and not getPedOccupiedVehicle ( el ) then return end
if jobTarget == #districtsBus then
finishJob ()
playSoundFrontEnd ( 5 )
outputChatBox ( "* Zako?czy?e?/a? prac?." )
else
showMarker ()
playSoundFrontEnd ( 12 )
if not getElementData ( localPlayer , "player:premium" ) then
triggerServerEvent ( "givePlayerMoneySTREET" , localPlayer , 60 , 0 )
outputChatBox ( "Otrzymujesz 60 PLN za zidentyfikowanie punktu." )
end
if getElementData ( localPlayer , "player:premium" ) then
outputChatBox ( "Otrzymujesz 80 PLN za zidentyfikowanie punktu." )
triggerServerEvent ( "givePlayerMoneySTREET" , localPlayer , 80 , 0 )
end
end
end
function showMarker ()
if jobMarker and isElement ( jobMarker ) then
destroyElement ( jobMarker )
jobMarker = nil
end
jobTarget = jobTarget + 1
jobMarker = createMarker ( districtsBus [ jobTarget ][ 1 ], districtsBus [ jobTarget ][ 2 ], districtsBus [ jobTarget ][ 3 ], "checkpoint" , 4 , 0 , 0 , 255 )
if districtsBus [ jobTarget + 1 ] then
ile = districtsBus [ jobTarget + 1 ]
setMarkerTarget ( jobMarker , ile [ 1 ], ile [ 2 ], ile [ 3 ])
end
addEventHandler ( "onClientMarkerHit" , jobMarker , busDriver )
end
addEvent ( "STARTJobBus" , true )
addEventHandler ( "STARTJobBus" , resourceRoot , function( veh )
outputChatBox ( "* Rozpocze?e?/a? prace." )
jobVehicle = veh
jobTarget = 0
showMarker ()
end )
addEventHandler ( "onClientResourceStop" , resourceRoot , function()
if jobVehicle and getElementData ( localPlayer , "player:job" ) then
setElementData ( localPlayer , "player:job" , false )
end
end )
addEventHandler ( "onClientVehicleExit" , resourceRoot , function( plr , seat )
if seat == 0 then
if plr == localPlayer then
finishJob ()
outputChatBox ( "Zako?czy?e? prac?" )
end
end
end )
addEventHandler ( "onPlayerCommand" , getRootElement (), function(string)
if string == "hwdp" then
cancelEvent ()
end
end )
--[[
if getElementData ( el , 'player:premium' ) then
triggerServerEvent ( 'givePlayerMoney' , el , 100 , 111 )
outputChatBox ( '* (Premium)PREMIUM zarabia 100 ' , 54 , 0 , 235 )
else
triggerServerEvent ( 'givePlayerMoney' , el , 100 , 111 )
end
--]]
local sx , sy = guiGetScreenSize ()
local data ={
value = nil ,
showed = false ,
text = nil ,
}
local randomText ={
"" ,
}
function renderInformation ()
local sin = math . sin ( getTickCount ()/ 500 )* 0.01
-- dxDrawRectangle ( sx * 288 / 1024 , sy * 512 / 768 , sx * 471 / 1024 , sy * 101 / 768 , tocolor ( 0 , 102 , 178 , 255 ), false )
dxDrawImage ( sx * 298 / 1024 , sy * 512 / 768 , sx * 471 / 1024 , sy * 171 / 768 , "img/corona.png" , sin , 0 , 0 , white , false )
-- dxDrawText ( "Otrzyma?e?(a?) dodatkow? reputacj?..." , sx *( 393 + 1 )/ 1024 , sy *( 513 + 1 )/ 768 , sx *( 759 + 1 )/ 1024 , sy *( 549 + 1 )/ 768 , tocolor ( 0 , 0 , 0 , 255 ), 1.11 , "default-bold" , "center" , "center" , false , true )
-- dxDrawText ( "Otrzyma?e?(a?) dodatkow? reputacj?..." , sx * 393 / 1024 , sy *( 513 )/ 768 , sx * 759 / 1024 , sy * 549 / 768 , white , 1.11 , "default-bold" , "center" , "center" , false , true )
-- dxDrawText ( data . text .. " (" .. data . value .. " REP)" , sx *( 393 + 1 )/ 1024 , sy *( 549 + 1 )/ 768 , sx *( 759 + 1 )/ 1024 , sy *( 603 + 1 )/ 768 , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , "clear" , "center" , "center" , false , true )
dxDrawText ( data . text .. "" .. data . value .. " YOSpoints" , sx * 510 / 1024 , sy * 549 / 768 , sx * 759 / 1024 , sy * 680 / 768 , black , 1.50 , "pricedown" , "center" , "center" , false , true )
end
addEvent ( "reputation:show" , true )
addEventHandler ( "reputation:show" , resourceRoot , function( rnd )
data . value = rnd [ 2 ]
data . text = randomText [ math . random ( #randomText)]
addEventHandler ( "onClientRender" , root , renderInformation )
setTimer (function()
removeEventHandler ( "onClientRender" , root , renderInformation )
data . value = nil
data . text = nil
end , 6000 , 1 )
end )
Wysłany: 2016-11-26, 21:28
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
sv.lua :
addEventHandler ( "onMarkerHit" , m1 , function( el , md )
if getElementData ( el , "zrespilGracz" ) then
outputChatBox ( "praca w trakcie poprawek" , el )
end
if not md or getElementType ( el ) ~= "player" or getPedOccupiedVehicle ( el ) then return end
if getElementData ( el , "player:job" ) then return end
if getElementData ( el , "player:reputation" )< 1000 then
outputChatBox ( "Nie masz wystarczaj?cej reputacji!" , el )
return end
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
local x , y , z = getElementPosition ( el )
local bus = createVehicle ( 400 , - 1927.28 , 569.90 , 35.29 )
setElementData ( bus , "zrespilGracz" , el )
setElementData ( bus , "vehicle:fuel" , 100 )
setElementData ( bus , "vehicle:mileage" , math . random ( 50000 , 80000 ))
setVehicleHandling ( bus , "maxVelocity" , 60 , 00 )
setElementData ( el , "player:job" , code )
warpPedIntoVehicle ( el , bus )
removePreviousVehicles ( el )
triggerClientEvent ( el , "STARTJobBus" , resourceRoot , bus )
vehs [ el ] = bus
end )
Podpis
"amited" napisał/a :
Wysłany: 2016-11-26, 21:56
killercycDDS
Migacz
Wiek: 25 Na forum: 4512 dni Posty: 629
Nick w MP: killer_cyc[DDS]
Piwa : 1659
ok dzia?a dzi?ki do zamkni?cia
Tagi: czy :: jest :: możliwość
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: