Hi guys! What's wrong here?
Client:
local skin = {
{" Skin1" , 280 },
{" Skin2" , 281 }
GUIEditor_GridList[30] = guiCreateGridList ( 0.01, 0.09, 0.5, 0.9, true, GUIEditor_Window[3] ) guiGridListSetSortingEnabled ( list, false )
GUIEditor_GridListAddColumn[30] = guiGridListAddColumn ( GUIEditor_GridList[30], "Название скина", 0.8 )
GUIEditor_GridListAddColumn[31] = guiGridListAddColumn ( GUIEditor_GridList[30], "ID", 0 )
for i, skin in ipairs (skin) do
GUIEditor_teleRows[30] = guiGridListAddRow(GUIEditor_GridList[30])
GUIEditor_GridListSetItemText[30] = guiGridListSetItemText ( GUIEditor_GridList[30], GUIEditor_teleRows[30], 1, skin[1], false, false )
GUIEditor_GridListSetItemText[31] = guiGridListSetItemText ( GUIEditor_GridList[30], GUIEditor_teleRows[30], 2, skin[2], false, false )
end
GUIEditor_Button[112] = guiCreateButton (350, 80, 140, 20, "set", false, GUIEditor_Window[3])
function spawnFreeSkin ()
if ( source == GUIEditor_Button[112] ) then
local row,col = guiGridListGetSelectedItem(GUIEditor_GridList[30])
local mid = guiGridListGetItemText(GUIEditor_GridList[30],row,2)
if ( row and col ) then
triggerServerEvent("spawnskin",localPlayer,mid)
end
end
end
addEventHandler("onClientGUIClick",root,spawnFreeSkin)
Server:
Skin = {}
function spawnskins(mid)
if ( Skin[source] ) then
setElementModel(Skin[source],mid)
end
end
addEvent("spawnskin",true)
addEventHandler("spawnskin",root,spawnskins)