function resetData()
local account = getPlayerAccount(source)
setAccountData(account, "spawned", "0")
end
addEventHandler("onPlayerLogin", root, resetData)
local account = getPlayerAccount(source)
if(tostring(getAccountData(account, "spawned"))=="0") then
setAccountData(account, "spawned", "1")
-- Spawn code here
else
outputChatBox("Sorry, you can't spawn more than 1 vehicle.", source, 255, 0, 0, true)
end
Pilot team marker
addEventHandler("onPlayerSpawn", getRootElement(),
function()
for _, player in ipairs(getElementsByType("player")) do
setElementVisibleTo(pilotMark, player, false)
end
for _, player in ipairs(getPlayersInTeam(teamPilot)) do
setElementVisibleTo(pilotMark, player, true)
end
end
)