Jump to content

[Ayuda] SetElementModel


~Funky~

Recommended Posts

Hola Denuevo, Ahora Vengo A Pedir Ayuda Por Que No Me Da El Skin y no se que esta malo me pueden ayudar? :c

Client :

  
Skn = createMarker( 2241.595703125, -1662.9560546875, 14.4765625, 'Cylinder', 1.5, 255, 255, 0, 150 ) 
  
sx,sy=guiGetScreenSize() 
  
vn = guiCreateWindow(sx/2-630,sy/2-160,384,310,"Tienda De Skins",false) 
guiSetAlpha (vn, 0.65) 
Info = guiCreateButton(347, 230, 39, 38, ">", false,vn) 
guiSetAlpha (Info, 0.86) 
BotonComprar = guiCreateButton(218, 25, 160, 49, "Comprar", false,vn) 
guiSetAlpha(BotonComprar, 0.86) 
BotonSalir = guiCreateButton(218, 276, 160, 49, "Salir", false,vn) 
guiSetAlpha(BotonSalir, 0.86) 
  
SknGrid = {{"CJ",0},{"Truth",1},{"Maccer",2},{"Andre",3},{"Bbthin",4},} 
  
ListaDeSkins = guiCreateGridList(12, 25, 191, 276, false,vn) 
guiGridListAddColumn(ListaDeSkins, "Nombre", 0.3) 
guiGridListAddColumn(ListaDeSkins, "ID", 0.5) 
guiSetAlpha(ListaDeSkins, 0.86) 
  
for i, SknS in ipairs (SknGrid) do 
row = guiGridListAddRow (ListaDeSkins) 
-- 
guiGridListSetItemText (ListaDeSkins, row, 1, tostring(SknS[1]), false, false) 
guiGridListSetItemText (ListaDeSkins, row, 2, tostring(SknS[2]), false, false) 
guiGridListSetItemData (ListaDeSkins, row, 1, tostring(SknS[2])) 
end 
  
function Usar() 
local row, col = guiGridListGetSekectedItem (ListaDeSkins) 
if (row and col and row ~= -1 and col ~= -1) then 
local model = tonumber(guiGridListGetItemData(ListaDeSkins, row, 1)) 
if model ~= "" then 
triggerServerEvent("UsarSkn", localPlayer, model) 
end 
end 
end 
addEventHandler("onClientGuiClick", BotonComprar, Usar, false) 
  
function Hola() 
dxDrawText("Valor De \nCada Skin :", 230, 309, 382, 350, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "left", "top", false, false, true, false, false) 
dxDrawText("$10.000", 230, 364, 382, 405, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "left", "top", false, false, true, false, false) 
end 
  
showCursor(false) 
guiSetVisible( vn, false ) 
guiWindowSetSizable( vn, false ) 
guiWindowSetMovable( vn, false ) 
  
function MarkerSkn(hitElement) 
             if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
                  if not guiGetVisible(vn) then 
                       guiSetVisible(vn, true) 
                       showCursor(true) 
                       setTimer ( function() 
                       addEventHandler("onClientRender", getRootElement(), Hola) 
                       end, 1000, 1 ) 
                  end 
             end 
        end 
addEventHandler("onClientMarkerHit", Skn, MarkerSkn) 
  
function ClosedSkn() 
if (source == BotonSalir) then 
guiSetVisible(vn,false) 
removeEventHandler("onClientRender", getRootElement(), Hola) 
showCursor(false) 
end 
end 
addEventHandler("onClientGUIClick", BotonSalir, ClosedSkn) 
  

Server :

  
function Comprar(id) 
setElementModel(source, id) 
end 
addEvent("UsarSkn", true) 
addEventHandler("UsarSkn", root, Comprar) 
  

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...