Adde Posted June 27, 2013 Share Posted June 27, 2013 Hey, I got some problems with my "lock vehicle to AccountName" script and I hope that anyone can help me. Only the player with accountName "Addeboyy" should be able to enter. The script wont let me enter the vehicle even if it´s my acc-name that should work to enter. It outputs to chatbox to me "You can not use bla bla bla...". Nothing in debug but it must be something wrong with the getting of the account right? If I use "source" instead of "thePlayer" it doesn´t work, it says [Expected account at argument 1, got boolean] in debug. Help? rancher1 = createVehicle ( 490, 2215.8991699219, -3134.2083007813, 6.1535439491272 ) setElementRotation ( rancher1, 0, 0, 85 ) setVehicleDamageProof ( rancher1, true ) addEventHandler ( "onVehicleStartEnter", rancher1, function ( thePlayer ) local name = getAccountName ( getPlayerAccount ( thePlayer ) ) if ( name == Addeboyy ) then else outputChatBox ( "You cannot use this vehicle as it belongs to [sALA]Adde!", thePlayer, 255, 0, 0 ) cancelEvent ( ) end end ) Link to comment
iPrestege Posted June 27, 2013 Share Posted June 27, 2013 local rancher1 = createVehicle ( 490, 2215.8991699219, -3134.2083007813, 6.1535439491272 ) setElementRotation ( rancher1, 0, 0, 85 ) setVehicleDamageProof ( rancher1, true ) addEventHandler ( "onVehicleStartEnter",rancher1, function ( thePlayer ) local name = getAccountName ( getPlayerAccount ( thePlayer ) ) if ( name ~= 'Addeboyy' ) then cancelEvent ( ) outputChatBox ( "You cannot use this vehicle as it belongs to [sALA]Adde!", thePlayer, 255, 0, 0 ) end end,false ) Try it. Link to comment
Adde Posted June 27, 2013 Author Share Posted June 27, 2013 Yes it works, thx bro. LoL, that little change ^^ Link to comment
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