tim260 Posted January 7, 2012 Posted January 7, 2012 please find whats wrong function check ( player, seat, jacked ) if getElementData(source, "private") then if getElementData(source, "owner") == getAccountName(getPlayerAccount(player)) then else cancelEvent() outputChatBox("This is not your car!", player) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), check ) funtion settcar(player, cmd, who) local who = getPlayerFromName(who) local co = getPedOccupiedVehicle(who) setElementData(co, "private", true) setElementData(co, "owner", getPlayerName(who)) outputChatBox("Now this car owner is "..getPlayerName(who), player) end addCommandHandler("setowner", settcar)
Mefisto_PL Posted January 7, 2012 Posted January 7, 2012 function check ( player, seat, jacked ) if getElementData(source, "private") then if getElementData(source, "owner") == getAccountName(getPlayerAccount(player)) then else cancelEvent() outputChatBox("This is not your car!", player) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), check ) function settcar(player, cmd, who) local who = getPlayerFromName(who) local co = getPedOccupiedVehicle(who) setElementData(co, "private", true) setElementData(co, "owner", getPlayerName(who)) outputChatBox("Now this car owner is "..getPlayerName(who), player) end addCommandHandler("setowner", settcar)
tim260 Posted January 7, 2012 Author Posted January 7, 2012 function check ( player, seat, jacked ) if getElementData(source, "private") then if getElementData(source, "owner") == getAccountName(getPlayerAccount(player)) then else cancelEvent() outputChatBox("This is not your car!", player) end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), check ) function settcar(player, cmd, who) local who = getPlayerFromName(who) local co = getPedOccupiedVehicle(who) setElementData(co, "private", true) setElementData(co, "owner", getPlayerName(who)) outputChatBox("Now this car owner is "..getPlayerName(who), player) end addCommandHandler("setowner", settcar) its the same..
tim260 Posted January 7, 2012 Author Posted January 7, 2012 What's the error?/debugscript 3 = expected near setcar on line 12 edit : [2012-01-07 16:00:42] SCRIPT ERROR: [gameplay]\setownercar\zabe.lua:12: '=' expected near 'settcar' [2012-01-07 16:00:42] WARNING: Loading script failed: [gameplay]\setownercar\zabe.lua:12: '=' expected near 'settcar'
Mefisto_PL Posted January 7, 2012 Posted January 7, 2012 Not the same... Check this line: 12 In tim260 version is: funtion settcar(player, cmd, who) In my version is: function settcar(player, cmd, who) It's a error, but small. I make it often.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now