Captain Cody

Scripting Moderators
  • Content Count

    2,992
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. How would I make a command for it
  2. What would I use to make /spawn make a player spawn at the spawn when he uses the command
  3. this script is made so that when a mechanic with skin 50 enters some ones car that is damaged it askes the driver if they need their car repaired When the driver selects yes nothing happens and it should reapair the car Nothing unusual happens on debug script
  4. Ive been working on this mechanic script but I cant get it to repair car when the person in car selects that he wants his car repaired-server Side local pending_vehicles = { } local skinmechanic = { [ 50 ] = true } addEvent( getResourceName( resource ) .. ":accepted", true ) addEventHandler( getResourceName( resource ) .. ":accepted", root, function( ) local vehicle = getPedOccupiedVehicle( client ) if ( not vehicle ) or ( getPedOccupiedVehicleSeat( client ) ~= 1 ) or ( not skinmechanic[ getElementModel( client ) ] ) then return end local driver = getVehicleController( vehicle ) if ( driver ) and ( getElementType( driver ) == "player" ) then if ( getElementHealth( vehicle ) < 800 ) then fadeCamera( source, false, 1.0 ) setTimer( function( vehicle, source ) if ( isElement( vehicle ) ) and ( getElementHealth( vehicle ) < 800 ) then givePlayerMoney( source, 3000 ) fixVehicle( vehicle ) end if ( pending_vehicles[ source ] ) then pending_vehicles[ source ] = nil end fadeCamera( source, true, 1.0 ) end, 2500, 1, vehicle, source ) else outputChatBox( "Error: The vehicle is already in good condition.", source, 255, 0, 0, false ) end end end ) local vehicle_types = { [ "Automobile" ] = true, [ "Helicopter" ] = true, [ "Monster Truck" ] = true } addEventHandler( "onPlayerVehicleEnter", root, function( vehicle, seat, jacked ) if ( jacked ) or ( not skinmechanic[ getElementModel( source ) ] ) or ( not vehicle_types[ getVehicleType( vehicle ) ] ) or ( seat ~= 1 ) then return end local driver = getVehicleController( vehicle ) if ( driver ) and ( getElementType( driver ) == "player" ) then playSoundFrontEnd( source, 40 ) pending_vehicles[ source ] = driver triggerClientEvent( driver, getResourceName( resource ) .. ":display", source ) end end ) addEventHandler( "onPlayerVehicleStartExit", root, function( vehicle ) if ( not skinmechanic[ getElementModel( source ) ] ) or ( not vehicle_types[ getVehicleType( vehicle ) ] ) then return end if ( pending_vehicles[ source ] ) and ( isElement( pending_vehicles[ source ] ) ) then triggerClientEvent( pending_vehicles[ source ], getResourceName( resource ) .. ":display", source, false ) pending_vehicles[ source ] = nil end end ) Client Side - local theMechanic local GUIEditor = { button = { }, window = { }, label = { } } function toggleMechanicDisplay( forced_state ) if ( ( not forced_state ) and ( isElement( GUIEditor.window[ 1 ] ) ) ) or ( isElement( GUIEditor.window[ 1 ] ) ) then destroyElement( GUIEditor.window[ 1 ] ) showCursor( false ) return end GUIEditor.window[ 1 ] = guiCreateWindow( 526, 287, 334, 142, "Mechanic", false ) guiWindowSetSizable( GUIEditor.window[ 1 ], false ) GUIEditor.label[ 1 ] = guiCreateLabel( 60, 42, 209, 17, "Do you accept to get your car repaired?", false, GUIEditor.window[ 1 ] ) GUIEditor.button[ 1 ] = guiCreateButton( 9, 92, 150, 40, "Accept", false, GUIEditor.window[ 1 ] ) GUIEditor.button[ 2 ] = guiCreateButton( 169, 91, 155, 41, "Close", false, GUIEditor.window[ 1 ] ) addEventHandler( "onClientGUIClick", GUIEditor.button[ 1 ], function( ) if ( isElement( theMechanic ) ) then triggerServerEvent( getResourceName( resource ) .. ":accepted", theMechanic ) end toggleMechanicDisplay( ) end ) addEventHandler( "onClientGUIClick", GUIEditor.button[ 2 ], function( ) toggleMechanicDisplay( ) end ) showCursor( true ) end addEvent( getResourceName( resource ) .. ":display", true ) addEventHandler( getResourceName( resource ) .. ":display", root, function( forced_state ) if ( isElement( source ) ) and ( getElementType( source ) == "player" ) then theMechanic = source toggleMechanicDisplay( forced_state or true ) else end end ) And While I have this is there any way to make a wrench mod that will repair car? I have a model for it and the weapon to replace I
  5. Captain Cody

    play with me :)

    You can come on my server Lewizrpg we are always looking for new people
  6. I have a Brand new RP server with real cars nice staff and more the name is BoDRpG