Platin Posted January 28, 2013 Posted January 28, 2013 Debería aparecer un menu con un set para skins, pero no funca. Alguna solución? Client Wnd = guiCreateWindow ( 0.2, 0.2, 0.25, 0.5, "Elige tu Skin", true ) guiSetAlpha( Wnd, 0 ) button = guiCreateButton ( 0.01, 0.8, 0.99, 0.15, "Cerrar", true, Wnd ) label = guiCreateLabel ( 0.1, 0.1, 0.9, 0.1, "Doble click sobre una skin", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) vehicles = { {"SWAT", 285}, {"Sweet", 270}, {"Ryder", 300}, {"Ryder 2", 301}, {"Big Smoke", 269}, {"Big Smoke 2", 311}, {"Truth", 1}, {"Wuzi Mu", 294}, {"Claude", 299}, {"Madd Dogg", 297}, {"Mike Toreno", 295}, {"Cesar", 292}, {"OG Loc", 293}, {"T-Bone", 307}, {"Joe Pesci", 258}, {"Pimp", 249}, {"White Dealer", 29}, {"Black Dealer", 28}, {"Hiker", 26}, {"Casino Bouncer 1", 163}, {"Casino Bouncer 2", 164}, {"Drug Worker 1", 144}, {"Drug Worker 2", 145}, {"Drug Worker 3", 146}, {"Jacket Hippie", 101}, } grid = guiCreateGridList(0.01, 0.2, 0.99, 0.5, true, Wnd) guiGridListAddColumn(grid, "Skins", 0.85) for i,veh in ipairs(vehicles) do row = guiGridListAddRow(grid) -- guiGridListSetItemText(grid, row, 1, tostring(veh[1]), false, false) guiGridListSetItemData(grid, row, 1, tostring(veh[2])) end function use() local row, col = guiGridListGetSelectedItem(grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(grid, row, 1)) if model ~= "" then triggerServerEvent("useSkin", localPlayer, model) end end end addEventHandler("onClientDoubleClick", root, use, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close) function guishowc() guiSetVisible(Wnd,true) showCursor(true) end addEvent("guishowc",true) addEventHandler("guishowc", getRootElement(), guishowc) Server marker1 = createMarker( 2174.740234375, -1787.4375, 12.52192115783, "cylinder", 1, 0, 255, 255, 120 ) blip1 = createBlip( 2174.740234375, -1787.4375, 12.52192115783, 45 ) function buy(id) if getPlayerMoney(source) < 0 then outputChatBox("Paga tus deudas antes de comprar una skin.", source, 255,0,0) else reskin = setElementModel(source, id) takePlayerMoney(source, 0) playeraccount = getPlayerAccount(source) setAccountData(playeraccount, "standardskin", id) outputChatBox("Tu skin a cambiado. La ID de la skin es: "..id, source, 0,255,0) end end addEvent("useSkin",true) addEventHandler("useSkin", root, buy) function guishow(hitPlayer) triggerClientEvent (hitPlayer,"guishowc",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker,guishow) https://www.proyectomila.net @platin
Castillo Posted January 28, 2013 Posted January 28, 2013 function guishow(hitPlayer) triggerClientEvent (hitPlayer,"guishowc",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker,guishow) Ahi tenes el error, pusiste "marker" y no "marker1". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Platin Posted January 28, 2013 Author Posted January 28, 2013 function guishow(hitPlayer) triggerClientEvent (hitPlayer,"guishowc",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker,guishow) Ahi tenes el error, pusiste "marker" y no "marker1". Gracias https://www.proyectomila.net @platin
Castillo Posted January 28, 2013 Posted January 28, 2013 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts