Jump to content

Piorun

Members
  • Posts

    421
  • Joined

  • Last visited

Posts posted by Piorun

  1. Hi,

    I'm working now on PHP. One thing i really like is OOP in this lang. We have simple classes, objects and also inheritance, interfaces etc. It would be awesome if it would be possible for ex. create PoliceVehicle class which gets all methods and variables from Vehicle class and work like a normal vehicle. It would improve iterations (cause i don't need to do getElementsByType('vehicle') and iterate all vehicle but simple getElementsByType('policevehicle')) and speed up searching. And also it would optimalize code.

    One more thing - improve OOP in Lua by adding class() function or some constructor() for constructor etc. It would be really pro and awesome!

  2. This function only creates texture (like dxCreateTexture), not drawing it.

    What are you talking about alpha? It's working fine. I will edit this func to work with setting color (via HEX). Also i will try to add some extra parametr like which corner should be rounded etc. Have fun :).

  3. Guys, I found bug. Dev can't pass Vector through trigger. For ex.

    Server

      
    triggerClientEvent("showVector",resourceRoot,Vector3(300,300,300)) 
      
    

    Client

      
    addEvent("showVector",true) 
    addEventHandler("showVector",resourceRoot, 
    function(vector) -- vector is nil 
    outputChatBox(tostring(vector)) -- nil 
    end) 
    

  4. Hi,

    I want to make class which will be extended with Vehicle class in LUA. I know about OOP in other langs and I know how to create class in MTA. I did anyway inh with 2 classes made by me but I want to create class which will be extended by Vehicle class (have same methods and variables as Vehicle class and also mine vars and methods wrote by me).

  5. Guys, i need help. I have this code:

      
    function PoliceVehicle(model,position) 
        local policeVeh = Element("policeVehicle") 
        local vehicle = Vehicle(model,position) 
      
        local PoliceVehicleMT = getmetatable(policeVeh) 
        local VehicleMT = getmetatable(vehicle) 
        PoliceVehicleMT.__parent = VehicleMT 
        local PoliceVehicleClass = getmetatable(policeVeh).__class 
      
        function PoliceVehicleClass:output() 
            outputChatBox("test") 
        end 
      
        return policeVeh 
    end 
      
    

    which is contructor of PoliceVehicle class and i want to that class implement all methods from Vehicle class (and also if i for ex. write

      
    local police = PoliceVehicle(...) 
    police:setPosition(Vector3(x,y,z)) 
      
    

    I want to change that object position [also vehicle]).

    This code i shown doesn't work.

  6. Hi guys,

    I want to ask you how to hide chat permanently. I tried to cancelEvent after "showchat" command but it doesnt work so then i tried to unbind 't' and 'y' key - doesn't work. I used on c-side

    unbindKey("t") 
    

    unbindKey("y") 
    

  7. There should be possibility to input files from local computer. I know it's kinda risky because someone could paste .lua code and execeute it but hey - let's add some client validation like in javascript or html ver. 5. It will help to create some big server where ppl dont need to use web page to implement some models or textures.

  8. Which ver. of MTA should i install on my Linux distro to work normally with MTA using Wine. I have low end laptop so i don't think so i can run Ubuntu + VMWare (anyway i don't want to install another OS to run just only one program or it's some diffrent option to run MTA without installing Windows using VMWare). Meybe not so low end but it's really slow. On my PC where i have good hardware I'm running Ubuntu + VMWare really smooth.

    Please help :P.

×
×
  • Create New...