c1 = createVehicle ( 520, -2891.84765625, 460.4560546875, 4.9140625, 0, 0, 90 )
function onEnter(thePlayer)
if getElementModel(source) == 520 and getElementData(thePlayer, "class") ~= "Admin" then
cancelEvent()
outputChatBox("This Vehicle Is Locked for the Class:Admin", thePlayer, 0, 255, 0)
end
end
addEventHandler("onVehicleStartEnter", getRootElement, onEnter)
EDIT:
function data (plr)
if getElementData(plr, "class") ~="Admin" then
setElementData(plr, "class", "Admin")
outputChatBox("Your class data is: "..getElementData(plr, "class"), plr)
else
setElementData(plr, "class", "Nope")
outputChatBox("Your class data is: "..getElementData(plr, "class"), plr)
end
end
addCommandHandler("class", data)
Use this function to add/remove you and check your data so you can be sure whether your data is "Admin" or whatever.