Lloyd Logan Posted January 16, 2014 Posted January 16, 2014 Why is nothing happening with this script? function buyVeh() local money = getPlayerMoney(source) if (money < 10000) then ("You do not have enough money to purchase this car", 255, 0, 0) else newveh = createVehicle(589, 558.748046875, -1265.380859375, 17.2421875 ) warpPedIntoVehicle(source, newveh) takePlayerMoney (source, 10000) outputChatBox("You have successfully bought a club!", 0, 255, 0) end end addCommandHandler("buyvehclub", getRootElement(), buyVeh)
Castillo Posted January 16, 2014 Posted January 16, 2014 function buyVeh ( source ) local money = getPlayerMoney ( source ) if ( money < 10000 ) then outputChatBox ( "You do not have enough money to purchase this car", source, 255, 0, 0 ) -- You forgot about 'outputChatBox' else newveh = createVehicle ( 589, 558.748046875, -1265.380859375, 17.2421875 ) warpPedIntoVehicle ( source, newveh ) takePlayerMoney ( source, 10000 ) outputChatBox ( "You have successfully bought a club!", 0, 255, 0 ) end end addCommandHandler ( "buyvehclub", buyVeh ) -- addCommandHandler doesn't have attachedTo argument.
Forrest Posted January 16, 2014 Posted January 16, 2014 God damn you Castillo, beat me to it lol. Was then posting it and got the notification for your post.
TAPL Posted January 16, 2014 Posted January 16, 2014 source is not defnied. function buyVeh ( ) Should be: function buyVeh ( source ) Also server side outputChatBox require visibleTo argument.
Lloyd Logan Posted January 16, 2014 Author Posted January 16, 2014 I just realised that! My bad, thanks guys!
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