Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That doesn't make any sense, OGF, localPlayer is not the problem, and his problem is only on line 86. This line: triggerServerEvent ( "buyGuns" ) Should be: triggerServerEvent ( "buyGuns", localPlayer )
  2. That function is only used for created weapons, it doesn't work for what you want.
  3. Castillo

    need help

    If it's impossible, mind explaining how all the game hosting companys work? because most of them got a control panel to restart/stop/start the server. @Machine, Micro: I don't know anything about this I'm afraid.
  4. Server side: addCommandHandler triggerClientEvent Client side: addEvent addEventHandler dxDrawText Event client side to render the text: onClientRender
  5. connectToDb = dbConnect( "sqlite", "housing.db" ) addEventHandler('onResourceStart',getResourceRootElement(), function () if (not connectToDb) then outputChatBox("ERROR: Housing.db has failed to load!",255,0,0) else --dbExec ( connectToDb, "CREATE TABLE IF NOT EXISTS 'houses' ( city TEXT PRIMARY KEY, zone INT, x INT, y INT, z INT, int INT, dim INT )" ) dbExec ( connectToDb, "CREATE TABLE IF NOT EXISTS 'houses' ( rowID INT PRIMARY KEY, city TEXT, zone TEXT, x INT, y INT, z INT, int INT, dim INT )" ) end end ) addCommandHandler("house", function (player) local x,y,z = getElementPosition(player) local city = getZoneName(x,y,z,true) local zone = getZoneName(x,y,z) -- x,y,z,int,dim createHouse(city,zone,x,y,z,math.random(1,10),math.random(0,5000)) end ) function createHouse(city,zone,x,y,z,int,dim) dbExec ( handler, "INSERT INTO houses ( city, zone, x, y, z, int, dim ) VALUES ( ?, ?, ?, ?, ?, ?, ? )", city, zone, x, y, z, int, dim ) newHousePickup = createPickup(x,y,z,3,1272,500) end
  6. I didn't help you, your script had many mistakes, I made you a new one.
  7. https://community.multitheftauto.com/in ... ls&id=6635 I posted the script on the forums, yet he uploaded it as his own. DONE
  8. Castillo

    Help

    Timers aren't efficient.
  9. Well, if they made it for you, why don't you ask them to fix it? all this sounds strange.
  10. You obviously didn't make this script, so mind telling us where did you get it?
  11. local peakPlayers = getAccountData ( getAccount ( "Console" ), "playerPeak" ) or getPlayerCount ( ) function playerCountUp ( ) if ( peakPlayers < getPlayerCount ( ) ) then peakPlayers = ( peakPlayers + 1 ) setAccountData ( getAccount ( "Console" ), "playerPeak", peakPlayers ) outputChatBox ( "New player peak reached, ".. peakPlayers .."! Here is some bonus cash.", getRootElement(), 0, 0, 255 ) for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do if ( peakPlayers < 1000 ) then givePlayerMoney ( thePlayer, 4000 ) end end end end addEventHandler ( "onPlayerLogin", getRootElement(), playerCountUp ) Try it.
  12. Use tables and getTickCount to determine the last time he tried to enter.
  13. Castillo

    Help

    You can use tables and getTickCount, you need to store the current tick count when the player spins, then when he tries to spin again, it'll check if the time has passed.
  14. local playerGear = 0 local playerVehicleSeat = 0 function setPlayerGear( key ) if key == "num_add" then if playerGear < 5 then playerGear = playerGear + 1 playSoundFrontEnd( 4 ) end elseif key == "num_sub" then if playerGear > -1 then playerGear = playerGear - 1 playSoundFrontEnd( 4 ) end end end function setPlayerGearByCmd( command ) if command == "gearu" then setPlayerGear( "num_add" ) elseif command == "geard" then setPlayerGear( "num_sub" ) end end function createImage() gearbox = guiCreateStaticImage(0.8232,0.5508,0.1172,0.1563,"gearbox.png",true) marker = guiCreateStaticImage(0.4667,0.4667,0.0833,0.0833,"marker.png",true,gearbox) end function manual() local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) if vehicle and playerVehicleSeat == 0 then local vehicleGear = getVehicleCurrentGear( vehicle ) local velX, velY, velZ = getElementVelocity( vehicle ) local vType = getVehicleType( vehicle ) local velX2 = math.abs( velX ) local velY2 = math.abs( velY ) local velZ2 = math.abs( velZ ) local visible local dvel if playerGear == 1 then dvel = 1.055 elseif playerGear == 2 then dvel = 1.012 elseif playerGear == 3 then dvel = 1.005 elseif playerGear == 4 then dvel = 1.0025 end if vType ~= "Plane" and vType ~= "Helicopter" and vType ~= "Boat" and vType ~= "Trailer" and vType ~= "Train" and vType ~= "BMX" then visible = true if playerGear > 0 then toggleControl( "accelerate", true ) toggleControl( "brake_reverse", false ) if playerGear < vehicleGear then if math.max( velX2, velY2, velZ2 ) ~= velZ2 then local x, y = velX / dvel, velY / dvel setElementVelocity ( vehicle, x, y, velZ ) end end elseif playerGear == 0 then toggleControl( "accelerate", false ) toggleControl( "brake_reverse", false ) elseif playerGear == -1 then toggleControl( "accelerate", false ) toggleControl( "brake_reverse", true ) local state = false local keys = getBoundKeys( "accelerate" ) for key,_ in pairs(keys) do if getKeyState( key ) then state = true end end local keys2 = getBoundKeys( "brake_reverse" ) for key,_ in pairs(keys2) do if getKeyState( key ) then state = true end end if state then setControlState( "accelerate", false ) setControlState( "brake_reverse", true ) else setControlState( "accelerate", false ) setControlState( "brake_reverse", false ) end end if vehicleGear < playerGear then if math.max( velX2, velY2, velZ2 ) ~= velZ2 then local s = ( ( ( playerGear - vehicleGear ) / 100 ) + 1 ) s = s * ( ( ( playerGear - vehicleGear ) / 120 ) + 1 ) local x, y = velX / s, velY / s setElementVelocity ( vehicle, x, y, velZ ) end end else visible = false toggleControl( "accelerate", true ) toggleControl( "brake_reverse", true ) end if visible then guiSetVisible( gearbox, true ) if playerGear == -1 then guiSetPosition( marker, 0.1583, 0.275, true ) elseif playerGear == 0 then guiSetPosition( marker, 0.4667, 0.4667, true ) elseif playerGear == 1 then guiSetPosition( marker, 0.3583, 0.275, true ) elseif playerGear == 2 then guiSetPosition( marker, 0.3583, 0.6417, true ) elseif playerGear == 3 then guiSetPosition( marker, 0.5583, 0.275, true ) elseif playerGear == 4 then guiSetPosition( marker, 0.5583, 0.6417, true ) elseif playerGear == 5 then guiSetPosition( marker, 0.7583, 0.275, true ) end else guiSetVisible( gearbox, false ) end else playerGear = 0 guiSetVisible( gearbox, false ) end end function seat( player, seat ) if ( player == localPlayer ) then playerVehicleSeat = seat end end bindKey( "num_add", "up", setPlayerGear ) bindKey( "num_sub", "up", setPlayerGear ) addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), createImage ) addEventHandler( "onClientRender", getRootElement(), manual ) addEventHandler( "onClientVehicleEnter", getRootElement(), seat ) addCommandHandler( "gearu", setPlayerGearByCmd ) addCommandHandler( "geard", setPlayerGearByCmd ) Try it.
  15. Castillo

    Help

    Topic moved to maps support section.
  16. You can add the reload sound to the "reload" resource that comes with MTA. About bullet shell, what do you mean by that? you mean play new sounds when you shoot?
  17. Make sure that you put the script as a folder, and not as a zip file.
  18. That meta is wrong, you put "Client", not "client".
  19. Topic moved to scripting section.
  20. La vida maxima que puede tener un ped/jugador es 200% con la stat de vida activada, para tener 1000% usa el extra_health mio.
  21. Si lo pone en el client side, entonces tiene que usar localPlayer, no source.
  22. Envez de instalar el archivo en en la carpeta resources, instalalo en la carpeta [gamemodes]. Nada más. Da igual donde lo pongas, ya que las categorias las podes crear vos mismo, esas vienen con el MTA para estar mas ordenado nada mas.
  23. We don't give support with leaked scripts. Topic locked.
×
×
  • Create New...