Jump to content

[Help]Skin Shop


3B00DG4MER

Recommended Posts

Posted

Hello,Skin shop lol :D,I think it's too hard this time !

all things alright

one thing only which is when i click buy then nothing happened

Client Side:

    addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() 
  
    local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) 
        if ( tostring(Selected)  ) then 
  
            for i=1, 67 do 
            clothe = getClothesByTypeIndex ( 0, i ) 
            crow = guiGridListAddRow ( NameClothes_Grid ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) 
            end 
         
        end 
         
    end) 
     
     
    addEventHandler("onClientGUIClick",Clothes_Window, 
    function (b) 
    if b == "left" then 
    if source == CloseClothesWindow then 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    elseif source == BuyClothes then 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    addPedClothes ( source, tostring(Selected2), "vest", Selected ) 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end) 

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted

Try this:

   addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() 
  
    local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) 
        if ( tostring(Selected)  ) then 
  
            for i=1, 67 do 
            clothe = getClothesByTypeIndex ( 0, i ) 
            crow = guiGridListAddRow ( NameClothes_Grid ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) 
            end 
        
        end 
        
    end) 
    
    
    addEventHandler("onClientGUIClick",root, 
    function (b) 
    if b == "left" then 
    if source == CloseClothesWindow then 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    elseif source == BuyClothes then 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    addPedClothes ( source, tostring(Selected2), "vest", Selected ) 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end) 

Developer @ MYVAL

Posted
Try this:
   addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() 
  
    local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) 
        if ( tostring(Selected)  ) then 
  
            for i=1, 67 do 
            clothe = getClothesByTypeIndex ( 0, i ) 
            crow = guiGridListAddRow ( NameClothes_Grid ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) 
            end 
        
        end 
        
    end) 
    
    
    addEventHandler("onClientGUIClick",root, 
    function (b) 
    if b == "left" then 
    if source == CloseClothesWindow then 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    elseif source == BuyClothes then 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    addPedClothes ( source, tostring(Selected2), "vest", Selected ) 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end) 

Not work :(

I tried to add outputchatbox

But nothing

mean Button problem ? :)

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted

Removed 'end' on line 24, should work now.

   addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() 
  
    local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) 
        if ( tostring(Selected)  ) then 
  
            for i=1, 67 do 
            clothe = getClothesByTypeIndex ( 0, i ) 
            crow = guiGridListAddRow ( NameClothes_Grid ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) 
            end 
        
        end 
        
    end) 
    
    
    addEventHandler("onClientGUIClick",Clothes_Window, 
    function (b) 
    if b == "left" then 
    if source == CloseClothesWindow then 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    elseif source == BuyClothes then 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    addPedClothes ( source, tostring(Selected2), "vest", Selected ) 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end) 

Datastore - Store data to a database quickly. (Useful for saving scripted tables)

Posted
Removed 'end' on line 24, should work now.
   addEventHandler("onClientGUIDoubleClick",TypeClothes_Grid,function() 
  
    local Selected = guiGridListGetItemText ( TypeClothes_Grid, guiGridListGetSelectedItem ( TypeClothes_Grid ), 1 ) 
        if ( tostring(Selected)  ) then 
  
            for i=1, 67 do 
            clothe = getClothesByTypeIndex ( 0, i ) 
            crow = guiGridListAddRow ( NameClothes_Grid ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colname, tostring ( clothe ), false, false ) 
            guiGridListSetItemText ( NameClothes_Grid, crow, colID, tonumber ( i ), false, false ) 
            end 
        
        end 
        
    end) 
    
    
    addEventHandler("onClientGUIClick",Clothes_Window, 
    function (b) 
    if b == "left" then 
    if source == CloseClothesWindow then 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    elseif source == BuyClothes then 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    addPedClothes ( source, tostring(Selected2), "vest", Selected ) 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end) 

Thanks man !!

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted

Now problem is can't add clothes :(

Client side :

addEventHandler("onClientGUIClick",Clothes_Window, 
    function (beer) 
    if b == "left" then 
    if source == BuyClothes then 
    guiSetVisible(Clothes_Window,false) 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    triggerServerEvent("getClothes",localPlayer,Selected,Selected2) 
    outputChatBox("You Selected"..Selected.."for 0$") 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end 
    end) 

Server Side:

function get_Clothes ( Selected, Selected2 ) 
addPedClothes (source,""..tostring(Selected2).."", "hoodyamerc", tonumber(Selected) ) 
end 
addEvent("getClothes",true) 
addEventHandler("getClothes",getRootElement(),get_Clothes) 

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted
Now problem is can't add clothes :(

Client side :

addEventHandler("onClientGUIClick",Clothes_Window, 
    function (beer) 
    if b == "left" then 
    if source == BuyClothes then 
    guiSetVisible(Clothes_Window,false) 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    triggerServerEvent("getClothes",localPlayer,Selected,Selected2) 
    outputChatBox("You Selected"..Selected.."for 0$") 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end 
    end) 

Server Side:

function get_Clothes ( Selected, Selected2 ) 
addPedClothes (source,""..tostring(Selected2).."", "hoodyamerc", tonumber(Selected) ) 
end 
addEvent("getClothes",true) 
addEventHandler("getClothes",getRootElement(),get_Clothes) 

No one ? :'(

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted

Try this ( I dont know if works ) (NOTE: Client Side Only)

addEventHandler("onClientGUIClick",Clothes_Window, 
    function (b) 
    if b == "left" then 
    if source == BuyClothes then 
    guiSetVisible(Clothes_Window,false) 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    addPedClothes (localPlayer,tostring(Selected2),tostring(Selected2), tonumber(Selected)) 
    outputChatBox("You selected a "..Selected2.." for $25") 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end 
    end) 

Datastore - Store data to a database quickly. (Useful for saving scripted tables)

Posted
Try this ( I dont know if works ) (NOTE: Client Side Only)
addEventHandler("onClientGUIClick",Clothes_Window, 
    function (b) 
    if b == "left" then 
    if source == BuyClothes then 
    guiSetVisible(Clothes_Window,false) 
    local Selected = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 1 ) 
    local Selected2 = guiGridListGetItemText ( NameClothes_Grid, guiGridListGetSelectedItem ( NameClothes_Grid ), 2 ) 
    addPedClothes (localPlayer,tostring(Selected2),tostring(Selected2), tonumber(Selected)) 
    outputChatBox("You selected a "..Selected2.." for $25") 
    guiSetVisible(Clothes_Window,false) 
    showCursor(false) 
    end 
    end 
    end) 

Not working

SO,NO ONE CAN FIX IT

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted

You are using the same string for clothes texture and clothes model.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
You are using the same string for clothes texture and clothes model.

How do i get Texture from index then ?

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted

My code works, for only some of the clothes like 'vest' etc..Maybe the local variable 'selected' isn't the type of clothes

Datastore - Store data to a database quickly. (Useful for saving scripted tables)

Posted
There is a function. Just look for it in wiki.

i mean how do i get model from texture or index ?

:x

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

Posted
getClothesByTypeIndex 

This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type).

Datastore - Store data to a database quickly. (Useful for saving scripted tables)

Posted
getClothesByTypeIndex 

This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type).

Thanks it work

I'm waiting u to add it

lol :lol:

SAF/SAO - 30%

Skype: Themerzoug2020

in-game name:3B00DG4MER

xOG7h1J.png

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...