Jump to content

تصليح خطآ صغير


Recommended Posts

السلام عليكم

انا سويت لوحه قريد ليست بها سكنات

ولكن عند الضغط مرتين على القريد ما يعطينى السكن

الكود

  
  
  
  
List = { 
      
    { 'skin',41}, 
    { 'skin2',45 }, 
    { 'skin3',54}, 
    { 'skin4',91 }, 
} 
  
for i, c in ipairs ( List ) do 
    local aRow = guiGridListAddRow ( GridList[1] ) 
        guiGridListSetItemText ( GridList[1], aRow, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList[1], aRow, 2, c[1], false, false ) 
        guiGridListSetItemColor(GridList[1], aRow, 2, 255, 255, 0, 255) 
        guiGridListSetItemColor(GridList[1], aRow, 1, 0, 255, 255, 255) 
end 
  
    addEventHandler("onClientDoubleGUIClick", root , 
    function() 
        if source == GridList[1] then 
               ID = guiGridListGetItemText ( GridList[1], guiGridListGetSelectedItem ( GridList[1] ), 3 ) 
                triggerServerEvent("skin", localPlayer , S ,ID) 
        end 
    end ) 
  
  

addEvent ("skin" , true) 
addEventHandler("skin",root, 
function(ID) 
  
setPedSkin (source, ID ) 
  
end 
) 

Link to comment

  
  
  
  
List = { 
      
    { 'skin',41}, 
    { 'skin2',45 }, 
    { 'skin3',54}, 
    { 'skin4',91 }, 
} 
  
for i, c in ipairs ( List ) do 
    local aRow = guiGridListAddRow ( GridList[1] ) 
        guiGridListSetItemText ( GridList[1], aRow, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList[1], aRow, 2, c[1], false, false ) 
        guiGridListSetItemColor(GridList[1], aRow, 2, 255, 255, 0, 255) 
        guiGridListSetItemColor(GridList[1], aRow, 1, 0, 255, 255, 255) 
end 
  
    addEventHandler("onClientDoubleGUIClick", root , 
    function() 
        if source == GridList[1] then 
               ID = guiGridListGetItemText ( GridList[1], guiGridListGetSelectedItem ( GridList[1] ), 3 ) 
                triggerServerEvent("skin", localPlayer , ID) 
        end 
    end ) 
  
  
Link to comment
-- Client 
  
List = { 
      
    { 'skin',41}, 
    { 'skin2',45 }, 
    { 'skin3',54}, 
    { 'skin4',91 }, 
} 
  
for i, c in ipairs ( List ) do 
    local aRow = guiGridListAddRow ( GridList[1] ) 
        guiGridListSetItemText ( GridList[1], aRow, 1, ''..i..'', false, false ) 
        guiGridListSetItemText ( GridList[1], aRow, 2, c[1], false, false ) 
        guiGridListSetItemData ( GridList[1], aRow,1,c[2] ) 
        guiGridListSetItemColor(GridList[1], aRow, 2, 255, 255, 0, 255) 
        guiGridListSetItemColor(GridList[1], aRow, 1, 0, 255, 255, 255) 
end 
  
addEventHandler('onClientGUIClick',root, function ( )  
if ( source == GridList[1] ) then 
if ( guiGridListGetSelectedItem ( GridList[1] ) ~= -1 ) then 
triggerServerEvent('onSkinAdd',localPlayer,guiGridListGetItemData(GridList[1],guiGridListGetSelectedItem(GridList[1]),1)) 
end 
end 
end 
) 
  
-- Server 
  
addEvent('onSkinAdd',true) 
addEventHandler('onSkinAdd',root, function ( id )  
setElementModel(client,id) 
end) 

Link to comment

client

addEventHandler("onClientGUIDoubleClick", resourceRoot, function( ) 
    if source == GridList[1] then 
        local row = guiGridListGetSelectedItem(GridList[1]) 
        if row ~= -1 then 
            triggerServerEvent("skin", localPlayer, tonumber(guiGridListGetItemText(GridList[1], row, 2))) 
        end 
    end 
end) 

server

addEvent("skin", true) 
addEventHandler("skin", root, function(ID) 
    if ID then 
        setElementModel(source, ID) 
    end 
end) 
Edited by Guest
Link to comment
client

addEventHandler("onClientDoubleGUIClick", resourceRoot, function( ) 
    if source == GridList[1] then 
        local row = guiGridListGetSelectedItem(GridList[1]) 
        if row ~= -1 then 
            triggerServerEvent("skin", localPlayer, tonumber(guiGridListGetItemText(GridList[1], row, 2))) 
        end 
    end 
end) 

server

addEvent("skin", true) 
addEventHandler("skin", root, function(ID) 
    if ID then 
        setElementModel(source, ID) 
    end 
end) 

اسم الحدث غلط المفروض يكون

onClientGUIDoubleClick

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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