You can use the resource I made long time ago, it's a shop where you can buy: Weapons, weapon skills, vehicles.
Link: https://community.multitheftauto.com/ind ... ils&id=720
function checkSod ( button, state )
if ( source == sodButton1 ) then
if ( guiGetText ( sod1 ) == "1" ) then
outputChatBox ( "Test" )
end
end
end
addEventHandler ( "onClientGUIClick", guiRoot, checkSod )
If that doesn't work, then post your entire script.
First argument of: onClientGUIClick is the mouse button used, not the state.
function checkSod ( button, state )
if ( state == "left" ) then
if ( source == sodButton1 ) then
if ( guiGetText ( sod1 ) == "1" ) then
outputChatBox ( "Test" ) -- This function has no visibleTo argument in the client side.
end
end
end
end
addEventHandler ( "onClientGUIClick", guiRoot, checkSod )
1: En el server side te falta un end.
2: En el client side usas las funciones: guiGridListGetSelectedItem, guiGridListGetItemText pero no las definis.
3: Envias "getRootElement" en lugar de "localPlayer" en triggerServerEvent.
4: Mejor no sigo.
@Jaysds1: Your code is wrong still.
I told him what was wrong in the Spanish section, but he doesn't seem to understand the basics of Lua, my guess is that he want someone to give him the fixed script.
function createLine()
for k,wood in ipairs(woodTable) do
if ( wood and isElement ( wood ) ) then
local xW, yW, zW = getElementPosition(wood) -- I GET ERROR HERE... bad argument @ getElementPosition
end
end
end
function createLine()
for k,wood in ipairs(woodTable) do
outputChatBox ( k ..": ".. tostring ( wood ) )
local xW, yW, zW = getElementPosition(wood) -- I GET ERROR HERE... bad argument @ getElementPosition
end
end