Jump to content

Search the Community

Showing results for tags 'server.lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 5 results

  1. I've made a server-type .Lua that should apply several 'setWeaponProperties' to the weapons. It works for some weapons, but not for others. For example, I've set the Deagle (replaced with a 6 bullet drum) to 'maxiumum_clip_ammo' = 6. This works correctly. However, with other weapons, it doesn't. Here's the script: function weaponProps () -- M9 -- setWeaponProperty(22, "pro", "maximum_clip_ammo", 14) -- Revolver -- setWeaponProperty(24, "pro", "maximum_clip_ammo", 6) -- Shotgun -- setWeaponProperty(25, "pro", "maximum_clip_ammo", 7) -- Uzi -- setWeaponProperty(28, "pro", "maximum_clip_ammo", 30) -- AKMS -- setWeaponProperty(30, "pro", "maximum_clip_ammo", 35) -- G36 -- setWeaponProperty(31, "pro", "maximum_clip_ammo", 40) -- Kar -- setWeaponProperty(33, "pro", "maximum_clip_ammo", 5) -- Mosin -- setWeaponProperty(34, "pro", "maximum_clip_ammo", 1) end addEventHandler ("onResourceStart", getRootElement(), weaponProps) Essentially, it runs as soon as the resource is started. As a beginner's test, I'm only modifying the max ammo clip. It works for: - Deagle (Revolver) - Shotgun - AK-47 (AKMS) - M4 (G36) - Rifle (Kar) - Sniper (Mosin) It doesn't work for: - Colt (M9) - UZI
  2. I've been messing around with 'setWeaponProperty' in order to understand how it works. I changed how the deagle is handled. Decided to undo the changes and, upon resetting everything, the weapon bugged. Image Any script with 'setWeaponProperty' has been removed, and the resource has been stopped and removed from metaserver.conf. Fixed after several restarts and total wipe of downloaded resources.
  3. I've found six issues so far. Being alone, everything seemed fine; with players, these issues are visible. For the sake of organization and to avoid overwhelming, I'll be going through each issue (if possible), instead of throwing everything at once —unless asked otherwise—. First in the list is about client.Lua's 'outputChatBox' showing to everyone in the chatbox: I've got two scripts in this moment that are causing said inconvenient: a quick ATM system and a teleport system. The ATM is a simple marker that, when hit, gives you $500, and outputs that information. The teleports work the same way, but instead, the set the interior, position and rotation of the player, and output a message. ATM: Client: (this example's location is at LV's gas station, next to Four Dragon's Casino). atm1 = createMarker (2123.0048828125, 897.57653808594, 10.1796875, "cylinder", 1, 0, 100, 0, 170) function moneyLawn (hitPlayer, matchingDimension) if (source == atm1) and (isPedInVehicle(hitPlayer) == false) then triggerServerEvent ("givePlayerMoney", hitPlayer) outputChatBox ("#D2691E[#FF7F50INFO#D2691E]#FFFFFF: El servidor te regaló #006400$500.", 0, 0, 0, true) end end (translation: "The server gave you $500") Server: function giveToPlayer () givePlayerMoney (root, 500) end addEvent ("giveMoney", true) addEventHandler ("giveMoney", root, giveToPlayer) Because of its close relation, I'll also name another issue regarding this script. The money is being given to all players in the server, and it is being multiplied by each player. This means that is, for example, I have 3 players in my server, when any player touches the marker, each player will be given $500 x amountOfPlayers = $1500. Teleports: (I have a few other teleports, but they only change interior and position). Client: ------------------------- -- FOUR DRAGONS CASINO -- ------------------------- inFourD = createMarker (2019.76953125, 1007.0116577148, 9.7203125, "cylinder", 1, 255, 0, 0, 153) function inFourDragons (hitPlayer, matchingDimension) if (source == inFourD) and (isPedInVehicle(hitPlayer) == true) then outputChatBox("#D2691E[#FF7F50INFO#D2691E]#FFFFFF: No se permiten vehículos dentro.", 0, 0, 0, true) elseif (source == inFourD) and (isPedInVehicle(hitPlayer) == false) then outputChatBox("#D2691E[#FF7F50INFO#D2691E]#FFFFFF: Ingresaste al casino '#DD0000Four Dragons#FFFFFF'.", 0, 0, 0, true) setElementInterior (hitPlayer, 10) setElementPosition (hitPlayer, 2016.9376220703, 1017.0843505859, 996.875 ) setElementRotation (hitPlayer, 0, 0, 90) end end addEventHandler ("onClientMarkerHit", root, inFourDragons) outFourD = createMarker (2018.9376220703, 1017.0843505859, 995.875, "cylinder", 1, 255, 0, 0, 153) setElementInterior (outFourD, 10) function outFourDragons (hitPlayer, matchingDimension) if (source == outFourD) and (isPedInVehicle(hitPlayer) == true) then outputChatBox("#D2691E[#FF7F50INFO#D2691E]#FFFFFF: No se permiten vehículos dentro.", 0, 0, 0, true) elseif (source == outFourD) and (isPedInVehicle(hitPlayer) == false) then outputChatBox("#D2691E[#FF7F50INFO#D2691E]#FFFFFF: Te retiraste del casino '#DD0000Four Dragons#FFFFFF'.", 0, 0, 0, true) setElementInterior (hitPlayer, 0) setElementPosition (hitPlayer, 2021.76953125, 1007.0116577148, 10.7203125 ) setElementRotation (hitPlayer, 0, 0, 90) end end addEventHandler ("onClientMarkerHit", root, outFourDragons) [translation: (if player in veh) "No cars allowed". (if player not in veh) "You've entered/exited "Four Dragons" casino".] There is no server. This similar post, which I'm following, says that in client-side, the output is bound to be shown just for the player who triggered the event.
  4. I've successfully created a marker that triggers 'givePlayerMoney' and 'outputChatBox' when 'onClientMarkerHit' in a client.Lua. Does the server see the amount of money the player now has? Do I have to sync the money to the server with some kind of 'getPlayerMoney' in a server.Lua? I'm planning on making a weapons GUI that works with the player's money.
  5. HI guys I downloaded Bank System . The system is such that when the player enters the marker, the ATM becomes active. But, I want to get the ATM system activated here by writing a text(Command For Example: /Bank). And in the custom area. Server.Lua The part that defines ATM activation with the marker atmls1 = 2116, -1118.3000488281,24.89999961853,0,0,162 atmls2 = 1186.1999511719,-1374.3000488281, 13.199999809265 ,0,0,90 atmls3 = 1975.4000244141,-2176.1000976563, 13.199999809265 ,0,0,178 atmsf1 = -1571.0999755859,666.59997558594, 6.8000001907349 ,0,0,88 atmsf2 = -2655.8999023438,257.89999389648, 4 ,0,0,90 atmredcounty = -74.800003051758,1116.3000488281, 19.39999961853 ,0,0,90 atmlv1 = 1715.5999755859,1533.5, 10.39 ,0,0,92 atmlv2 = 2176.6000976563,2443.6999511719, 10.5 ,0,0,178 atmlv3 = 2159.5,950.79998779297, 10.699999809265 ,0,0,270 atmler = { { 2116, -1118.3000488281,24.89999961853,0,0,162 }, { 1186.1999511719,-1374.3000488281, 13.199999809265 ,0,0,90 }, { 1975.4000244141,-2176.1000976563, 13.199999809265 ,0,0,178 }, { -1571.0999755859,666.59997558594, 6.8000001907349 ,0,0,88 }, { -2655.8999023438,257.89999389648, 4 ,0,0,90 }, {-74.800003051758,1116.3000488281, 19.39999961853 ,0,0,90 }, { 1715.5999755859,1533.5, 10.39 ,0,0,92 }, { 2176.6000976563,2443.6999511719, 10.5 ,0,0,178 }, { 2159.5,950.79998779297, 10.699999809265 ,0,0,270 } } atm = {} function displayLoadedRes ( res ) for theKey,theAtm in ipairs(atmler) do atm[theAtm] = createObject ( 2942, theAtm [ 1 ], theAtm [ 2 ], theAtm [ 3 ], theAtm [ 4 ], theAtm [ 5 ], theAtm [ 6 ] ) atmx, atmy, atmz = getElementPosition (atm[theAtm]) atmMarker = createMarker ( atmx, atmy, atmz -1, "cylinder", 1.5, 100, 100, 200, 170 ) setElementData (atmMarker,"atm",true) atmBlip = createBlipAttachedTo ( atm[theAtm], 52 ) setBlipVisibleDistance (atmBlip,200) setElementCollisionsEnabled(atm[theAtm], false) end end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), displayLoadedRes ) function MarkerHit( hitElement, matchingDimension ) if ((getElementType(hitElement) == "player")) then local acc = getPlayerAccount (hitElement) if (acc and not isGuestAccount (acc)) then local atmmi = getElementData (source,"atm") if (atmmi == true) then triggerClientEvent(hitElement, "bankaGuiAc", hitElement) end end end end addEventHandler( "onMarkerHit", getRootElement(), MarkerHit ) please guide me Thanks
×
×
  • Create New...