Jump to content

Need some help


sckatchof

Recommended Posts

hi guys i have a probelm when i click buy skin it dose not change why

client side:

.... 
... 
addEventHandler ( "onClientGUIClick", Buttonbuyskin, buySkin ) 
..... 
... 
.. 
function buySkin ()  
local soum = 350 
local money = getPlayerMoney(localPlayer) 
if (money < soum) then 
outputChatBox ( "You dont have enough money!", 225, 0, 0) 
else     
local finalSkinID = guiGridListGetItemText ( SkinGrid, guiGridListGetSelectedItem ( SkinGrid ), 2, 1 ) 
triggerServerEvent("buySkin", getRootElement(), localPlayer, finalSkinID) 
end 
end 

server side :

function buyskin ( thePlayer, finalSkinID ) 
        local skinmodel = getElementModel(finalSkinID) 
getElementModel(thePlayer, finalSkinID) 
end 
addEvent ( "buySkin", true ) 
addEventHandler ( "buySkin", getRootElement(), buyskin ) 

Link to comment

--Client side--

addEventHandler("onClientGUIClick", Buttonbuyskin, 
function()  
local skinID = guiGridListGetItemText(SkinGrid, guiGridListGetSelectedItem(SkinGrid ),2,1) 
triggerServerEvent("buySkin", localPlayer, skinID) 
end) 

--Server Side--

addEvent("buySkin", true) 
addEventHandler("buySkin", root, 
function(skinID) 
     if (getPlayerMoney(source) >= 350) then 
          setElementModel(source,skinID) 
     else 
          outputChatBox("You dont have enough money!",source,225,0,0) 
     end 
end) 

Link to comment
addEventHandler("onClientGUIClick", Buttonbuyskin, 
function() 
local skinID = guiGridListGetItemText(SkinGrid, guiGridListGetSelectedItem(SkinGrid),1) 
triggerServerEvent("buySkin", localPlayer, skinID) 
end) 

Edited by Guest
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...