Wysłany: 2018-02-15, 21:25
PirczyK
Totalnie Polski RPG
Wiek: 25 Na forum: 3047 dni Posty: 23
Nick w MP: PirczyK
Piwa : 605
Zrobi?em sobie skrypt na prac? dorywcz? tylko mam pewien b??d.
Nie dodaje mi kasy, nie mam animacji, mog? pracowa? w aucie, a tego nie chc?.
To nie jest ca?y skrypt
Podgl?d za piwo.
TU JEST GUI I MI DZIA?A
---
BLIP NA MAPIE I CYLINDER - DZIA?A
local pracaM = createMarker (****, "cylinder" , 2.3 , 140 , 0 , 0 )
local blip = createBlip (****, 34 , 0 , 0 , 0 , 0 , 0 , 0 , 500 )
local zoledzie = {
TU MI DZIA ? A },
}
TU MI NIE DZIA ? A !
[ i ] addEventHandler ( "onClientMarkerHit" , pracaM , function( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= localPlayer then return end
outputChatBox ( "#00FF4c[INFO] #FFFFFFAby rozpocz??, kliknij 'E'!" , source , 140 , 0 , 0 , true )
end )[/ i ]
TU MI DZIA ? A TYLKO ROZPOCZ ? CIE PRACY POD ( E )
[ i ] bindKey ( "e" , "down" , function()
if not isElementWithinMarker ( localPlayer , pracaM ) then return end
if not getElementData ( localPlayer , "gracz_pracaM" ) then
local losuj = math . random ( 1 , #zoledzie)
local hajsiwo = math . random ( 50 , 60 )
setElementData ( localPlayer , "gracz_pracaM" , true )
triggerServerEvent ( "bron" , localPlayer )
outputChatBox ( "#FF0000[ZBIERACZ] #FFFFFF****." , 255 , 255 , 255 , true )
toggleControl ( "sprint" , false )
toggleControl ( "jump" , false )
toggleControl ( "crouch" , false )
toggleControl ( "fire" , false )
toggleControl ( "next_weapon" , false )
toggleControl ( "previous_weapon" , false )[/ i ]
TU MI DZIA ? AJ ? MARKERY I BLIP , ALE NIE MAM INFO , ? E NIE MOG ? PRACOWA ? W AUCIE .
[ i ] local cel = createMarker ( zoledzie [ losuj ][ 1 ], zoledzie [ losuj ][ 2 ], zoledzie [ losuj ][ 3 ]- 1.0 , "checkpoint" , 1.0 , 120 , 0 , 0 )
local blip = createBlipAttachedTo ( cel , 56 )
addEventHandler ( "onClientMarkerHit" , cel , function( el , md )
if not md or getElementType ( el ) ~= "player" then return end
if el ~= localPlayer then return end
if getPedOccupiedVehicle ( el ) then
outputChatBox ( "#00FF4C[INFO] #FFFFFFNie mozesz pracowac bedac w pojezdzie!" , source , 255 , 255 , 255 , true )
return
end [/ i ]
TU MI NIC NIE DZIA ? A Z ANIMACJI I DAWANIA HAJSU
[ i ] destroyElement ( blip )
setElementFrozen ( el , true )
-- exports . msgboxrpg : showBox ( localPlayer , "warning" , "zbierasz ?o??dzie..." )
triggerServerEvent ( "animka" , localPlayer )
fillBar ( 5 , 255 , 255 , 0 )
setTimer (function()
setElementFrozen ( el , false )
setPedAnimation ( ped , "buddy_reload" )
triggerServerEvent ( "onZbieraczJobCashReceived" , localPlayer , hajsiwo )[/ i ]
TO DZIA ? A
[ i ] outputChatBox ( "Zebra?e? wystarczaj?co ?o??dzi. W twoim worku nie ma ju? miejsca." , 200 , 0 , 0 )[/ i ]
destroyElement ( cel )
triggerServerEvent ( "zb" , localPlayer )
triggerServerEvent ( "animka" , localPlayer )
setElementData ( el , "gracz_pracaM" , false )
triggerServerEvent ( "magwyp" , root , localPlayer )
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
toggleControl ( "crouch" , true )
toggleControl ( "fire" , true )
toggleControl ( "next_weapon" , true )
toggleControl ( "previous_weapon" , true )
-- triggerServerEvent ( "skonczPraceM" , localPlayer )
end , 5000 , 1 )
end )
else
outputChatBox ( "#FF0000[ZBIERACZ] #FFFFFFJeden worek Ci wystarczy!" , 255 , 255 , 255 , true )
end
end )
Ostatnio zmieniony przez Emm 2018-02-15, 21:55, w całości zmieniany 2 razy
Wysłany: 2018-03-06, 21:53
manieks78
Lua ;)
Wiek: 25 Na forum: 3387 dni Posty: 97
Nick w MP: Hexan
Piwa : 5
setPedAnimation ( ped , "buddy_reload" , "buddy" )
Animka ju? powinna dzia?a? teraz dalej.
Z t? wyp?at? to z tego co widz? musisz poda? s_side, tam gdzie masz te nadawanie pieni?dzy, poniewa? w c_side masz tylko jak losuj? wyp?at? math.randomem, ale w tym jest ok, wi?c musisz pokaza? s_side, a je?li nie chcesz, to sprawd? czy masz dobrze, dam ci przyk?ad givePlayerMoney.
givePlayerMoney ( source , hajsiwo )
Co do auta zr?b takie co?, a te if getPedOccupiedvehicle ( el ) then usu? i daj to:
local veh = getPedOccupiedVehicle ( el )
if veh then I dalej daj t? wiadomo??, ?e jak gracz jest w poje?dzie to nie mo?e pracowa?.
Wysłany: 2018-03-07, 12:00
Ciastuuś
Truck soon...
Wiek: 26 Na forum: 3071 dni Posty: 799
Nick w MP: Ciastuuś
Piwa : 4297
Daj ponownie kod, gdy? ten jest nie czytelny oraz zawiera znaki po za lua.
Tagi: pomóżcie :: skryptem
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: