Wysłany: 2012-04-10, 14:17
Marcin^^
Lajk a nie skrypter
Wiek: 29 Na forum: 5170 dni Posty: 59
Nick w MP: Marcin^^
Piwa : 2
Siemanko, Zn?w potrzebuje waszej pomocy mianowicie w mabako serwice z caomunity ;/ nie sa widoczen blipy nma f11 wiesz moze jak to ustawic? Dostalem system paczek, calkiem dobry, lecz gdy po kliknieciu zaladuj, pasek sie laduje i okno nie znika, natomiast pozniej nie mam twoaru na aucie, nie da sie go rozladowac :
To jest client.lua:
a to jest serwer .lua :
Cytat:
addEvent("zaladuj", true)
addEventHandler("zaladuj", getRootElement(), function(player, towar, cel)
setElementData(player, "towar", tonumber(towar))
setElementData(player, "czas", false)
setElementData(player, "cel", tonumber(cel))
triggerClientEvent("msgBox", getRootElement(), player, "Zaladowales towar!")
setTimer(function() setElementData(player, "czas", true) triggerClientEvent("msgBox", getRootElement(), player, "Juz mozesz rozladowac towar!") end, 180000, 1)
end)
addEvent("rozladuj", true)
addEventHandler("rozladuj", getRootElement(), function(player)
local akt = getElementData(player, "towar")
if akt == 1 then
wyplata = math.random(100, 250)
end
if akt == 2 then
wyplata = math.random(300, 400)
end
if akt == 3 then
wyplata = math.random(500, 600)
end
if akt == 4 then
wyplata = math.random(600, 700)
end
if akt == 5 then
wyplata = math.random(1000, 1200)
end
if akt == 6 then
wyplata = math.random(800, 850)
end
if akt == 7 then
wyplata = math.random(1500, 1700)
end
if akt == 8 then
wyplata = math.random(1000, 1100)
end
givePlayerMoney(player, wyplata)
setElementData(player, "Respekt", getElementData(player, "Respekt")+1)
setElementData(player, "towar", false)
setElementData(player, "czas", false)
setElementData(player, "cel", false)
outputChatBox("Otrzymales "..wyplata.."$ oraz 1 pkt. respektu.", player)
end)
a meta Ci chyba nie potrzeban
[ Dodano : 2012-04-10, 14:18 ]
client
Cytat:
PaczkiWindow = {}
PaczkiButton = {}
PaczkiProgress = {}
PaczkiRadio = {}
PaczkiWindow[1] = guiCreateWindow(0.3652,0.3242,0.3203,0.4375,"Paczki",true)
PaczkiButton[1] = guiCreateButton(0.0305,0.7738,0.9421,0.0893,"Zaladuj",true,PaczkiWindow[1])
PaczkiButton[2] = guiCreateButton(0.0305,0.875,0.9421,0.0893,"Rozladuj",true,PaczkiWindow[1])
PaczkiProgress[1] = guiCreateProgressBar(0.0305,0.6637,0.939,0.0952,true,PaczkiWindow[1])
PaczkiRadio[1] = guiCreateRadioButton(0.0305,0.0863,0.9177,0.0685,"Papier | -999 | 100-250$",true,PaczkiWindow[1])
PaczkiRadio[2] = guiCreateRadioButton(0.0305,0.1518,0.9177,0.0685,"Chleb | 5 | 300-400$",true,PaczkiWindow[1])
PaczkiRadio[3] = guiCreateRadioButton(0.0305,0.2202,0.9177,0.0685,"Frugo | 15 | 500-600$",true,PaczkiWindow[1])
PaczkiRadio[4] = guiCreateRadioButton(0.0305,0.2887,0.9177,0.0685,"Ksi??ki | 50 | 600-700$",true,PaczkiWindow[1])
PaczkiRadio[5] = guiCreateRadioButton(0.0305,0.3571,0.9177,0.0685,"Przemyt: koks | 70 | 1000-1200$",true,PaczkiWindow[1])
PaczkiRadio[6] = guiCreateRadioButton(0.0305,0.4256,0.9177,0.0685,"Telefony | 100 | 800-850$",true,PaczkiWindow[1])
PaczkiRadio[7] = guiCreateRadioButton(0.0305,0.494,0.9177,0.0685,"Przemyt: menele | 150 | 1500-1700$",true,PaczkiWindow[1])
PaczkiRadio[8] = guiCreateRadioButton(0.0305,0.5655,0.9177,0.0685,"Zwierz?ta | 250 | 1000-1100$",true,PaczkiWindow[1])
guiSetVisible(PaczkiWindow[1], false)
showCursor(false)
function show(player)
if player == getLocalPlayer() then
guiSetVisible(PaczkiWindow[1], true)
showCursor(true)
outputChatBox("Kliknij X, aby zamknac to okno.")
guiProgressBarSetProgress(PaczkiProgress[1], 0)
fera = getPedOccupiedVehicle(player)
setElementFrozen(fera, true)
setElementFrozen(fera, false)
bindKey("X", closepaki)
end
end
function closepaki()
guiSetVisible(PaczkiWindow[1], false)
showCursor(false)
end
function zaladuj()
local player = getLocalPlayer()
local celmath = math.random(1, 57)
local celx, cely, celz = getElementPosition(m[celmath])
if getElementData(player, "towar") then
outputChatBox("Juz masz towar!", 255, 0, 0)
else
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 10) end, 1000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 20) end, 2000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 30) end, 3000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 40) end, 4000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 50) end, 5000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 60) end, 6000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 70) end, 7000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 80) end, 8000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 90) end, 9000, 1)
setTimer(function() guiProgressBarSetProgress(PaczkiProgress[1], 100) end, 10000, 1)
setTimer(function()
local szkore = getElementData(player, "Respekt")
if guiRadioButtonGetSelected(PaczkiRadio[1]) then
if tonumber(szkore) >= -999 then
triggerServerEvent("zaladuj", getRootElement(), player, 1, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
if guiRadioButtonGetSelected(PaczkiRadio[2]) then
if tonumber(szkore) >= 5 then
triggerServerEvent("zaladuj", getRootElement(), player, 2, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
if guiRadioButtonGetSelected(PaczkiRadio[3]) then
if tonumber(szkore) >= 15 then
triggerServerEvent("zaladuj", getRootElement(), player, 3, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
if guiRadioButtonGetSelected(PaczkiRadio[4]) then
if tonumber(szkore) >= 50 then
triggerServerEvent("zaladuj", getRootElement(), player, 4, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
if guiRadioButtonGetSelected(PaczkiRadio[5]) then
if tonumber(szkore) >= 70 then
triggerServerEvent("zaladuj", getRootElement(), player, 5, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
if guiRadioButtonGetSelected(PaczkiRadio[6]) then
if tonumber(szkore) >= 100 then
triggerServerEvent("zaladuj", getRootElement(), player, 6, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
if guiRadioButtonGetSelected(PaczkiRadio[7]) then
if tonumber(szkore) >= 150 then
triggerServerEvent("zaladuj", getRootElement(), player, 7, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
if guiRadioButtonGetSelected(PaczkiRadio[8]) then
if tonumber(szkore) >= 250 then
triggerServerEvent("zaladuj", getRootElement(), player, 8, celmath)
licznik = exports.missiontimer:createMissionTimer ( 180000, true, "%m:%s", 0.5, 20, true, "default-bold", 1, 255, 255, 255 )
createBlip(celx, cely, celz, 41)
setTimer(function() destroyElement(licznik) end, 180000, 1)
else
outputChatBox("Nie masz tyle respektu!")
end
end
closepaki()
end, 11000, 1)
end
end
function rozladuj()
local player = getLocalPlayer()
if isElementWithinMarker(player, m1) then
rozladunek = 1
end
if isElementWithinMarker(player, m2) then
rozladunek = 2
end
if isElementWithinMarker(player, m3) then
rozladunek = 3
end
if isElementWithinMarker(player, m4) then
rozladunek = 4
end
if isElementWithinMarker(player, m5) then
rozladunek = 5
end
if isElementWithinMarker(player, m6) then
rozladunek = 6
end
if isElementWithinMarker(player, m7) then
rozladunek = 7
end
if isElementWithinMarker(player, m8) then
rozladunek = 8
end
if isElementWithinMarker(player, m9) then
rozladunek = 9
end
if isElementWithinMarker(player, m10) then
rozladunek = 10
end
if isElementWithinMarker(player, m11) then
rozladunek = 11
end
if isElementWithinMarker(player, m12) then
rozladunek = 12
end
if isElementWithinMarker(player, m13) then
rozladunek = 13
end
if isElementWithinMarker(player, m14) then
rozladunek = 14
end
if isElementWithinMarker(player, m15) then
rozladunek = 15
end
if isElementWithinMarker(player, m16) then
rozladunek = 16
end
if isElementWithinMarker(player, m17) then
rozladunek = 17
end
if isElementWithinMarker(player, m18) then
rozladunek = 18
end
if isElementWithinMarker(player, m19) then
rozladunek = 19
end
if isElementWithinMarker(player, m20) then
rozladunek = 20
end
if isElementWithinMarker(player, m21) then
rozladunek = 21
end
if isElementWithinMarker(player, m22) then
rozladunek = 22
end
if isElementWithinMarker(player, m23) then
rozladunek = 23
end
if isElementWithinMarker(player, m24) then
rozladunek = 24
end
if isElementWithinMarker(player, m25) then
rozladunek = 25
end
if isElementWithinMarker(player, m26) then
rozladunek = 26
end
if isElementWithinMarker(player, m27) then
rozladunek = 27
end
if isElementWithinMarker(player, m28) then
rozladunek = 28
end
if isElementWithinMarker(player, m29) then
rozladunek = 29
end
if isElementWithinMarker(player, m30) then
rozladunek = 30
end
if isElementWithinMarker(player, m31) then
rozladunek = 31
end
if isElementWithinMarker(player, m32) then
rozladunek = 32
end
if isElementWithinMarker(player, m33) then
rozladunek = 33
end
if isElementWithinMarker(player, m34) then
rozladunek = 34
end
if isElementWithinMarker(player, m35) then
rozladunek = 35
end
if isElementWithinMarker(player, m36) then
rozladunek = 36
end
if isElementWithinMarker(player, m37) then
rozladunek = 37
end
if isElementWithinMarker(player, m38) then
rozladunek = 38
end
if isElementWithinMarker(player, m39) then
rozladunek = 39
end
if isElementWithinMarker(player, m40) then
rozladunek = 40
end
if isElementWithinMarker(player, m41) then
rozladunek = 41
end
if isElementWithinMarker(player, m42) then
rozladunek = 42
end
if isElementWithinMarker(player, m43) then
rozladunek = 43
end
if isElementWithinMarker(player, m44) then
rozladunek = 44
end
[ Dodano : 2012-04-10, 14:22 ]
if isElementWithinMarker(player, m45) then
rozladunek = 45
end
if isElementWithinMarker(player, m46) then
rozladunek = 46
end
if isElementWithinMarker(player, m47) then
rozladunek = 47
end
if isElementWithinMarker(player, m48) then
rozladunek = 48
end
if isElementWithinMarker(player, m49) then
rozladunek = 49
end
if isElementWithinMarker(player, m50) then
rozladunek = 50
end
if isElementWithinMarker(player, m51) then
rozladunek = 51
end
if isElementWithinMarker(player, m52) then
rozladunek = 52
end
if isElementWithinMarker(player, m53) then
rozladunek = 53
end
if isElementWithinMarker(player, m54) then
rozladunek = 54
end
if isElementWithinMarker(player, m55) then
rozladunek = 55
end
if isElementWithinMarker(player, m56) then
rozladunek = 56
end
if isElementWithinMarker(player, m57) then
rozladunek = 57
end
if getElementData(player, "towar") == false then
outputChatBox("Nie masz towaru!")
else
if getElementData(player, "cel") ~= tonumber(rozladunek) then
outputChatBox("To nie tutaj!")
else
if getElementData(player, "czas") == false then
outputChatBox("Jeszcze nie mozesz rozladowac towaru!")
else
triggerServerEvent("rozladuj", getRootElement(), player)
for k,v in ipairs(getElementsByType("blip")) do
if getBlipIcon(v) == 41 then
destroyElement(v)
end
end
closepaki()
end
end
end
end
m = { }
[ Dodano : 2012-04-10, 14:24 ]
Mam tego tak duzo a tu jest max 15tys znakow wiec wrzucanie tego po kolei to jest bezseensowne
Co tu trzeba pogrzebac ?
[ Dodano : 2012-04-10, 14:25 ]
I co z tymi blipami, bo mnei to wkurza strasznie, bo chcia?bym aby by?o wszstko wida?
Wysłany: 2012-04-10, 14:32
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
Marcin^^ , kto to pisa? wgl? Same b??dy. Nie op?aca si? tego naprawia?. Napisz od nowa, nabierzesz do?wiadczenia i wprawy.
Polecam http://wiki.mtasa.com/
Wysłany: 2012-04-10, 15:18
Marcin^^
Lajk a nie skrypter
Wiek: 29 Na forum: 5170 dni Posty: 59
Nick w MP: Marcin^^
Piwa : 2
Karer. Lecz ten skrypt kiedy? dzia?a? i by? bdb, wiesz ile tam jest roz?adudnk?w tyle ?e mo?na by?o wozi? ka?dym autem. No pom??cie mi go naprawi?, sam napisa? nowy skrypt na za?adunki pfff cienko to widz? ;/
Wysłany: 2012-04-10, 16:17
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
Marcin^^ , to zacznij od nowa, powoli. Masz czas.
Wysłany: 2012-04-10, 16:58
Marcin^^
Lajk a nie skrypter
Wiek: 29 Na forum: 5170 dni Posty: 59
Nick w MP: Marcin^^
Piwa : 2
Tyle ?e ja nie wiem od czego zacz??.. + problemy z J.Niemieckeigo w budzie :X
[ Dodano : 2012-04-10, 17:22 ]
Co zrobi? aby po ?mierci respi? si? w szpitalu:
Cytat: root = getRootElement ()
function onPlayerJoin()
fadeCamera ( source, true )
spawnPlayer(source, -1496.6613769531, 919.79943847656, 9.7466840744019, 0, 0)
setCameraTarget ( source, source )
end
addEventHandler ( "onPlayerJoin", root, onPlayerJoin )
Wysłany: 2012-04-10, 20:08
Oski
LUA Scripter
Wiek: 30 Na forum: 5246 dni Posty: 428
Nick w MP: Oski
Piwa : 56
Kod: function spawnWasted(thePlayer)
spawnPlayer ( thePlayer, -2651, 634, 14.6, 180, 0 )
fadeCamera(thePlayer, true)
setCameraTarget(thePlayer, thePlayer)
takeAllWeapons (thePlayer)
end
addEventHandler("onPlayerWasted", getRootElement(),
function()
fadeCamera(source, false, 6.5)
setTimer(spawnWasted, 1000, 1, source)
end
)
[ Dodano : 2012-04-10, 20:09 ]
I polecam skrypty samemu pisa?.
Tagi: coś :: tutaj :: nie :: styka
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: