Wysłany: 2016-01-28, 20:53
Toffiaaak.
Wiek: 23 Na forum: 4410 dni Posty: 128
Nick w MP: Toffy.
Piwa : 1836
Witam ponownie, posiadam pewien problem z tuningiem pojazdu, gracze mogli tuningowa? sobie pojazdy za darmo, maj?c przy tym pieni?dze na minusie, doda?em zabezpieczenie ale cos mi nie wysz?o..
C-SIDE
local sw , sh = guiGetScreenSize ()
local tuningMarker = createMarker ( 1864.65 ,- 1847.66 , 13.66 - 0.9 , "cylinder" , 1 , 0 , 0 , 0 , 170 )
local strefa = createColSphere ( 1866.94 ,- 1849.10 , 13.32 , 5.0 )
buttonZamontuj = guiCreateButton ( 507 / 1440 * sw , 644 / 900 * sh , 167 / 1440 * sw , 51 / 900 * sh , "Zamontuj" , false )
buttonZamknij = guiCreateButton ( 852 / 1440 * sw , 644 / 900 * sh , 167 / 1440 * sw , 51 / 900 * sh , "Zamknij" , false )
gridSpis = guiCreateGridList ( 505 / 1440 * sw , 228 / 900 * sh , 514 / 1440 * sw , 406 / 900 * sh , false )
guiGridListAddColumn ( gridSpis , "Cz???" , 0.5 )
guiGridListAddColumn ( gridSpis , "Cena" , 0.5 )
guiGridListAddColumn ( gridSpis , "ID" , 0.5 )
for i = 1 , 101 do
guiGridListAddRow ( gridSpis )
end
guiGridListSetItemText ( gridSpis , 5 , 1 , "Felgi" , false , false )
guiGridListSetItemColor ( gridSpis , 5 , 1 , 2 , 72 , 104 , 255 )
guiGridListSetItemText ( gridSpis , 5 , 2 , "" , false , false )
guiGridListSetItemText ( gridSpis , 5 , 3 , "" , false , false )
guiGridListSetItemText ( gridSpis , 6 , 1 , " Felgi Off-Road" , false , false )
guiGridListSetItemText ( gridSpis , 6 , 2 , "6000" , false , false )
guiGridListSetItemText ( gridSpis , 6 , 3 , "1025" , false , false )
guiGridListSetItemText ( gridSpis , 7 , 1 , " Felgi Shadow" , false , false )
guiGridListSetItemText ( gridSpis , 7 , 2 , "4000" , false , false )
guiGridListSetItemText ( gridSpis , 7 , 3 , "1073" , false , false )
guiGridListSetItemText ( gridSpis , 8 , 1 , " Felgi Mega" , false , false )
guiGridListSetItemText ( gridSpis , 8 , 2 , "5700" , false , false )
guiGridListSetItemText ( gridSpis , 8 , 3 , "1074" , false , false )
guiGridListSetItemText ( gridSpis , 9 , 1 , " Felgi Rimshine" , false , false )
guiGridListSetItemText ( gridSpis , 9 , 2 , "5000" , false , false )
guiGridListSetItemText ( gridSpis , 9 , 3 , "1075" , false , false )
guiGridListSetItemText ( gridSpis , 10 , 1 , " Felgi Wires" , false , false )
guiGridListSetItemText ( gridSpis , 10 , 2 , "5100" , false , false )
guiGridListSetItemText ( gridSpis , 10 , 3 , "1076" , false , false )
guiGridListSetItemText ( gridSpis , 11 , 1 , " Felgi Classic" , false , false )
guiGridListSetItemText ( gridSpis , 11 , 2 , "5600" , false , false )
guiGridListSetItemText ( gridSpis , 11 , 3 , "1077" , false , false )
guiGridListSetItemText ( gridSpis , 12 , 1 , " Felgi Twist" , false , false )
guiGridListSetItemText ( gridSpis , 12 , 2 , "5400" , false , false )
guiGridListSetItemText ( gridSpis , 12 , 3 , "1078" , false , false )
guiGridListSetItemText ( gridSpis , 13 , 1 , " Felgi Cutter" , false , false )
guiGridListSetItemText ( gridSpis , 13 , 2 , "800" , false , false )
guiGridListSetItemText ( gridSpis , 13 , 3 , "1079" , false , false )
guiGridListSetItemText ( gridSpis , 14 , 1 , " Felgi Switch" , false , false )
guiGridListSetItemText ( gridSpis , 14 , 2 , "3800" , false , false )
guiGridListSetItemText ( gridSpis , 14 , 3 , "1080" , false , false )
guiGridListSetItemText ( gridSpis , 15 , 1 , " Felgi Grove" , false , false )
guiGridListSetItemText ( gridSpis , 15 , 2 , "4700" , false , false )
guiGridListSetItemText ( gridSpis , 15 , 3 , "1081" , false , false )
guiGridListSetItemText ( gridSpis , 16 , 1 , " Felgi Import" , false , false )
guiGridListSetItemText ( gridSpis , 16 , 2 , "5300" , false , false )
guiGridListSetItemText ( gridSpis , 16 , 3 , "1082" , false , false )
guiGridListSetItemText ( gridSpis , 17 , 1 , " Felgi Dollar" , false , false )
guiGridListSetItemText ( gridSpis , 17 , 2 , "5100" , false , false )
guiGridListSetItemText ( gridSpis , 17 , 3 , "1083" , false , false )
guiGridListSetItemText ( gridSpis , 18 , 1 , " Felgi Trance" , false , false )
guiGridListSetItemText ( gridSpis , 18 , 2 , "6489" , false , false )
guiGridListSetItemText ( gridSpis , 18 , 3 , "1084" , false , false )
guiGridListSetItemText ( gridSpis , 19 , 1 , " Felgi Atomic" , false , false )
guiGridListSetItemText ( gridSpis , 19 , 2 , "5000" , false , false )
guiGridListSetItemText ( gridSpis , 19 , 3 , "1085" , false , false )
guiGridListSetItemText ( gridSpis , 20 , 1 , " Felgi Ahab" , false , false )
guiGridListSetItemText ( gridSpis , 20 , 2 , "7000" , false , false )
guiGridListSetItemText ( gridSpis , 20 , 3 , "1096" , false , false )
guiGridListSetItemText ( gridSpis , 21 , 1 , " Felgi Virtual" , false , false )
guiGridListSetItemText ( gridSpis , 21 , 2 , "4600" , false , false )
guiGridListSetItemText ( gridSpis , 21 , 3 , "1097" , false , false )
guiGridListSetItemText ( gridSpis , 22 , 1 , " Felgi Access" , false , false )
guiGridListSetItemText ( gridSpis , 22 , 2 , "4500" , false , false )
guiGridListSetItemText ( gridSpis , 22 , 3 , "1098" , false , false )
guiGridListSetItemText ( gridSpis , 23 , 1 , "Tuning" , false , false )
guiGridListSetItemColor ( gridSpis , 23 , 1 , 2 , 72 , 104 , 255 )
guiGridListSetItemText ( gridSpis , 23 , 2 , "" , false , false )
guiGridListSetItemText ( gridSpis , 23 , 3 , "" , false , false )
guiGridListSetItemText ( gridSpis , 24 , 1 , " Hydraulika" , false , false )
guiGridListSetItemText ( gridSpis , 24 , 2 , "10000" , false , false )
guiGridListSetItemText ( gridSpis , 24 , 3 , "1087" , false , false )
guiGridListSetItemText ( gridSpis , 25 , 1 , " Spoiler Pro" , false , false )
guiGridListSetItemText ( gridSpis , 25 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 25 , 3 , "1000" , false , false )
guiGridListSetItemText ( gridSpis , 26 , 1 , " Spoiler Win" , false , false )
guiGridListSetItemText ( gridSpis , 26 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 26 , 3 , "1001" , false , false )
guiGridListSetItemText ( gridSpis , 27 , 1 , " Spoiler Drag" , false , false )
guiGridListSetItemText ( gridSpis , 27 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 27 , 3 , "1002" , false , false )
guiGridListSetItemText ( gridSpis , 28 , 1 , " Spoiler Alpha" , false , false )
guiGridListSetItemText ( gridSpis , 28 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 28 , 3 , "1003" , false , false )
guiGridListSetItemText ( gridSpis , 29 , 1 , " Spoiler Race" , false , false )
guiGridListSetItemText ( gridSpis , 29 , 2 , "18250" , false , false )
guiGridListSetItemText ( gridSpis , 29 , 3 , "1015" , false , false )
guiGridListSetItemText ( gridSpis , 30 , 1 , " Spoiler Alien" , false , false )
guiGridListSetItemText ( gridSpis , 30 , 2 , "23250" , false , false )
guiGridListSetItemText ( gridSpis , 30 , 3 , "1147" , false , false )
guiGridListSetItemText ( gridSpis , 31 , 1 , " Spoiler Fury" , false , false )
guiGridListSetItemText ( gridSpis , 31 , 2 , "25000" , false , false )
guiGridListSetItemText ( gridSpis , 31 , 3 , "1023" , false , false )
guiGridListSetItemText ( gridSpis , 32 , 1 , " Spoiler Worx" , false , false )
guiGridListSetItemText ( gridSpis , 32 , 2 , "20000" , false , false )
guiGridListSetItemText ( gridSpis , 32 , 3 , "1016" , false , false )
guiGridListSetItemText ( gridSpis , 33 , 1 , " Wydech Twin" , false , false )
guiGridListSetItemText ( gridSpis , 33 , 2 , "23000" , false , false )
guiGridListSetItemText ( gridSpis , 33 , 3 , "1019" , false , false )
guiGridListSetItemText ( gridSpis , 34 , 1 , " Wydech Large" , false , false )
guiGridListSetItemText ( gridSpis , 34 , 2 , "23000" , false , false )
guiGridListSetItemText ( gridSpis , 34 , 3 , "1020" , false , false )
guiGridListSetItemText ( gridSpis , 35 , 1 , " BiTurbo (Nitro X10)" , false , false )
guiGridListSetItemText ( gridSpis , 35 , 2 , "50000" , false , false )
guiGridListSetItemText ( gridSpis , 35 , 3 , "1010" , false , false )
guiSetVisible ( buttonZamontuj , false )
guiSetVisible ( buttonZdemontuj , false )
guiSetVisible ( buttonZamknij , false )
guiSetVisible ( gridSpis , false )
function okno ()
dxDrawRectangle ( 495 / 1440 * sw , 218 / 900 * sh , 534 / 1440 * sw , 487 / 900 * sh , tocolor ( 0 , 0 , 0 , 200 ), false )
dxDrawRectangle ( 494 / 1440 * sw , 182 / 900 * sh , 536 / 1440 * sw , 37 / 900 * sh , tocolor ( 0 , 0 , 0 , 255 ), false )
dxDrawRectangle ( 495 / 1440 * sw , 183 / 900 * sh , 534 / 1440 * sw , 35 / 900 * sh , tocolor ( 58 , 58 , 58 , 255 ), false )
dxDrawText ( "Mechanik Los Santos" , 496 / 1440 * sw , 184 / 900 * sh , 1030 / 1440 * sw , 219 / 900 * sh , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , "pricedown" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Mechanik Los Santos" , 495 / 1440 * sw , 183 / 900 * sh , 1029 / 1440 * sw , 218 / 900 * sh , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "pricedown" , "center" , "center" , false , false , false , false , false )
end
addEventHandler ( 'onClientMarkerHit' , tuningMarker , function( hitElement , matchingDimension )
if hitElement == localPlayer then
if localPlayer . model == 50 then
local pojazdy = getElementsWithinColShape ( strefa , 'vehicle' );
if #pojazdy<1 then
outputChatBox ( 'Na stanowisku naprawczym nie ma ?adnego pojazdu.' );
return
end
if #pojazdy>1 then
outputChatBox ( 'Na stanowisku naprawczym jest zbyt du?o pojazd?w.' );
return
end
guiSetVisible ( buttonZamontuj , true );
guiSetVisible ( buttonZdemontuj , true );
guiSetVisible ( buttonZamknij , true );
guiSetVisible ( gridSpis , true );
showCursor ( true );
outputChatBox ( 'Mechaniku, zanim zamontujesz czesc musisz pobra? od gracza pieni?dze.' );
outputChatBox ( 'Maksymalna doliczka do czesci to 500$!' );
addEventHandler ( 'onClientRender' , root , okno );
end
end
end )
function zamknij ( button , state )
if button == "left" and state == "up" then
guiSetVisible ( buttonZamontuj , false )
guiSetVisible ( buttonZdemontuj , false )
guiSetVisible ( buttonZamknij , false )
guiSetVisible ( gridSpis , false )
showCursor ( false )
removeEventHandler ( "onClientRender" , getRootElement (), okno )
end
end
addEventHandler ( "onClientGUIClick" , buttonZamknij , zamknij , false )
function zamontujCzesc ( vehicle )
local vehicle = getElementsWithinColShape ( strefa , "vehicle" )
local nazwa = guiGridListGetItemText ( gridSpis , guiGridListGetSelectedItem ( gridSpis ), 1 )
local cena = guiGridListGetItemText ( gridSpis , guiGridListGetSelectedItem ( gridSpis ), 2 )
local id = guiGridListGetItemText ( gridSpis , guiGridListGetSelectedItem ( gridSpis ), 3 )
triggerServerEvent ( "tuningCzesci" , resourceRoot , vehicle [ 1 ], cena , id )
triggerServerEvent ( "takePlayerMoney" , localPlayer , cena , 0 )
outputChatBox ( "Cz??? zainstalowana pomy?lnie" )
end
addEventHandler ( "onClientGUIClick" , buttonZamontuj , zamontujCzesc )
S-SIDE
function tuningCzesci ( vehicle , cena , id )
local stankonta = getPlayerMoney ( source )
if stankonta <= cena then -- je ? li stan konta jest mniejszy od ceny tuningu
cancelEvent ()
else
local zamontowano = addVehicleUpgrade ( vehicle , id )
end
end
addEvent ( "tuningCzesci" , true )
addEventHandler ( "tuningCzesci" , resourceRoot , tuningCzesci )
DB3:
Kod: Bad argument @ 'getPlayerMoney' [Expected player at argument 1, got resource]
oraz
attempt to compare boolean with string
Wysłany: 2016-01-28, 21:03
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
To triggerServerEvent ( "tuningCzesci" , resourceRoot , vehicle [ 1 ], cena , id )
Zamie? na to triggerServerEvent ( "tuningCzesci" , localPlayer , vehicle [ 1 ], cena , id )
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-01-28, 21:03
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
triggerServerEvent ( "tuningCzesci" , localPlayer , vehicle [ 1 ], cena , id )
A ?eby urwa? funkcj? u?yj return end, nie cancelEvent().
Wysłany: 2016-01-28, 22:59
Toffiaaak.
Wiek: 23 Na forum: 4410 dni Posty: 128
Nick w MP: Toffy.
Piwa : 1836
Zrobi?em tak:
C-side
local sw , sh = guiGetScreenSize ()
local tuningMarker = createMarker ( 1864.65 ,- 1847.66 , 13.66 - 0.9 , "cylinder" , 1 , 0 , 0 , 0 , 170 )
local strefa = createColSphere ( 1866.94 ,- 1849.10 , 13.32 , 5.0 )
buttonZamontuj = guiCreateButton ( 507 / 1440 * sw , 644 / 900 * sh , 167 / 1440 * sw , 51 / 900 * sh , "Zamontuj" , false )
buttonZamknij = guiCreateButton ( 852 / 1440 * sw , 644 / 900 * sh , 167 / 1440 * sw , 51 / 900 * sh , "Zamknij" , false )
gridSpis = guiCreateGridList ( 505 / 1440 * sw , 228 / 900 * sh , 514 / 1440 * sw , 406 / 900 * sh , false )
guiGridListAddColumn ( gridSpis , "Cz???" , 0.5 )
guiGridListAddColumn ( gridSpis , "Cena" , 0.5 )
guiGridListAddColumn ( gridSpis , "ID" , 0.5 )
for i = 1 , 101 do
guiGridListAddRow ( gridSpis )
end
guiGridListSetItemText ( gridSpis , 5 , 1 , "Felgi" , false , false )
guiGridListSetItemColor ( gridSpis , 5 , 1 , 2 , 72 , 104 , 255 )
guiGridListSetItemText ( gridSpis , 5 , 2 , "" , false , false )
guiGridListSetItemText ( gridSpis , 5 , 3 , "" , false , false )
guiGridListSetItemText ( gridSpis , 6 , 1 , " Felgi Off-Road" , false , false )
guiGridListSetItemText ( gridSpis , 6 , 2 , "6000" , false , false )
guiGridListSetItemText ( gridSpis , 6 , 3 , "1025" , false , false )
guiGridListSetItemText ( gridSpis , 7 , 1 , " Felgi Shadow" , false , false )
guiGridListSetItemText ( gridSpis , 7 , 2 , "4000" , false , false )
guiGridListSetItemText ( gridSpis , 7 , 3 , "1073" , false , false )
guiGridListSetItemText ( gridSpis , 8 , 1 , " Felgi Mega" , false , false )
guiGridListSetItemText ( gridSpis , 8 , 2 , "5700" , false , false )
guiGridListSetItemText ( gridSpis , 8 , 3 , "1074" , false , false )
guiGridListSetItemText ( gridSpis , 9 , 1 , " Felgi Rimshine" , false , false )
guiGridListSetItemText ( gridSpis , 9 , 2 , "5000" , false , false )
guiGridListSetItemText ( gridSpis , 9 , 3 , "1075" , false , false )
guiGridListSetItemText ( gridSpis , 10 , 1 , " Felgi Wires" , false , false )
guiGridListSetItemText ( gridSpis , 10 , 2 , "5100" , false , false )
guiGridListSetItemText ( gridSpis , 10 , 3 , "1076" , false , false )
guiGridListSetItemText ( gridSpis , 11 , 1 , " Felgi Classic" , false , false )
guiGridListSetItemText ( gridSpis , 11 , 2 , "5600" , false , false )
guiGridListSetItemText ( gridSpis , 11 , 3 , "1077" , false , false )
guiGridListSetItemText ( gridSpis , 12 , 1 , " Felgi Twist" , false , false )
guiGridListSetItemText ( gridSpis , 12 , 2 , "5400" , false , false )
guiGridListSetItemText ( gridSpis , 12 , 3 , "1078" , false , false )
guiGridListSetItemText ( gridSpis , 13 , 1 , " Felgi Cutter" , false , false )
guiGridListSetItemText ( gridSpis , 13 , 2 , "800" , false , false )
guiGridListSetItemText ( gridSpis , 13 , 3 , "1079" , false , false )
guiGridListSetItemText ( gridSpis , 14 , 1 , " Felgi Switch" , false , false )
guiGridListSetItemText ( gridSpis , 14 , 2 , "3800" , false , false )
guiGridListSetItemText ( gridSpis , 14 , 3 , "1080" , false , false )
guiGridListSetItemText ( gridSpis , 15 , 1 , " Felgi Grove" , false , false )
guiGridListSetItemText ( gridSpis , 15 , 2 , "4700" , false , false )
guiGridListSetItemText ( gridSpis , 15 , 3 , "1081" , false , false )
guiGridListSetItemText ( gridSpis , 16 , 1 , " Felgi Import" , false , false )
guiGridListSetItemText ( gridSpis , 16 , 2 , "5300" , false , false )
guiGridListSetItemText ( gridSpis , 16 , 3 , "1082" , false , false )
guiGridListSetItemText ( gridSpis , 17 , 1 , " Felgi Dollar" , false , false )
guiGridListSetItemText ( gridSpis , 17 , 2 , "5100" , false , false )
guiGridListSetItemText ( gridSpis , 17 , 3 , "1083" , false , false )
guiGridListSetItemText ( gridSpis , 18 , 1 , " Felgi Trance" , false , false )
guiGridListSetItemText ( gridSpis , 18 , 2 , "6489" , false , false )
guiGridListSetItemText ( gridSpis , 18 , 3 , "1084" , false , false )
guiGridListSetItemText ( gridSpis , 19 , 1 , " Felgi Atomic" , false , false )
guiGridListSetItemText ( gridSpis , 19 , 2 , "5000" , false , false )
guiGridListSetItemText ( gridSpis , 19 , 3 , "1085" , false , false )
guiGridListSetItemText ( gridSpis , 20 , 1 , " Felgi Ahab" , false , false )
guiGridListSetItemText ( gridSpis , 20 , 2 , "7000" , false , false )
guiGridListSetItemText ( gridSpis , 20 , 3 , "1096" , false , false )
guiGridListSetItemText ( gridSpis , 21 , 1 , " Felgi Virtual" , false , false )
guiGridListSetItemText ( gridSpis , 21 , 2 , "4600" , false , false )
guiGridListSetItemText ( gridSpis , 21 , 3 , "1097" , false , false )
guiGridListSetItemText ( gridSpis , 22 , 1 , " Felgi Access" , false , false )
guiGridListSetItemText ( gridSpis , 22 , 2 , "4500" , false , false )
guiGridListSetItemText ( gridSpis , 22 , 3 , "1098" , false , false )
guiGridListSetItemText ( gridSpis , 23 , 1 , "Tuning" , false , false )
guiGridListSetItemColor ( gridSpis , 23 , 1 , 2 , 72 , 104 , 255 )
guiGridListSetItemText ( gridSpis , 23 , 2 , "" , false , false )
guiGridListSetItemText ( gridSpis , 23 , 3 , "" , false , false )
guiGridListSetItemText ( gridSpis , 24 , 1 , " Hydraulika" , false , false )
guiGridListSetItemText ( gridSpis , 24 , 2 , "10000" , false , false )
guiGridListSetItemText ( gridSpis , 24 , 3 , "1087" , false , false )
guiGridListSetItemText ( gridSpis , 25 , 1 , " Spoiler Pro" , false , false )
guiGridListSetItemText ( gridSpis , 25 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 25 , 3 , "1000" , false , false )
guiGridListSetItemText ( gridSpis , 26 , 1 , " Spoiler Win" , false , false )
guiGridListSetItemText ( gridSpis , 26 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 26 , 3 , "1001" , false , false )
guiGridListSetItemText ( gridSpis , 27 , 1 , " Spoiler Drag" , false , false )
guiGridListSetItemText ( gridSpis , 27 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 27 , 3 , "1002" , false , false )
guiGridListSetItemText ( gridSpis , 28 , 1 , " Spoiler Alpha" , false , false )
guiGridListSetItemText ( gridSpis , 28 , 2 , "15250" , false , false )
guiGridListSetItemText ( gridSpis , 28 , 3 , "1003" , false , false )
guiGridListSetItemText ( gridSpis , 29 , 1 , " Spoiler Race" , false , false )
guiGridListSetItemText ( gridSpis , 29 , 2 , "18250" , false , false )
guiGridListSetItemText ( gridSpis , 29 , 3 , "1015" , false , false )
guiGridListSetItemText ( gridSpis , 30 , 1 , " Spoiler Alien" , false , false )
guiGridListSetItemText ( gridSpis , 30 , 2 , "23250" , false , false )
guiGridListSetItemText ( gridSpis , 30 , 3 , "1147" , false , false )
guiGridListSetItemText ( gridSpis , 31 , 1 , " Spoiler Fury" , false , false )
guiGridListSetItemText ( gridSpis , 31 , 2 , "25000" , false , false )
guiGridListSetItemText ( gridSpis , 31 , 3 , "1023" , false , false )
guiGridListSetItemText ( gridSpis , 32 , 1 , " Spoiler Worx" , false , false )
guiGridListSetItemText ( gridSpis , 32 , 2 , "20000" , false , false )
guiGridListSetItemText ( gridSpis , 32 , 3 , "1016" , false , false )
guiGridListSetItemText ( gridSpis , 33 , 1 , " Wydech Twin" , false , false )
guiGridListSetItemText ( gridSpis , 33 , 2 , "23000" , false , false )
guiGridListSetItemText ( gridSpis , 33 , 3 , "1019" , false , false )
guiGridListSetItemText ( gridSpis , 34 , 1 , " Wydech Large" , false , false )
guiGridListSetItemText ( gridSpis , 34 , 2 , "23000" , false , false )
guiGridListSetItemText ( gridSpis , 34 , 3 , "1020" , false , false )
guiGridListSetItemText ( gridSpis , 35 , 1 , " BiTurbo (Nitro X10)" , false , false )
guiGridListSetItemText ( gridSpis , 35 , 2 , "50000" , false , false )
guiGridListSetItemText ( gridSpis , 35 , 3 , "1010" , false , false )
guiSetVisible ( buttonZamontuj , false )
guiSetVisible ( buttonZdemontuj , false )
guiSetVisible ( buttonZamknij , false )
guiSetVisible ( gridSpis , false )
function okno ()
dxDrawRectangle ( 495 / 1440 * sw , 218 / 900 * sh , 534 / 1440 * sw , 487 / 900 * sh , tocolor ( 0 , 0 , 0 , 200 ), false )
dxDrawRectangle ( 494 / 1440 * sw , 182 / 900 * sh , 536 / 1440 * sw , 37 / 900 * sh , tocolor ( 0 , 0 , 0 , 255 ), false )
dxDrawRectangle ( 495 / 1440 * sw , 183 / 900 * sh , 534 / 1440 * sw , 35 / 900 * sh , tocolor ( 58 , 58 , 58 , 255 ), false )
dxDrawText ( "Mechanik Los Santos" , 496 / 1440 * sw , 184 / 900 * sh , 1030 / 1440 * sw , 219 / 900 * sh , tocolor ( 0 , 0 , 0 , 255 ), 1.00 , "pricedown" , "center" , "center" , false , false , false , false , false )
dxDrawText ( "Mechanik Los Santos" , 495 / 1440 * sw , 183 / 900 * sh , 1029 / 1440 * sw , 218 / 900 * sh , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , "pricedown" , "center" , "center" , false , false , false , false , false )
end
addEventHandler ( 'onClientMarkerHit' , tuningMarker , function( hitElement , matchingDimension )
if hitElement == localPlayer then
if localPlayer . model == 50 then
local pojazdy = getElementsWithinColShape ( strefa , 'vehicle' );
if #pojazdy<1 then
outputChatBox ( 'Na stanowisku naprawczym nie ma ?adnego pojazdu.' );
return
end
if #pojazdy>1 then
outputChatBox ( 'Na stanowisku naprawczym jest zbyt du?o pojazd?w.' );
return
end
guiSetVisible ( buttonZamontuj , true );
guiSetVisible ( buttonZdemontuj , true );
guiSetVisible ( buttonZamknij , true );
guiSetVisible ( gridSpis , true );
showCursor ( true );
outputChatBox ( 'Mechaniku, zanim zamontujesz czesc musisz pobra? od gracza pieni?dze.' );
outputChatBox ( 'Maksymalna doliczka do czesci to 500$!' );
addEventHandler ( 'onClientRender' , root , okno );
end
end
end )
function zamknij ( button , state )
if button == "left" and state == "up" then
guiSetVisible ( buttonZamontuj , false )
guiSetVisible ( buttonZdemontuj , false )
guiSetVisible ( buttonZamknij , false )
guiSetVisible ( gridSpis , false )
showCursor ( false )
removeEventHandler ( "onClientRender" , getRootElement (), okno )
end
end
addEventHandler ( "onClientGUIClick" , buttonZamknij , zamknij , false )
function zamontujCzesc ( vehicle )
local vehicle = getElementsWithinColShape ( strefa , "vehicle" )
local nazwa = guiGridListGetItemText ( gridSpis , guiGridListGetSelectedItem ( gridSpis ), 1 )
local cena = guiGridListGetItemText ( gridSpis , guiGridListGetSelectedItem ( gridSpis ), 2 )
local id = guiGridListGetItemText ( gridSpis , guiGridListGetSelectedItem ( gridSpis ), 3 )
triggerServerEvent ( "tuningCzesci" , localPlayer , vehicle [ 1 ], cena , id )
triggerServerEvent ( "takePlayerMoney" , localPlayer , cena , 0 )
outputChatBox ( "Cz??? zainstalowana pomy?lnie" )
end
addEventHandler ( "onClientGUIClick" , buttonZamontuj , zamontujCzesc )
S-Side
function tuningCzesci ( vehicle , cena , id )
local stankonta = getPlayerMoney ( localPlayer )
if not stankonta <= cena then -- je ? li stan konta jest mniejszy od ceny tuningu
local zamontowano = addVehicleUpgrade ( vehicle , id )
else
return end
end
addEvent ( "tuningCzesci" , true )
addEventHandler ( "tuningCzesci" , resourceRoot , tuningCzesci )
Pisze ?e zamontowa?em i zabiera pieni?dze.. ale nie dodaje cz??ci.
W DB3 nic nie ma..
Wysłany: 2016-01-28, 23:14
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Usu? te 2linijki
triggerServerEvent ( "takePlayerMoney" , localPlayer , cena , 0 )
outputChatBox ( "Cz??? zainstalowana pomy?lnie" )
I s-side
function tuningCzesci ( vehicle , cena , id )
local stankonta = getPlayerMoney ( source )
if not stankonta <= cena then -- je ? li stan konta jest mniejszy od ceny tuningu
takePlayerMoney ( source , cena )
local zamontowano = addVehicleUpgrade ( vehicle , id )
outputChatBox ( "Cz??? zainstalowana pomy?lnie" )
else
return end
end
addEvent ( "tuningCzesci" , true )
addEventHandler ( "tuningCzesci" , resourceRoot , tuningCzesci )
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-01-28, 23:27
Toffiaaak.
Wiek: 23 Na forum: 4410 dni Posty: 128
Nick w MP: Toffy.
Piwa : 1836
Teraz gdy klikam button do montowania, nic si? nie dzieje.. ?adnego b??du nie ma
Podpis
Osiągnięcia:
- wygrana w konkursie LUA (kat. średnia) - 05.02.18
- 150 reputacji - 06.02.18
- 100 postów - 06.02.18
Wysłany: 2016-01-28, 23:32
_Wicek_
Majstersztyk
Wiek: 25 Na forum: 4260 dni Posty: 747
Nick w MP: Wicek
Piwa : 1841
Teraz ?
function tuningCzesci ( vehicle , cena , id )
local stankonta = getPlayerMoney ( source )
if stankonta >= cena then -- je ? li stan konta jest mniejszy od ceny tuningu
takePlayerMoney ( source , cena )
local zamontowano = addVehicleUpgrade ( vehicle , id )
outputChatBox ( "Cz??? zainstalowana pomy?lnie" , source )
else
outputChatBox ( "Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!" , source )
end
addEvent ( "tuningCzesci" , true )
addEventHandler ( "tuningCzesci" , resourceRoot , tuningCzesci )
Podpis
Support-Team: 25.01.2016
Moderator: 10.07.2016
GG: 51274621
Skype : kuba_wicinski
Wysłany: 2016-01-28, 23:38
Toffiaaak.
Wiek: 23 Na forum: 4410 dni Posty: 128
Nick w MP: Toffy.
Piwa : 1836
Nadal nic, a i jednego enda brak?o
Zamykasz funkcje i ifa.
[ Dodano : 2016-01-29, 20:12 ]
Pomo?e ktos czy nie?
Tagi: tune
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: