Wysłany: 2016-07-22, 20:07
Lemonfm
Wiek: 30 Na forum: 3733 dni Posty: 4
Nick w MP: Lemon
Wiatm pomo?e mi kto? mam tu skrypt na salon i pomo?ecie przerobi? ?eby nie by? pod klawiszem f2 tylko ?eby by? gdy wejde w marker dam Piweczko
--------------------------------
GUIEditor = {
tabpanel = {},
window = {}
}
PANEL = guiCreateStaticImage ( 0.07 , 0.07 , 0.88 , 0.85 , "1.png" , true )
guiWindowSetSizable ( PANEL , false )
guiSetAlpha ( PANEL , 0.80000001192093 )
guiSetVisible ( PANEL , false )
FONDO = guiCreateStaticImage ( 0.0 , 0.0 , 1.0 , 1.0 , ":Clogin/fondo.jpg" , true , PANEL )
guiSetAlpha ( FONDO , 0.80000001192093 )
guiSetProperty ( FONDO , "Disabled" , "true" )
COCO = guiCreateStaticImage ( 0.96 , 0.95 , 0.03 , 0.04 , "coco.png" , true , PANEL )
guiSetAlpha ( COCO , 0.80000001192093 )
guiSetProperty ( COCO , "Disabled" , "true" )
COMPRAR = guiCreateStaticImage ( 0.74 , 0.74 , 0.19 , 0.10 , "comprar.png" , true , PANEL )
COMPRARBRI = guiCreateStaticImage ( 0.74 , 0.74 , 0.19 , 0.10 , "comprarbri.png" , true , PANEL )
guiSetVisible ( COMPRARBRI , false )
LISTAMOTOS = guiCreateGridList ( 0.04 , 0.19 , 0.25 , 0.34 , true , PANEL )
guiGridListSetSelectionMode ( LISTAMOTOS , 0 )
NOMBREM = guiGridListAddColumn ( LISTAMOTOS , "Motos" , 0.4 )
PRECIOM = guiGridListAddColumn ( LISTAMOTOS , "Precio $" , 0.3 )
COMPRARM = guiCreateButton ( 0.74 , 0.74 , 0.19 , 0.10 , "Moto" , true , PANEL )
guiSetAlpha ( COMPRARM , 0.00 )
guiSetVisible ( COMPRARM , false )
LISTACARROS = guiCreateGridList ( 0.30 , 0.19 , 0.30 , 0.34 , true , PANEL )
guiGridListSetSelectionMode ( LISTACARROS , 0 )
NOMBREC = guiGridListAddColumn ( LISTACARROS , "Carros" , 0.4 )
PRECIOC = guiGridListAddColumn ( LISTACARROS , "Precio $" , 0.3 )
COMPRARC = guiCreateButton ( 0.74 , 0.74 , 0.19 , 0.10 , "Carro" , true , PANEL )
guiSetAlpha ( COMPRARC , 0.00 )
guiSetVisible ( COMPRARC , false )
LISTAAVIONES = guiCreateGridList ( 0.61 , 0.19 , 0.25 , 0.34 , true , PANEL )
guiGridListSetSelectionMode ( LISTAAVIONES , 0 )
NOMBREA = guiGridListAddColumn ( LISTAAVIONES , "Aviones" , 0.4 )
PRECIOA = guiGridListAddColumn ( LISTAAVIONES , "Precio $" , 0.3 )
COMPRARA = guiCreateButton ( 0.74 , 0.74 , 0.19 , 0.10 , "Avion" , true , PANEL )
guiSetAlpha ( COMPRARA , 0.00 )
guiSetVisible ( COMPRARA , false )
LISTABOTES = guiCreateGridList ( 0.08 , 0.59 , 0.30 , 0.34 , true , PANEL )
guiGridListSetSelectionMode ( LISTABOTES , 0 )
NOMBREB = guiGridListAddColumn ( LISTABOTES , "Botes" , 0.4 )
PRECIOB = guiGridListAddColumn ( LISTABOTES , "Precio $" , 0.3 )
COMPRARB = guiCreateButton ( 0.74 , 0.74 , 0.19 , 0.10 , "Bote" , true , PANEL )
guiSetAlpha ( COMPRARB , 0.00 )
guiSetVisible ( COMPRARB , false )
LISTAVIP = guiCreateGridList ( 0.40 , 0.59 , 0.25 , 0.34 , true , PANEL )
guiGridListSetSelectionMode ( LISTAVIP , 0 )
NOMBREV = guiGridListAddColumn ( LISTAVIP , "VIP" , 0.4 )
PRECIOV = guiGridListAddColumn ( LISTAVIP , "Precio $" , 0.3 )
COMPRARV = guiCreateButton ( 0.74 , 0.74 , 0.19 , 0.10 , "Vip" , true , PANEL )
guiSetAlpha ( COMPRARV , 0.00 )
guiSetVisible ( COMPRARV , false )
IMAGENBOTES = guiCreateStaticImage ( 0.15 , 0.54 , 0.17 , 0.05 , "botes.png" , true , PANEL )
IMAGENVIP = guiCreateStaticImage ( 0.44 , 0.54 , 0.17 , 0.05 , "vip.png" , true , PANEL )
IMAGENMOTOS = guiCreateStaticImage ( 0.08 , 0.14 , 0.17 , 0.05 , "motos.png" , true , PANEL )
IMAGENCARROS = guiCreateStaticImage ( 0.36 , 0.14 , 0.17 , 0.05 , "carros.png" , true , PANEL )
IMAGENAVIONES = guiCreateStaticImage ( 0.65 , 0.14 , 0.17 , 0.05 , "aviones.png" , true , PANEL )
CERRAR = guiCreateButton ( 0.94 , 0.05 , 0.04 , 0.06 , "X" , true , PANEL )
-- MOTOS
local motos = {
{ 462 , 1500 };
{ 448 , 1500 };
{ 581 , 2000 };
{ 521 , 2500 };
{ 468 , 3500 };
{ 586 , 4000 };
{ 461 , 5000 };
{ 463 , 7000 };
{ 522 , 10000 }
}
for i , v in ipairs ( motos ) do
local carName = getVehicleNameFromModel ( v [ 1 ])
local row = guiGridListAddRow ( LISTAMOTOS )
guiGridListSetItemText ( LISTAMOTOS , row , 1 , carName , false , true )
guiGridListSetItemText ( LISTAMOTOS , row , 2 , tostring ( v [ 2 ]), false , true )
end
function botonmoto ( button , state , absoluteX , absoluteYe )
guiSetVisible ( COMPRARC , false )
guiSetVisible ( COMPRARM , true )
guiSetVisible ( COMPRARA , false )
guiSetVisible ( COMPRARB , false )
guiSetVisible ( COMPRARV , false )
end
addEventHandler ( "onClientGUIClick" , LISTAMOTOS , botonmoto )
function onClientCarBuy ( button , state , absoluteX , absoluteYe )
if ( source == COMPRARM ) then guiSetVisible ( PANEL , false ) showCursor ( false )
if ( guiGridListGetSelectedItem ( LISTAMOTOS )) then
local carName = guiGridListGetItemText ( LISTAMOTOS , guiGridListGetSelectedItem ( LISTAMOTOS ), 1 )
local carID = getVehicleModelFromName ( carName )
local carCost = guiGridListGetItemText ( LISTAMOTOS , guiGridListGetSelectedItem ( LISTAMOTOS ), 2 )
triggerServerEvent ( "carBuy" , getLocalPlayer (), carID , carCost , carName )
end
end
end
addEventHandler ( "onClientGUIClick" , COMPRARM , onClientCarBuy )
-- CARROS
local carros = {
{ 496 , 3000 , 3 };
{ 600 , 3500 , 3 };
{ 491 , 3500 , 3 };
{ 549 , 4000 , 3 };
{ 445 , 4500 , 4 };
{ 589 , 4500 , 4 };
{ 602 , 5000 , 4 };
{ 405 , 6000 , 5 };
{ 550 , 7000 , 5 };
{ 587 , 8500 , 7 };
{ 507 , 8500 , 7 };
{ 567 , 9000 , 8 };
{ 534 , 9500 , 8 };
{ 412 , 10000 , 10 };
{ 475 , 12000 , 12 };
{ 603 , 12500 , 12 };
{ 429 , 15000 , 12 };
{ 560 , 35000 , 15 };
{ 541 , 50000 , 18 };
{ 415 , 60000 , 19 };
{ 411 , 80000 , 20 };
}
for i , v in ipairs ( carros ) do
local carName = getVehicleNameFromModel ( v [ 1 ])
local row = guiGridListAddRow ( LISTACARROS )
guiGridListSetItemText ( LISTACARROS , row , 1 , carName , false , true )
guiGridListSetItemText ( LISTACARROS , row , 2 , tostring ( v [ 2 ]), false , true )
end
function botonmoto ( button , state , absoluteX , absoluteYe )
guiSetVisible ( COMPRARC , true )
guiSetVisible ( COMPRARM , false )
guiSetVisible ( COMPRARA , false )
guiSetVisible ( COMPRARB , false )
guiSetVisible ( COMPRARV , false )
end
addEventHandler ( "onClientGUIClick" , LISTACARROS , botonmoto )
function onClientCarBuy ( button , state , absoluteX , absoluteYe )
if ( source == COMPRARC ) then guiSetVisible ( PANEL , false ) showCursor ( false )
if ( guiGridListGetSelectedItem ( LISTACARROS )) then
local carName = guiGridListGetItemText ( LISTACARROS , guiGridListGetSelectedItem ( LISTACARROS ), 1 )
local carID = getVehicleModelFromName ( carName )
local carCost = guiGridListGetItemText ( LISTACARROS , guiGridListGetSelectedItem ( LISTACARROS ), 2 )
triggerServerEvent ( "carBuy" , getLocalPlayer (), carID , carCost , carName )
end
end
end
addEventHandler ( "onClientGUIClick" , COMPRARC , onClientCarBuy )
-- AVIONES
local aviones = {
{ 512 , 15000 , 10 };
{ 513 , 20000 , 12 };
{ 488 , 35000 , 15 };
{ 549 , 36000 , 15 };
{ 593 , 36000 , 15 };
{ 417 , 40000 , 16 };
{ 563 , 45000 , 16 };
{ 460 , 50000 , 18 };
{ 476 , 60000 , 18 };
{ 487 , 80000 , 20 };
{ 519 , 90000 , 20 };
{ 592 , 100000 , 25 };
{ 553 , 120000 , 27 };
{ 577 , 150000 , 29 };
}
for i , v in ipairs ( aviones ) do
local carName = getVehicleNameFromModel ( v [ 1 ])
local row = guiGridListAddRow ( LISTAAVIONES )
guiGridListSetItemText ( LISTAAVIONES , row , 1 , carName , false , true )
guiGridListSetItemText ( LISTAAVIONES , row , 2 , tostring ( v [ 2 ]), false , true )
end
function botonmoto ( button , state , absoluteX , absoluteYe )
guiSetVisible ( COMPRARA , true )
guiSetVisible ( COMPRARM , false )
guiSetVisible ( COMPRARC , false )
guiSetVisible ( COMPRARB , false )
guiSetVisible ( COMPRARV , false )
end
addEventHandler ( "onClientGUIClick" , LISTAAVIONES , botonmoto )
function onClientCarBuy ( button , state , absoluteX , absoluteYe )
if ( source == COMPRARA ) then guiSetVisible ( PANEL , false ) showCursor ( false )
if ( guiGridListGetSelectedItem ( LISTAAVIONES )) then
local carName = guiGridListGetItemText ( LISTAAVIONES , guiGridListGetSelectedItem ( LISTAAVIONES ), 1 )
local carID = getVehicleModelFromName ( carName )
local carCost = guiGridListGetItemText ( LISTAAVIONES , guiGridListGetSelectedItem ( LISTAAVIONES ), 2 )
triggerServerEvent ( "carBuy" , getLocalPlayer (), carID , carCost , carName )
end
end
end
addEventHandler ( "onClientGUIClick" , COMPRARA , onClientCarBuy )
-- BOTES
local botes = {
{ 473 , 2500 , 1 };
{ 472 , 4500 , 2 };
{ 595 , 6000 , 3 };
{ 453 , 10000 , 3 };
{ 454 , 12000 , 4 };
{ 452 , 16000 , 6 };
{ 493 , 30000 , 10 };
{ 453 , 40000 , 12 };
{ 446 , 50000 , 15 };
{ 484 , 10000 , 25 };
}
for i , v in ipairs ( botes ) do
local carName = getVehicleNameFromModel ( v [ 1 ])
local row = guiGridListAddRow ( LISTABOTES )
guiGridListSetItemText ( LISTABOTES , row , 1 , carName , false , true )
guiGridListSetItemText ( LISTABOTES , row , 2 , tostring ( v [ 2 ]), false , true )
end
function botonmoto ( button , state , absoluteX , absoluteYe )
guiSetVisible ( COMPRARB , true )
guiSetVisible ( COMPRARC , false )
guiSetVisible ( COMPRARM , false )
guiSetVisible ( COMPRARA , false )
guiSetVisible ( COMPRARV , false )
end
addEventHandler ( "onClientGUIClick" , LISTABOTES , botonmoto )
function onClientCarBuy ( button , state , absoluteX , absoluteYe )
if ( source == COMPRARB ) then guiSetVisible ( PANEL , false ) showCursor ( false )
if ( guiGridListGetSelectedItem ( LISTABOTES )) then
local carName = guiGridListGetItemText ( LISTABOTES , guiGridListGetSelectedItem ( LISTABOTES ), 1 )
local carID = getVehicleModelFromName ( carName )
local carCost = guiGridListGetItemText ( LISTABOTES , guiGridListGetSelectedItem ( LISTABOTES ), 2 )
triggerServerEvent ( "carBuy" , getLocalPlayer (), carID , carCost , carName )
end
end
end
addEventHandler ( "onClientGUIClick" , COMPRARB , onClientCarBuy )
-- VIP
local vip = {
{ 447 , 450000 };
{ 520 , 1000000 };
{ 425 , 2000000 };
{ 432 , 5000000 };
}
for i , v in ipairs ( vip ) do
local carName = getVehicleNameFromModel ( v [ 1 ])
local row = guiGridListAddRow ( LISTAVIP )
guiGridListSetItemText ( LISTAVIP , row , 1 , carName , false , true )
guiGridListSetItemText ( LISTAVIP , row , 2 , tostring ( v [ 2 ]), false , true )
end
function botonmoto ( button , state , absoluteX , absoluteYe )
guiSetVisible ( COMPRARV , true )
guiSetVisible ( COMPRARB , false )
guiSetVisible ( COMPRARC , false )
guiSetVisible ( COMPRARM , false )
guiSetVisible ( COMPRARA , false )
end
addEventHandler ( "onClientGUIClick" , LISTAVIP , botonmoto )
function onClientCarBuy ( button , state , absoluteX , absoluteYe )
if ( source == COMPRARV ) then guiSetVisible ( PANEL , false ) showCursor ( false )
if ( guiGridListGetSelectedItem ( LISTAVIP )) then
local carName = guiGridListGetItemText ( LISTAVIP , guiGridListGetSelectedItem ( LISTAVIP ), 1 )
local carID = getVehicleModelFromName ( carName )
local carCost = guiGridListGetItemText ( LISTAVIP , guiGridListGetSelectedItem ( LISTAVIP ), 2 )
triggerServerEvent ( "carBuyv" , getLocalPlayer (), carID , carCost , carName )
end
end
end
addEventHandler ( "onClientGUIClick" , COMPRARV , onClientCarBuy )
-- Efecto boton entrar --
addEventHandler ( "onClientMouseEnter" , COMPRARM ,
function ( )
guiSetVisible ( COMPRAR , false )
guiSetVisible ( COMPRARBRI , true )
end , false )
addEventHandler ( "onClientMouseLeave" , COMPRARM ,
function ( )
guiSetVisible ( COMPRARBRI , false )
guiSetVisible ( COMPRAR , true )
end , false )
-- Efecto boton entrar --
addEventHandler ( "onClientMouseEnter" , COMPRARC ,
function ( )
guiSetVisible ( COMPRAR , false )
guiSetVisible ( COMPRARBRI , true )
end , false )
addEventHandler ( "onClientMouseLeave" , COMPRARC ,
function ( )
guiSetVisible ( COMPRARBRI , false )
guiSetVisible ( COMPRAR , true )
end , false )
-- Efecto boton entrar --
addEventHandler ( "onClientMouseEnter" , COMPRARA ,
function ( )
guiSetVisible ( COMPRAR , false )
guiSetVisible ( COMPRARBRI , true )
end , false )
addEventHandler ( "onClientMouseLeave" , COMPRARA ,
function ( )
guiSetVisible ( COMPRARBRI , false )
guiSetVisible ( COMPRAR , true )
end , false )
-- Efecto boton entrar --
addEventHandler ( "onClientMouseEnter" , COMPRARB ,
function ( )
guiSetVisible ( COMPRAR , false )
guiSetVisible ( COMPRARBRI , true )
end , false )
addEventHandler ( "onClientMouseLeave" , COMPRARB ,
function ( )
guiSetVisible ( COMPRARBRI , false )
guiSetVisible ( COMPRAR , true )
end , false )
-- Efecto boton entrar --
addEventHandler ( "onClientMouseEnter" , COMPRARV ,
function ( )
guiSetVisible ( COMPRAR , false )
guiSetVisible ( COMPRARBRI , true )
end , false )
addEventHandler ( "onClientMouseLeave" , COMPRARV ,
function ( )
guiSetVisible ( COMPRARBRI , false )
guiSetVisible ( COMPRAR , true )
end , false )
---
function closeShop ()
if guiGetVisible ( PANEL ) then
guiSetVisible ( PANEL , false )
showCursor ( false )
end
end
addEventHandler ( "onClientGUIClick" , CERRAR , closeShop )
bindKey ( "F2" , "down" ,
function()
if guiGetVisible ( PANEL ) == false then
guiSetVisible ( PANEL , true )
showCursor ( true )
else
guiSetVisible ( PANEL , false )
showCursor ( false )
end
end
)
[color=red][/color][color=yellow][/color]
[ Komentarz dodany przez: Emm : 2016-07-24, 22:36 ]
Doda?em znaczniki lua/code
Ostatnio zmieniony przez Emm 2016-07-24, 22:35, w całości zmieniany 2 razy
Wysłany: 2016-07-22, 21:34
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3729 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
Lemonfm , ja bym zrobi? tak
na
createMarker ( - 1988.5 , 246.2 , 34 , "cylinder" , 2 , 128 , 255 , 159 , 200 )
oczywi?cie te tam liczby to jest przyk?ad ale kordy , po prostu zminisz .
My?le ,?e b?dzie dzia?a? .
Tagi: salon :: samochodowy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: