ويش الغلط ؟
-- Client Side
function closeb ( )
if source == b1 or source == b2 then
guiSetEnabled ( b1, false )
guiSetEnabled ( b2, false )
triggerServerEvent("Save",localPlayer)
end
end
addEventHandler("onClientGUIClick",root, closeb )
--
addEvent ( "Close", true )
function Close(b)
if (b) then
guiSetEnabled ( b1, false )
guiSetEnabled ( b2, false )
end
end
addEventHandler("Close", getRootElement(),Close)
-- Server Side
addEvent ( "Save", true )
function Save( )
local account = getPlayerAccount(source)
if account and not isGuestAccount(account) then
local b = getAccountData(account, "stats.b")
triggerClientEvent(source,"Close",source,b)
end
addEventHandler("onPlayerLogin", getRootElement(),SaveC)
end
addEventHandler("Save", getRootElement(),Save)