Jump to content

Morelli

Members
  • Posts

    69
  • Joined

  • Last visited

Posts posted by Morelli

  1. Try opening GTA San Andreas (Single Player) and adjusting the mouse settings there, before going back into MTA. Sometimes it can be caused randomly by using windows mode on a server, hence why it is recommended by the devs that you do not play in windowed mode. Windowed mode was put in for scripters who need to ALT+Tab very frequently

  2. function inicio (res) 
        local result = mysql_query(link, "SELECT * FROM torneo_clanes") --get a list of team names 
        if ( result ) then 
            for result,row in mysql_rows(result) do 
                local clanname = row["clan"] 
                createTeam( clanname ) 
            end 
        else 
            outputDebugString("mysql_query failed: (" .. mysql_errno(mysqlconnecttoserver) .. ") " .. mysql_error(mysqlconnecttoserver)) 
        end 
        mysql_free_result(result) 
    end 
      
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), inicio) 
    

    Should work in theory.

  3. I'm looking for a way to retrieve the model of a pickup.

    The pickup I've created is a custom model, using the Lua code:

    local pickup_whatever = createPickup ( 0, 0, 0, 3, 1272, 30000) 
    

    The model ID that I have used is 1272 (Blue house). I've tried getPickupAmmo and getPickupAmount but they both return zero.

    Any suggestions on how I can retrieve the model?

  4. Take a look at the MTA Wiki, in particular to GUI functions. (Specifically looking at Text Label functions) On the contrare, you may wish to keep it serverside, in that case, I recommend you take a look at TextCreateDisplay.

    Asking for some scripting help is one thing. Asking for pretty much a whole gamemode to be scripted to your personal preference is just nonsense. You'll feel a lot better once you've scripted something for yourself.

    To recap, look at these links:

    Serverside:

    TextCreateDisplay

    Clientside:

    GUISetText

    Obviously, those functions need to be used in conjunction with other functions to properly work. These are all detailed and listed in both the examples and the "See Also" links.

  5. Been bugging me since i started MTA, got it working and got down to serious gaming- sometimes the vehicle exit button does not work. You have to press it several time, and when a vehcile has been burning for a few seconds you're really pressed for time. I didn't have this problem in normal SA, or SA-MP. Hope it'll get fixed ;)

    I've seen this be influenced by a driveby vehicle script. Are you playing in a server which allows driveby with unconventional vehicles (ie: other than a sub-machine gun)?

  6. Been bugging me since i started MTA, got it working and got down to serious gaming- sometimes the vehicle exit button does not work. You have to press it several time, and when a vehcile has been burning for a few seconds you're really pressed for time. I didn't have this problem in normal SA, or SA-MP. Hope it'll get fixed ;)

    I've seen this be influenced by a driveby vehicle script. Are you playing in a server which allows driveby with unconventional vehicles (ie: other than a sub-machine gun)?

  7.        local cab1 = ( createVehicle, 514, -476, -489, 25 ) 
           local trailer1 = ( createVehicle, 584, -480, -482, 25 ) 
    

    Replace the above with:

           local cab1 = createVehicle ( 514, -476, -489, 25 ) 
           local trailer1 =  createVehicle ( 584, -480, -482, 25 ) 
    

  8.        local cab1 = ( createVehicle, 514, -476, -489, 25 ) 
           local trailer1 = ( createVehicle, 584, -480, -482, 25 ) 
    

    Replace the above with:

           local cab1 = createVehicle ( 514, -476, -489, 25 ) 
           local trailer1 =  createVehicle ( 584, -480, -482, 25 ) 
    

  9. Just follow the path instructions, it seems more than likely that there was a typo in the versions that can be downgraded.

    USA 1.01

    USA 2.00

    European 1.01

    European 2.00

    German 1.01

    German 1.00

    As you can see on the bolded line, it says versions 1.00, but it's downgrading to 1.00, so it most likely was meant to read 2.00.

    So once again, just follow whatever instructions are on that thread or included with the patch.

  10. I can't entirely agree with you on that. I believe in the principle of "sharing is caring" :wink: . People could really learn from other scripts and it also speeds up the scripting of new game modes by the community. And servers can still remain unique even after sharing their game mode.

    It is true that it helps the community, but you also have to look at it from the standpoint of a server who has poured hundreds of man hours into scripting new features, fixing bugs, doing final touches, etc. Seeing as I've already made previous reference to gamemodes being "works of art", I figure I'll work on the same point. Let's say some artist paints the Mona Lisa. He has it for display in the Louvre and it's a very popular attraction, earning him quite a name and popularity to go along with it. This isn't any old painting, it's been created in such a way that is secret and unique. One day he's pressured into revealing his secrets and before you know it, there are hundreds of "Mona Lisa's" that are created in much the same style, some with a few more or less things, others left unchanged from the original. Soon, people stop appreciating the original as much as they would've, and it soon becomes brushed into the lonely corners of the Louvre.

    Using a more practical example is the PEN1:LS gamemode, that was released on SA:MP. At the time, it was a work of art. Prior to release, it was run on a private server, which was relatively successful. Now you look, and you see servers like GF:RP (no longer), Valhalla, Everlast and LS:RP; which have all had their scripts based off PEN1:LS. The original artist - or scripter, in this case - isn't respected as much as they were origionally, but it is true that the community was able to develop and learn from the example of the script.

    The way I see it is, if you're making a gamemode for a private server, after the server has matured and the player base is all but lost, release the gamemode and allow others to thrive. What is one man's trash is another man's treasure, as the saying goes.

  11. I found out this while testing GUIs. When an element is destroyed with the function destroyElement, the script still recognises it to exist, even though the visual representation of it (whatever it may be), ceases to exist. A sample code illustrating this can be found below.

    function test( button, state, sx, sy, x, y, z, elem, gui ) 
        Grid = guiCreateGridList ( 0.5, 0.5, 0.3, 0.2, true ) 
        destroyElement( Grid ) 
        if ( Grid ) then 
            outputChatBox( "Yes") 
        else 
            outputChatBox( "No") 
        end 
    end 
      
    addCommandHandler( "o", test) 
    

  12. I'm just familiarising myself with the GUI functions and I haven't yet seen anything regarding a drop down menu.

    Is it possible to create? (I'm pretty sure that it is, just that I've been looking for it in the wrong places)

  13. If more people start coding unique gamemodes then a wide range of gamemodes will be available to suit to the wants, desires and style of people. SA:MP has a relatively large and sustained player base because there is a wide range of servers to appeal to most people. If you want to play cops and robbers - bang, you've got a selection of servers to choose from. Want to roleplay? Once again a wide variety to choose from. Deathmatch? No problem, just pop into one of the many servers there.

    I think what MTA:SA:DM is lacking, is the lack of choice. I mean, the Blue platform itself is an open canvas. What some scripters are doing is drawing a black circle and calling it art. Only a small selection of the community will appreciate it and treat it as a work of art. Come on people, let's make a museum!

  14. I found a bug again ^^ (it´s good so it´s bug free when you fixed it :) )

    On every marker on the server i get gas! and when i don´t in a verhicle it says "go in a vehicle first (or so)"

    Fix that by editing the file cvehiclefuel.lua from:

    function onEnterRefillArea(player,sDimension) 
        triggerClientEvent("onGasRefill",getRootElement(),true) 
    end 
    addEventHandler("onMarkerHit",getRootElement(),onEnterRefillArea) 
      
    function onExitRefillArea(playerplayer,sDimension) 
            triggerClientEvent("onGasRefill",getRootElement(),false) 
    end 
    addEventHandler("onMarkerLeave",getRootElement(),onExitRefillArea) 
    

    to:

    function onEnterRefillArea(player,sDimension) 
        local veh isPlayerInVehicle ( player ) 
        if ( veh == true ) then 
            triggerClientEvent("onGasRefill",getRootElement(),true) 
        end 
    end 
    addEventHandler("onMarkerHit",getRootElement(),onEnterRefillArea) 
      
    function onExitRefillArea(playerplayer,sDimension) 
        local veh isPlayerInVehicle ( player ) -- Check if the player is in a vehicle 
        if ( veh == true ) then -- If they are, therefore "true", then continue with the function 
            triggerClientEvent("onGasRefill",getRootElement(),false) 
        end -- The "else" part doesn't need to be defined, because we don't want anything to happen, if it isn't true. 
    end 
    addEventHandler("onMarkerLeave",getRootElement(),onExitRefillArea) 
    

    Essentially, it serves as a check to make to that the player is in a vehicle when they 'hit' the markers. This should stop it spitting out that message about not being in a vehicle.

  15. Hey, I'm just reading through your source for this and I've noticed something odd. You have "oX,oY,oZ = getElementPosition(getLocalPlayer())" (found in cvehiclefuel_c.lua) to be triggered on onClientResourceStart. I find this strikingly odd because you later use this co-ordinate position to check the distance of the first render of the distance. Theoretically, wouldn't this mean that if when the resource is started, the player does not immediately get into a vehicle, but decides to walk all the way from one side of the map to another, and then get into a vehicle, the distance measured on the first render would be large enough to take away a large proportion of the fuel. I'm not too sure that I'm convinced that it would even work properly if one player exits a vehicle and then walks a great distance before entering another.

    It's just some food for thought.

    (PS: Yes I have tested and my theory is correct)

    EDIT:

    Solution is to change oX,oY,oZ = getElementPosition(getLocalPlayer()) from being triggered by onClientResourceStart and move it to be triggered by onClientVehicleEnter.

  16. Either create a vehicle in a .map file or in a Lua gamemode using this function createVehicle. If you want them to respawn, use the Lua function toggleVehicleRespawn and set it to be true. You'll also want to set how long after a vehicle is exploded for it to respawn, so set it with the Lua function setVehicleRespawnDelay. Just to be sure that people don't drive the car and park it somewhere else, have it respawn when it is idle. Use the Lua function SetVehicleIdleRespawnDelay to set when you want to respawn when it's idle. And lastly, you'll want to tell the server where to respawn it. Set it using the Lua function SetVehicleRespawnPosition.

    Regards,

    Morelli.

  17. So now I have added all SF gas stations, but I'm having troubles with LS i found only the one near Groove...

    There's one in north Vinewood, also. Those are the only two in Los Santos (city), however there is also another in Dilimore.

    To take money away from a player, include the triggerServerEvent function into your client script and have it correspond to TakePlayerMoney, which is a server-side function. You'll need to include some optional parameters, such as the source of the trigger (which player) and to amount to subtract.

×
×
  • Create New...