• Content Count

  • Joined

  • Last visited

Community Reputation

19 Decent


About Investor

  • Rank
  • Birthday 14/04/1999


  • Location
    United Kingdom
  • Occupation
    Student & 3D modeller
  • Interests
    3D modelling, law, computer gaming, game development, level design, etc

Recent Profile Visitors

1,062 profile views
  1. Investor

    [HELP] HLSL Shader

    HLSL literally stands for High Level Shader Language. HLSL is in no way exclusive to animated textures - static textures are also applied via a HLSL shader.
  2. Investor

    [HELP] problem whit GUI and some events

    -- buy_c.lua:31-36 @@ function buyDrugs() -- here baretaEdit refers to a gui-element baretaEdit = tonumber(guiGetText(baretaEdit)) -- now baretaEdit refers to a number popperEdit = tonumber(guiGetText(popperEdit)) pericaEdit = tonumber(guiGetText(pericaEdit)) lsdEdit = tonumber(guiGetText(lsdEdit)) bazukoEdit = tonumber(guiGetText(bazukoEdit)) heroinaEdit = tonumber(guiGetText(heroinaEdit)) These lines override the original variables, thus each variable, e.g. baretaEdit, stops being a gui element and becomes the tonumber'd text of the input, and on all subsequent calls to guiGetText, you're passing a number rather than a gui-element. You should prepend these variable assignments with the local keyword, so that these changes are only visible within the scope of the buyDrugs() function. -- buy_c.lua:31-36 @@ function buyDrugs() -- here baretaEdit refers to a gui-element local baretaEdit = tonumber(guiGetText(baretaEdit)) -- here the original baretaEdit is inaccessible directly, and the new baretaEdit refers -- the number inputted in the gui-element (this new baretaEdit falls out of scope when -- the function exists and is not accessible elsewhere, and doesn't override the -- original's value which remains a gui-element and can be accessed using _G["baretaEdit"] -- (_G is a table of global variables) local popperEdit = tonumber(guiGetText(popperEdit)) local pericaEdit = tonumber(guiGetText(pericaEdit)) local lsdEdit = tonumber(guiGetText(lsdEdit)) local bazukoEdit = tonumber(guiGetText(bazukoEdit)) local heroinaEdit = tonumber(guiGetText(heroinaEdit)) This technically doesn't override the value, but the reference to the variable itself. That is, the original variable still exists, it's only inaccessible because a newer one has been created and is in this scope. As a followup, I'd like to point out that a better way to do this -- buy_c.lua:43-49 @@ function buyDrugs() setElementData(getLocalPlayer(),"baretaBuyQty", baretaEdit) setElementData(getLocalPlayer(),"popperBuyQty", popperEdit) setElementData(getLocalPlayer(),"pericaBuyQty", pericaEdit) setElementData(getLocalPlayer(),"lsdBuyQty", lsdEdit) setElementData(getLocalPlayer(),"bazukoBuyQty", bazukoEdit) setElementData(getLocalPlayer(),"heroinaBuyQty", heroinaEdit) triggerServerEvent("sBuyDrugs",getLocalPlayer()) -- server.lua:30-42 @@ function serverBuyDrugs() function serverBuyDrugs() local sellerPointer = getElementData(client, "seller") if tonumber(getElementData(sellerPointer, "bQty")) >= tonumber(getElementData(client,"baretaBuyQty")) then setElementData(sellerPointer,"bQty", tonumber(getElementData(sellerPointer,"bQty"))-tonumber(getElementData(client,"baretaBuyQty"))) setElementData(client,"Weed",tonumber(getElementData(client,"Weed"))+tonumber(getElementData(client,"baretaBuyQty"))) givePlayerMoney(sellerPointer, tonumber(getElementData(sellerPointer,"bPrice"))*tonumber(getElementData(client,"baretaBuyQty"))) setPlayerMoney(client, getPlayerMoney(client) - tonumber(getElementData(sellerPointer,"bPrice"))*tonumber(getElementData(client,"baretaBuyQty"))) else return outputChatBox("El usuario no posee tal cantidad de bareta",client) end end addEvent( "sBuyDrugs", true ) addEventHandler("sBuyDrugs", root , serverBuyDrugs) is to use event parameters -- buy_c.lua:43-49 @@ function buyDrugs() triggerServerEvent("sBuyDrugs",getLocalPlayer(), baretaEdit, popperEdit, popperEdit, pericaEdit, lsdEdit, bazukoEdit, heroinaEdit) -- server.lua:30-42 @@ function serverBuyDrugs() function serverBuyDrugs(baretaQty, popperQty, pericaQty, lsdQty, bazukoQty, heroinaQty) if client then else return false end -- this line aborts the execution of the function if 'client' variable isn't set, that is, the event was faked, and not sent from an actual client local sellerPointer = getElementData(client, "seller") if tonumber(getElementData(sellerPointer, "bQty")) >= baretaQty then setElementData(sellerPointer,"bQty", tonumber(getElementData(sellerPointer,"bQty"))-baretaQty) setElementData(client,"Weed",tonumber(getElementData(client,"Weed"))+baretaQty) givePlayerMoney(sellerPointer, tonumber(getElementData(sellerPointer,"bPrice"))*baretaQty) setPlayerMoney(client, getPlayerMoney(client) - tonumber(getElementData(sellerPointer,"bPrice"))*baretaQty) else return outputChatBox("El usuario no posee tal cantidad de bareta",client) end end addEvent( "sBuyDrugs", true ) addEventHandler("sBuyDrugs", root , serverBuyDrugs) As an additional notice, you should never trust a client - add additional protections like ensuring that the seller is indeed selling drugs at the time a request to "take away his stuff and give it to me for the agreed price" is made.
  3. Investor

    engineLoadIFP error!

    Try typing ver in the F8 client console and see if you're on r12195 which is where custom IFP support was added. If not, you're probably doing something wrong when updating MTA, perhaps you have multiple installations and you update the wrong one?
  4. Investor

    [Roleplay] Legacy Roleplay [English]

    "And no script made on MTA or SAMP is copyrighted/trademarked as the one who would hold that is Rockstar Games since this is their platform. So technically under international law, nobody owns anything here. Rockstar does. Just a small course in how the law works." As far as I am aware, just because you paint a picture in someone's garage doesn't make it the garage owner's picture. The author of a piece of code has the copyrights in all cases except when that author is doing the piece of code for his employer who is paying him for his work.
  5. Investor


    Vehicles do not remain when you "close the server," so you probably have a script that spawns them back. Edit that script as to also correct the plate when being spawned.
  6. Investor

    how to add friend

    All you need to do is join the same server... so just coordinate that with your friend and you should be in one server. Unless you're speaking about a certain gamemode, then you should either specify what that is, or even better, seek help on the specific server's forum if they have one.
  7. Investor

    Something is wrong with server

    The only thing wrong I see is that it cannot connect to MTA master server list, so it will only show up as a local network server in the browser... Considering you're using Hamachi, this isn't an issue as far as I'm aware.
  8. wouldn't it be reasonable and quite logical to say to what you want your title changed to since you can't edit it yourself?
  9. Investor


    I would certainly hop on from time to time, but unless there's something really holding me on, I most probably won't be bothered to even turn on MTA
  10. Investor

    Offering server Moderation [Paid]

    get a real job mate... A moderator is usually considered a volunteer, not an employee, and therefore is not entitled to any wage or salary. No one's going to pay you for playing and moderating a server...
  11. Investor

    Needing Sponsors for Host

    A sponsor, by definition, is one who gives something free of charge. Paying them is a contradiction in terms
  12. Investor

    Wastage of Servers and players

    New players can always visit the most populous servers and see for themselves why so many people play there and why not everyone plays there. If they find that server not for them, there's always server promotions on Servers to play on forum where smart* new comers can read about servers and make their choice to visit and get a taste of each server. * by smart, I mean those who visit the forum
  13. Investor

    Wastage of Servers and players

    Many people play on smaller servers because of either a friendlier community, better relations with admin team, or perhaps just because they're so bad mannered that they're already banned on big servers. If you discourage joining small servers, no new servers will rise and only the currently big ones will just get bigger. If we want continuous improvement to gameplay, we need those innovators to start their servers fixing what other servers fail to address. What MTA does well is it creates the opportunity for anyone to host their own server. If you want big servers to get even bigger, how about you tell 'em to fill the gaps others found and used as a base for a new server.
  14. If you're saying he copied from here then by looking at the dates, it seems more like you copied him. Also, funny thing, you know what else I see copied? >
  15. Investor

    Trying to open ports

    You should definitely contact your cellular internet provider before attempting to do this yourself as it could be in violation of some terms of use and could get your phone internet access suspended.