Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Witam! Pisz? skrypt z pomoc? kolegi na prace dorywcz?. Lecz jednak co? nie dzia?a... Za popraw? = .
W db3 nic, a markery si? nie pokazuj?...
KOD: -- Skalowanie
function Skaluj ( sw , sh , sw2 , sh2 )
local sWidth , sHeight = guiGetScreenSize ()
local scaleX , scaleY =( sWidth / 1280 ), ( sHeight / 800 )
return ( sw * scaleX ), ( sh * scaleY ), ( sw2 * scaleX ), ( sh2 * scaleY )
end
x , y , w , h = Skaluj ( 451 , 234 , 382 , 316 )
x1 , y1 , w1 , h1 = Skaluj ( 459 , 488 , 139 , 39 )
x2 , y2 , w2 , h2 = Skaluj ( 684 , 488 , 139 , 39 )
x3 , y3 , w3 , h3 = Skaluj ( 459 , 271 , 373 , 184 )
-- Gui podj ? cia
sprz ? tanieOkno = guiCreateWindow ( x , y , w , h , "Praca Dorywcza - Sprz?tanie Miasta" , false )
guiWindowSetMovable ( sprz ? tanieOkno , false )
guiWindowSetSizable ( sprz ? tanieOkno , false )
podejmij = guiCreateButton ( x1 , y1 , w1 , h1 , "Podejmij Prac?" , false , sprz ? tanieOkno )
guiSetProperty ( podejmij , "NormalTextColour" , "FF11FF00" )
anuluj = guiCreateButton ( x2 , y2 , w2 , h2 , "Anuluj" , false , sprz ? tanieOkno )
guiSetProperty ( anuluj , "NormalTextColour" , "FFFF0000" )
opis = guiCreateLabel ( x3 , y3 , w3 , h3 , "Sprz?tanie Miasta Santos - Jezdzisz Sweeperem po miescie wjezdzasz\ntworz? si? blipy na mapie za kt?rymi musisz jecha?. Za wykonane zadanie otrzymujesz 1 Best Points i 1000$." , false , sprz ? tanieOkno )
guiSetFont ( opis , "default-bold-small" )
guiLabelSetColor ( opis , 0 , 227 , 255 )
guiLabelSetHorizontalAlign ( opis , "center" , false )
-- Praca
local auto = {
[ 574 ] = true
}
podjazd = createMarker ( 1611.5999755859 , - 1893.9000244141 , 12.5 , 2 , 255 , 255 , 255 , 255 )
mark1 = createMarker ( 1647.4000244141 , - 1875 , 12.5 , 6 , 0 , 0 , 0 , 0 )
mark2 = createMarker ( 1692.1999511719 , - 1831.5999755859 , 12.5 , 6 , 0 , 0 , 0 , 0 )
mark3 = createMarker ( 1692 , - 1740.3000488281 , 12.5 , 6 , 0 , 0 , 0 , 0 )
mark4 = createMarker ( 1571.8000488281 , - 1729.9000244141 , 12.5 , 6 , 0 , 0 , 0 , 0 )
mark5 = createMarker ( 1566.9000244141 , - 1838 , 12.5 , 6 , 0 , 0 , 0 , 0 )
mark6 = createMarker ( 1595.3000488281 , - 1875.0999755859 , 12.5 , 6 , 0 , 0 , 0 , 0 )
addEventHandler ( "onClientMarkerHit" , podjazd , function( player )
local auto = getPedOccupiedVehicle ( player )
if auto then
guiSetVisible ( sprz ? tanieOkno , true )
showCursor ( true )
end
)
addEventHandler ( "onClientGUIClick" , anuluj , function()
guiSetVisible ( sprz ? tanieOkno , false )
showCursor ( false )
end )
addEventHandler ( "onClientGUIClick, podejmij, function(hitElement)
if hitElement == getLocalPlayer() then
setElementData(hitElement, " post1 ", true )
pozycja1 = createMarker (1647.4000244141, -1875, 12.5, 6, 0, 0, 0, 0 )
blip1 = createBlipAtachedTo( mark1, 41 )
guiSetVisible(sprz?tanieOkno, false )
showCursor(false)
end
end)
addEventHandler(" onClientMarkerHit , mark2 , function( hitElement )
if hitElement == getLocalPlayer () then
local auto = getPedOccupiedVehicle ( hitElement )
if auto then
if getElementData ( hitElement , "post1" ) == true then
setElementData ( hitElement , "post2" , true )
setElementData ( hitElement , "post1" , false )
destroyElement ( blip1 )
destroyElement ( pozycja1 )
pozycja2 = createMarker ( 1692.1999511719 , - 1831.5999755859 , 12.5 , 6 , 0 , 0 , 0 , 0 )
blip2 = createBlipAtachedTo ( mark2 , 41 )
guiSetVisible ( sprz ? tanieOkno , false )
showCursor ( false )
end
end )
addEventHandler ( "onClientMarkerHit, mark3, function(hitElement)
if hitElement == getLocalPlayer() then
local auto = getPedOccupiedVehicle ( hitElement )
if auto then
if getElementData(hitElement," post2 ") == true then
setElementData(hitElement, " post3 ", true )
setElementData(hitElement, " post2 ", false )
destroyElement (blip2)
destroyElement (pozycja2)
pozycja3 = createMarker (1692, -1740.3000488281, 12.5, 6, 0, 0, 0, 0 )
blip3 = createBlipAtachedTo(mark3, 41 )
guiSetVisible(sprz?tanieOkno, false )
showCursor(false)
end
end)
addEventHandler(" onClientMarkerHit , mark4 , function( hitElement )
if hitElement == getLocalPlayer () then
local auto = getPedOccupiedVehicle ( hitElement )
if auto then
if getElementData ( hitElement , "post3" ) == true then
setElementData ( hitElement , "post4" , true )
setElementData ( hitElement , "post3" , false )
destroyElement ( blip3 )
destroyElement ( pozycja3 )
pozycja4 = createMarker ( 1571.8000488281 , - 1729.9000244141 , 12.5 , 6 , 0 , 0 , 0 , 0 )
blip4 = createBlipAtachedTo ( mark4 , 41 )
guiSetVisible ( sprz ? tanieOkno , false )
showCursor ( false )
end
end )
addEventHandler ( "onClientMarkerHit, mark5, function(hitElement)
if hitElement == getLocalPlayer() then
local auto = getPedOccupiedVehicle ( hitElement )
if auto then
if getElementData(hitElement," post4 ") == true then
setElementData(hitElement, " post5 ", true )
setElementData(hitElement, " post4 ", false )
destroyElement (blip4)
destroyElement (pozycja4)
pozycja5 = createMarker (1566.9000244141, -1838, 12.5, 6, 0, 0, 0, 0 )
blip5 = createBlipAtachedTo(mark5, 41 )
guiSetVisible(sprz?tanieOkno, false )
showCursor(false)
end
end)
addEventHandler(" onClientMarkerHit , mark6 , function( hitElement )
if hitElement == getLocalPlayer () then
local auto = getPedOccupiedVehicle ( hitElement )
if auto then
if getElementData ( hitElement , "post5" ) == true then
setElementData ( hitElement , "post6" , true )
setElementData ( hitElement , "post5" , false )
destroyElement ( blip5 )
destroyElement ( pozycja5 )
pozycja6 = createMarker ( 1595.3000488281 , - 1875.0999755859 , 12.5 , 6 , 0 , 0 , 0 , 0 )
givePlayerMoney ( 1000 )
guiSetVisible ( sprz ? tanieOkno , false )
showCursor ( false )
end
end )