twitter89


Wiek: 29 Na forum: 5032 dni Posty: 23
|
|
|
|
witajcie pom??cie mi zrobi? ten skrypt na paczki.
problem polega na tym ?e gdy pojad? w marker wy?wietla si? lista jest tylko jeden towar trociny za 0 Pkt chc? ?eby by?o wi?cej za ile? tam score np 10,15,20,25,30,35 i tak dalej 2 problem jest taki gdy wezm? te trociny jad? do znaczka czerwonego roz?aduje i nie dostaje kasy bo pkt pisz? 0 to wiem ?e nie doda oto kody.
1 kod:
source = getLocalPlayer()
function closegui()
guiSetVisible(GUIEditor_Window[1],false)
showCursor(false)
end
outputChatBox("Skrypt wystartowa?!",255,0,0)
local towar = 0
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Window[1] = guiCreateWindow(131,55,586,509,"",false)
GUIEditor_Button[1] = guiCreateButton(23,42,130,32,"Trociny 0 Pkt.",false,GUIEditor_Window[1])
GUIGetText = guiCreateLabel ( 0.45,0.48, 0.10, 0.04,"Trociny",true,GUIEditor_Window[1] )
GUIEditor_Button[2] = guiCreateButton(18,383,550,54,"Zaladuj",false,GUIEditor_Window[1])
GUIEditor_Button[3] = guiCreateButton(130,454,332,46,"Zamknij",false,GUIEditor_Window[1])
addEventHandler( "onClientGUIClick", GUIEditor_Button[3], closegui )
guiSetVisible(GUIEditor_Window[1], false)
local markers = {
{ -1725, -121, 2 },
{-1854, 1402, 6.1},
{-2282, 2278, 4,5},
{-367, 1547, 75,1},
{345, 2534, 16,2},
{1641, 2412, 10},
{-2887, 503, 4},
{-1515, 721, 6},
{-683, 965, 12},
{948, 2279, 11},
{1488, 2146, 10},
{1910, 2157, 10},
{2242, 1977, 9},
{-658, 2318, 138},
{-2054, -2565, 30},
{-1416, -1468, 101},
{-605, -483, 25},
{-55, -326, 5},
{1077, -307, 75},
{-2644, 1334, 7},
{2481, 2796, 10},
{-857, -1944, 15},
{-87, -1574, 2},
{-2264, -1688, 480},
{ -2029.1010742188, 172.45364379883, 27.35425567627 }
}
local pmoney = getPlayerMoney(source)
points = getElementData(getLocalPlayer(), "Pkt")
local vehicle_ids = {[524] = true, [578] = true, [403] = true, [514] = true, [414] = true, [515] = true, [440] = true, [455] = true}
-- Cement Truck, DFT-30, Linerunner, Tanker, Mule, RoadTrain, Rumpo, Flatbed
dest = markers[math.random(1, #markers)]
for k, v in ipairs (markers) do
destmarker = createMarker(v[1], v[2], v[3], "cylinder", 3, 255, 255, 0, 255)
setElementData(destmarker, "id", v[4])
createBlip(v[1],v[2],v[3], 51)
end
function towary(hitElement)
local vehicle = getPedOccupiedVehicle(hitElement)
if vehicle then
if vehicle_ids[getElementModel(vehicle)] then
if towar == 0 then
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
else
rozladunek()
end
else
outputChatBox("To nie jest pojazd dostawczy!", 0, 255, 0)
end
else
outputChatBox("Aby za?adowa? towar musisz mie? pojazd dostawczy!", 0, 255, 0)
end
end
addEventHandler( "onClientMarkerHit", getRootElement(), towary )
function rozladunek()
if towar == 1 and id == id2 then
setElementData(getLocalPlayer(),"points",tonumber(points + 1))
towar = 0
rmoney = math.random(350,700)
givePlayerMoney ( source, rmoney )
outputChatBox("Roz?adowa?e? trociny!", player)
destroyElement(destblip)
else
outputChatBox("To nie jest ten roz?adunek!", 0, 255, 0)
end
end
function towarTrociny()
if points >= 0 and towar == 0 then
towar = 1
outputChatBox("Za?adowa?e? trociny!", player)
destblip = createBlip( dest[1], dest[2], dest[3], 41, 2, 255, 255, 0, 0, 100)
setElementData(source, "id2", dest[4])
else
outputChatBox("Aby za?adowa? ten towar musisz mie? minimum 0 punkt?w!", 0, 255, 0)
end
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[1], towarTrociny)
2 kod:
local markers = {
{ -1725, -121, 2 },
{-1854, 1402, 6.1},
{-2282, 2278, 4,5},
{-367, 1547, 75,1},
{345, 2534, 16,2},
{1641, 2412, 10},
{-2887, 503, 4},
{-1515, 721, 6},
{-683, 965, 12},
{948, 2279, 11},
{1488, 2146, 10},
{1910, 2157, 10},
{2242, 1977, 9},
{-658, 2318, 138},
{-2054, -2565, 30},
{-1416, -1468, 101},
{-605, -483, 25},
{-55, -326, 5},
{1077, -307, 75},
{-2644, 1334, 7},
{2481, 2796, 10},
{-857, -1944, 15},
{-87, -1574, 2},
{-2264, -1688, 480},
{ -2029.1010742188, 172.45364379883, 27.35425567627 }
}
local pmoney = getPlayerMoney(source)
points = getElementData(getLocalPlayer(), "Pkt")
local vehicle_ids = {[524] = true, [578] = true, [403] = true, [514] = true, [414] = true, [515] = true, [440] = true, [455] = true}
-- Cement Truck, DFT-30, Linerunner, Tanker, Mule, RoadTrain, Rumpo, Flatbed
local dest = markers[math.random(1, #markers)]
local aplayer = getPlayerFromName ( nick )
local towar = 0
local markers_objects = {}
local i = 0;
for k, v in ipairs (markers) do
markers_objects[i] = createMarker(v[1], v[2], v[3], "cylinder", 3, 255, 255, 0, 255)
createBlip(v[1],v[2],v[3], 51)
i++;
end
function towary()
local v = getPedOccupiedVehicle(element)
if getElementType(v) == "vehicle" then
if vehicle_ids[getElementModel(v)] then
if towar == 0 and destblip ~= destmarker then
if source == markers_objects[i] then
GUIEditor_Window[1] = guiCreateWindow(131,55,586,509,"",false)
GUIEditor_Button[1] = guiCreateButton(5,42,130,32,"Trociny 0 Pkt.",false,GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(18,383,550,54,"Zaladuj",false,GUIEditor_Window[1])
addEventHandler("onClientGUIClick",GUIEditor_Button[2],towarTrociny)
GUIEditor_Button[3] = guiCreateButton(130,454,332,46,"Zamknij",false,GUIEditor_Window[1])
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
end
else
rozladunek()
end
else
outputChatBox("To nie jest pojazd dostawczy!", 0, 255, 0)
end
else
outputChatBox("Aby za?adowa? towar musisz mie? pojazd dostawczy!", 0, 255, 0)
end
end
function rozladunek()
if towar == 1 and destblip == destmarker then
setElementData(source,"Pkt",tonumber(Pkt + 1))
rmoney = math.random(350,700)
givePlayerMoney ( aplayer, rmoney )
else
outputChatBox("To nie jest ten roz?adunek!", 0, 255, 0)
end
end
function towarTrociny (player)
if points >= 0 and towar == 0 then
local towar = 1
outputChatBox("Za?adowa?e? trociny!", player)
local destblip = createBlip( dest[1], dest[2], dest[3], 41, 2, 255, 255, 0, 0, 100)
else
outputChatBox("Aby za?adowa? ten towar musisz mie? minimum 0 punkt?w!", 0, 255, 0)
end
end
addEventHandler("onClientMarkerHit",getRootElement(),towary)
addEventHandler("onClientGUIClick",GUIEditor_Button[1],towarTrociny)
pozdrawiam i prosz? o pomoc jak co? podaje numer gadu: 24423999
|
|