Fabio(GNR) Posted December 29, 2010 Share Posted December 29, 2010 im trying to create something that attaches the player to the vehicle, like /attach nameofvehicleowner, it should get the vehicle "name" from the name entered at the command as parameter.... but i kinda got problems it says bad argument at getPlayerName and at getPedOccupiedVehicle, what i can understand... but i didnt really find much about command parameters, my script: function attachtoveh ( playerSource, commandName, name ) names = getPlayerName ( name ) vehicle = getPedOccupiedVehicle ( names ) if vehicle then atttachElements ( playerSource, vehicle ) end end addCommandHandler ( "attach", attachtoveh ) ( there probably comes that class=kw6, its from site i guess cause its not in my script ) Link to comment
Castillo Posted December 29, 2010 Share Posted December 29, 2010 try, function attachtoveh ( playerSource, commandName, name ) names = getPlayerFromName ( name ) if names then vehicle = getPedOccupiedVehicle ( names ) if vehicle then attachElements ( playerSource, vehicle ) end end end addCommandHandler ( "attach", attachtoveh ) Link to comment
Fabio(GNR) Posted December 29, 2010 Author Share Posted December 29, 2010 try, function attachtoveh ( playerSource, commandName, name ) names = getPlayerFromName ( name ) if names then vehicle = getPedOccupiedVehicle ( names ) if vehicle then attachElements ( playerSource, vehicle ) end end end addCommandHandler ( "attach", attachtoveh ) Thanks will try as soon as possible ( in 10 minutes ) EDIT: Works, thanks 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