Wysłany: 2020-07-09, 01:31
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam, pisz? skrypt na tune, chcia?bym zrobi? co? takiego. ?e je?eli posiadamy spoiler i klikniemy jeszcze raz aby go zamontowa? to demontuje nam spoiler.
Pr?bowa?em co? ale niestety na marne.
tak wygl?da kod monta?u
c_side
bindKey ( "mouse1" , "down" , function()
if getElementData ( localPlayer , "system:tune:gui" ) == true then
if isMouseIn ( screenW * 0.0031 , screenH * 0.4102 , screenW * 0.0870 , screenH * 0.0380 ) and strona == "spoiler" then
triggerServerEvent ( "1000" , localPlayer )
end
end
end )
s_side
pro = 1
addEvent ( "1000" , true )
addEventHandler ( "1000" , root , function()
if ( getPlayerMoney ( source ) < tonumber ( pro )) then
triggerClientEvent ( client , "onClientAddNotification" , client , "Nie posiadasz tyle pieni?dzy." , "error" )
return end
takePlayerMoney ( client , pro )
veh = getPedOccupiedVehicle ( source )
addVehicleUpgrade ( veh , 1000 )
triggerClientEvent ( client , "onClientAddNotification" , client , "Zamontowa?e? spoiler Pro." , "success" )
end )
Wysłany: 2020-07-09, 03:21
NotPaladyn
Wiek: 23 Na forum: 2790 dni Posty: 866
Nick w MP: NotPaladyn
Piwa : 3135
Vice Admin: Jeśli potrzebujesz pomocy w sprawach organizacyjnych lub technicznych - skontaktuj się ze mną .
Mo?esz u?y? do tego
Nie testowa?em, ale mo?esz spr?bowa? tak:
addEvent ( "1000" , true )
addEventHandler ( "1000" , root , function()
local veh = getPedOccupiedVehicle ( source )
if ( getPlayerMoney ( source ) < tonumber ( pro )) then
triggerClientEvent ( client , "onClientAddNotification" , client , "Nie posiadasz tyle pieni?dzy." , "error" )
return end
if getVehicleUpgradeOnSlot ( veh , 2 ) == 1000 then
removeVehicleUpgrade ( veh , 1000 )
triggerClientEvent ( client , "onClientAddNotification" , client , "Zdemontowa?e? spoiler Pro." , "success" )
else
takePlayerMoney ( client , pro )
addVehicleUpgrade ( veh , 1000 )
triggerClientEvent ( client , "onClientAddNotification" , client , "Zamontowa?e? spoiler Pro." , "success" )
return end
end )
Tagi: przycisk
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: