Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Morelli

  1. You're also forgetting to place a "then" at the end of line 6.
  2. Clientside toggleControl ( "radar", false ) Serverside toggleControl ( sourcePlayer, "radar", false ) Turns off the F11 radar. Use showPlayerHudComponent to show/hide the radar in the bottom left corner.
  3. That's an issue within the script that is being hosted on the server. It's up to the scripters to fix it, so you're best raising the issue with them.
  4. 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
  5. 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.
  6. Read Ace_Gambit's post on the top of page 3 of the below thread. viewtopic.php?f=91&t=22800&st=0&sk=t&sd=a&hilit=teleport&start=30
  7. Heh, forgot all about setElementData. Nevermind then.
  8. 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?
  9. They seem to be lacking examples and thorough documentation in the wiki. How am I able to set a script (resource)'s right to specific functions (ie: ban), through scripting functions?
  10. 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.
  11. 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)?
  12. 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)?
  13. 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 )
  14. 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 )
  15. Just follow the path instructions, it seems more than likely that there was a typo in the versions that can be downgraded. 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.
  16. 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.
  17. 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)
  18. Thanks, I wasn't sure which GUI style to drop down, when an image is clicked (wasn't even sure if that's the easiest way to do it), but I've gotten the hang of it, thanks.
  19. 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)
  20. 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!
  21. 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.
  22. 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.
  23. 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.
  24. 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.
  25. Either make an object by importing a .map file, or with createObject. When you want to move an object, depending on how you want to trigger (command, etc.), use the function moveObject. Take a look at the 'Hay' code and you'll see how they move their objects.
  • Create New...