Client Side
addEventHandler("onClientGUIClick", resourceRoot, function( )
if source == GUIEditor.button[1] then
triggerServerEvent("onPlayerBuyPlace", localPlayer, 1642.4000244141, -2238.3999023438, 12.39999961853, 91.98, 250)
-- elseif source == Button then -- اذ تبي تضيف مكان زيادة
-- triggerServerEvent("onPlayerBuyPlace", localPlayer, x, y, z, rotation, price)
-- x, y, z -- الاحداثيات
-- rotation -- الاتجاه او الدوران
-- price -- السعر
end
end)
Server Side
addEvent("onPlayerBuyPlace",true)
addEventHandler("onPlayerBuyPlace", root, function(x, y, z, rotation, price)
if getPlayerMoney(source) >= price then
takePlayerMoney(source, price)
outputChatBox("*****************", source)
setElementPosition(source, x, y, z)
setElementRotation(source, 0, 0, rotation)
else
outputChatBox("You Don't Have Money", source)
end
end)