I'm currently busy scripting a truckerjob for my server but i have a problem.
When the players hits the job marker and doesn't choose a skin the debug says:
WARNING: [gameplay]\SAFtrucker\mainServer.lua:11: Expected number, got non-convertible string. This warning may be an error in future versions.
I know what the errors means but i have no idea how to solve it.
GridList:
truckerSkinGL = guiCreateGridList(0, 100, 300, 115, false, truckerWindow)
guiGridListAddColumn(truckerSkinGL, "ID:", 0.2)
guiGridListAddColumn(truckerSkinGL, "Skin Name:", 0.7)
for i = 1, 2 do
guiGridListAddRow(truckerSkinGL)
end
guiGridListSetItemText(truckerSkinGL, 0, 1, "132", false, false)
guiGridListSetItemText(truckerSkinGL, 0, 2, "Male Trucker", false, false)
guiGridListSetItemText(truckerSkinGL, 1, 1, "198", false, false)
guiGridListSetItemText(truckerSkinGL, 1, 2, "Female Trucker", false, false)
Function:
function takeTruckerJob(button, state)
skin = guiGridListGetItemText ( truckerSkinGL, guiGridListGetSelectedItem ( truckerSkinGL ), 1 )
if skin ~= 0 then
guiSetVisible(truckerWindow, false)
showCursor(false)
triggerServerEvent ( "setTruckerTeam", localPlayer, skin)
else
outputChatBox ("** You must choose a skin!", 255, 0, 0, true)
-- exports["SAFtopBar"]:sendClientMessage("You must choose a skin!", 255, 0, 0, true, 8)
end
end
addEventHandler("onClientGUIClick", btnAccept, takeTruckerJob, false)
Problem already solved.