Ihnify

Members
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Ihnify

  • Rank
    Square

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ihnify

    Global function

    Hi! Tell me how to use/make the function globally. For example, find out the ID of the connected database. In addition to the export function
  2. Ihnify

    [help] example

    An example of the spawn system
  3. Ihnify

    [help] example

    Hi! Please show an example of a good code so that I can continue to work with it approximately (or also)
  4. Please tell me that it is better to use map manager, or mysql/sql database, if possible, show an example.
  5. Ihnify

    Tips, examples

    understand, thanks. if you are Russian, it was possible in Russian)
  6. Ihnify

    Tips, examples

    I understand, and is it ok to use it? Or better element data?
  7. Ihnify

    Tips, examples

    for example, if I do this tiggerClientEvent ( source, "fuel", source, Vehicle.fuel [ vehicle ] ) client local vehicleFuel addEvent ( "fuel", true ) addEventHandler ( "fuel", root, function ( fuel ) vehicleFuel = fuel end ) and use vehicleFuel on speedometer, or element data this is normal?
  8. Ihnify

    Tips, examples

    there are no errors as such, I just need to know how to usually work server-client, take data from the server, or client
  9. Ihnify

    Tips, examples

    init = function() for index in pairs ( Vehicle.vehicles ) do Vehicle.vehicleObject [ index ] = createVehicle( Vehicle.vehicles[index][1], Vector3( Vehicle.vehicles[index][2], Vehicle.vehicles[index][3] , Vehicle.vehicles [ index ] [ 4 ] ), 0, 0, Vehicle.vehicles [ index ] [ 5 ] ) Vehicle.fuel [ index ] = 1.5 end end; addEventHandler ( "onResourceStart", resourceRoot, Vehicle.init ) Did I make a good script "fuel system"? I load the cars and set them a certain amount of fuel. Then I take the fuel data, and use it on the client, in the speedometer. Are there standards for writing systems, or give an example of how to use it correctly in the future. I appreciate that. Learn language lua +- month
  10. Ihnify

    Tips, examples

    How well did the script "fuel system" that is is, download auto download auto install Qty benzyl Then I take this gasoline and show on the client, if there are tips on how to do better, or as an example of how to further make such scripts - write, I will be glad Study lua +- month server local timer = {} addEventHandler("onPlayerVehicleEnter", root, function ( theVehicle, seat ) if seat == 0 then for i = 1, #Vehicle.vehicles do if theVehicle == Vehicle.vehicleObject [ i ] then if(Vehicle.fuel [ i ] <= 0.1) then return outputChatBox ( "В авто закончился бензин", source ) end outputChatBox ( "enter ok", source ) local thePlayer = source timer [ source ] = setTimer ( function () if ( Vehicle.fuel [ i ] <= 0.1 ) then outputChatBox ( "В авто закончился бензин", thePlayer ) setVehicleEngineState ( theVehicle, false ) if isTimer ( sourceTimer ) then killTimer ( sourceTimer ) end end speedVehicle = getElementSpeed ( theVehicle ) kmhFloor = math.floor ( speedVehicle ) Vehicle.fuel [ i ] = Vehicle.fuel[ i ] - ( speedVehicle + 1 ) / 15000; setElementData ( theVehicle, "Fuel", Vehicle.fuel [ i ] ) end, 300, 0 ) end end end end)
  11. Насколько хорошо сделал скрипт "система бензина", то есть есть загрузка авто, в загрузке авто устанавливаем кол-во бенза Потом я беру данный бензина и показываю на клиенте, если есть советы как сделать лучше, или как пример как в дальнейшем делать подобные скрипты - пишите, буду рад Изучаю ЯП +- месяц ServerSide : local timer = {} addEventHandler("onPlayerVehicleEnter", root, function ( theVehicle, seat ) if seat == 0 then for i = 1, #Vehicle.vehicles do if theVehicle == Vehicle.vehicleObject [ i ] then if(Vehicle.fuel [ i ] <= 0.1) then return outputChatBox ( "В авто закончился бензин", source ) end outputChatBox ( "enter ok", source ) local thePlayer = source timer [ source ] = setTimer ( function () if ( Vehicle.fuel [ i ] <= 0.1 ) then outputChatBox ( "В авто закончился бензин", thePlayer ) setVehicleEngineState ( theVehicle, false ) if isTimer ( sourceTimer ) then killTimer ( sourceTimer ) end end speedVehicle = getElementSpeed ( theVehicle ) kmhFloor = math.floor ( speedVehicle ) Vehicle.fuel [ i ] = Vehicle.fuel[ i ] - ( speedVehicle + 1 ) / 15000; setElementData ( theVehicle, "Fuel", Vehicle.fuel [ i ] ) end, 300, 0 ) end end end end)