PleaseScript Posted October 23, 2012 Share Posted October 23, 2012 Please someone help me I want the following when entering / allvehicles It's the car I want so kind / allvehicles 512 Ae all server won the car 512 Could someone help me Thanks. function consoleCreateVehicle ( sourcePlayer, commandName, ... ) if ( sourcePlayer ) then local x, y, z = getElementPosition ( sourcePlayer ) -- get the player's position local vehicleName = table.concat({...}, " ") local vehicleID = getVehicleModelFromName ( vehicleName ) local newVehicle = createVehicle ( vehicleID, x, y, z ) warpPedIntoVehicle (sourcePlayer , newVehicle ) end end addCommandHandler ( "allvehicle", consoleCreateVehicle ) Link to comment
Anderl Posted October 23, 2012 Share Posted October 23, 2012 addCommandHandler( "allvehicle", function( p, _, value ) --get player's position local fX, fY, fZ = getElementPosition( p ) --tries to find vehicle model value = getVehicleModelFromName( value ) if value then --creates a new vehicle near the player local _vehicle = createVehicle( value, fX, fY + 2.5, fZ ) if _vehicle then --warps the player to it warpPedIntoVehicle( p, _vehicle ) end else outputChatBox( "Unable to find vehicle model!", p, 255, 0, 0, false ) end end ) Not tested. Link to comment
PleaseScript Posted October 23, 2012 Author Share Posted October 23, 2012 addCommandHandler( "allvehicle", function( p, _, value ) --get player's position local fX, fY, fZ = getElementPosition( p ) --tries to find vehicle model value = getVehicleModelFromName( value ) if value then --creates a new vehicle near the player local _vehicle = createVehicle( value, fX, fY + 2.5, fZ ) if _vehicle then --warps the player to it warpPedIntoVehicle( p, _vehicle ) end else outputChatBox( "Unable to find vehicle model!", p, 255, 0, 0, false ) end end ) Not tested. NonO The Vehicle only doing this to me I wanted isse for all server; ( Please Help Link to comment
Anderl Posted October 23, 2012 Share Posted October 23, 2012 I didn't get what you mean. Link to comment
PleaseScript Posted October 23, 2012 Author Share Posted October 23, 2012 I didn't get what you mean. Type my friend when typing / all vehicles vai 1 car home player server. Link to comment
Castillo Posted October 23, 2012 Share Posted October 23, 2012 He wants a command to set everyone's vehicle model to the one he choose. addCommandHandler ( "allvehicles", function ( thePlayer, _, model ) local model = tonumber ( model ) if ( model ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local vehicle = getPedOccupiedVehicle ( player ) if ( vehicle ) then setElementModel ( vehicle, model ) end end end end ) Should work. 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