Jump to content

Search the Community

Showing results for tags 'variables'.

  • 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. -- Ez a server oldali script local rigPrice = 50000; function buyMiningRig(player, amount) local money = getPlayerMoney(localPlayer); if (money >= rigPrice) then money - rigPrice outputChatBox("#ffffff[Bitcoin] Sikeresen vettél egy bányászgépet!", 0, 0, 0, true); end end addCommandHandler("buyminingrig", root, buyMiningRig); -- Ez pedig a kliens oldali local maxMiningRigs = 50; local btcPrice = 1500000; local minerToggle = false; local playerBtc = 0; local miningRigs = 0; function mineBtc(howMuch) playerBtc + howMuch; if (minerToggle) then setTimer(mineBtc, 1000, 1, 0.00001); end end function displayBtc() outputChatBox("[Bitcoin] A jelenlegi bitcoinjaid száma:"..playerBtc.. ", és értéke :" ..btcprice/playerBtc); end addCommandHandler("btcamount", root, displayBtc) function toggleMinerOn() if (minerToggle == false) then minerToggle = true; outputChatBox("[Bitcoin] A bányászgép bekapcsolva!"); mineBtc(); elseif (minerToggle == true) then minerToggle = false; outputChatBox("[Bitcoin] A bányászgép kikapcsolva!"); end end addCommandHandler("togglebtc", root, toggleMiner); (A két script ugyan abba a meta-ba van beleírva!) A lényeg annyi lenne, hogy a szerver oldali scriptből hogy tudnék hozzáadni a "miningRigs" változóhoz egy adott mennyiséget. Ha valaki tudna ebbe segíteni, azt megköszönném, legyen bármilyen hosszú a script csak jó legyen.
  2. I wanted to ask if you can access variable x from scrip1.lua in script2.lua. The thing is that I have a special variable in a script that loads an XML file, and I wanted to create another script specifically for commands, and in it I wanted to acces the special variable.
  3. The case looks like this, I have a variable (Let's call it Ammo) that IS TO be in the giveWeapon function (source, 22, Ammo, true) but the problem is that this Ammo variable has the script type "client" and the function is the server script type, so how can I make this variable in this function? If someone has not understood what is going on, there is still a code to simplify... -- Client side local Ammo = 60 local AmmoMarker = createMarker(0, 0, 1, "cylinder", 2.0) local WeaponMarker = createMarker(0, 0, 1, "cylinder", 2.0) addEventHandler("onClientMarkerHit", AmmoMarker, function() Ammo = Ammo + 1 end) addEventHandler("onClientMarkerHit", WeaponMarker, function() -- Here I get a weapon, the variable "Ammo" is the number of bullets end) -- Server Side --??? Problem with importing variable "Ammo"
  4. Buenas!, les cuento que estoy teniendo un problema y no se cómo buscarlo en la wiki, y por eso recurro al foro. Lo que quiero hacer es varias paradas de recolección, y a partir de 30 segundos se le va a sumar 1 a cada parada de recolección. Estas paradas son de servidor para todos, y la idea es que cuando un jugador recolecta, se resta lo q habia sumado, para TODOS. Es decir el problema está que cuando al hacer un vector de parada X, se pone en Parada[X] ¿y ahí carga el dato, o no? Parada1 = 0 Parada2 = 0 Parada3 = 0 Parada4 = 0 function AgregarPasajeros() if (Parada1 < 8) then Parada1 = Parada1+1 if (Parada2 < 8) then Parada2 = Parada2+1 if (Parada3 < 8) then Parada3 = Parada3+1 if (Parada4 < 8) then Parada4 = Parada4+1 end end end end end addEventHandler("onResourceStart", getRootElement(AgregarPasajeros)) Timer = setTimer(AgregarPasajeros, 9000, 0) function FuncParada_58_A (DispPasajeros, pia) outputChatBox ("Se activa FUNC PARADA PRUEBA") outputChatBox ("La parada es:") outputChatBox (pia) if (Parada[pia] > 0) and (DispPasajeros > 0) then --Esto ¿? La "Parada[PIA]" con el pia que viene de cliente, está bien? outputChatBox ("Se cumple primera condicion") PasajSuben = 0 DispPasajeros = DispPasajeros -1 Parada[pia] = Parada[pia] -1 PasajSuben = PasajSuben +1 pia_server = pia setTimer ( SegundoPaso, 2000, 1, PasajSuben, pia_server) else if (Parada[pia] <= 0) or (DispPasajeros <= 0) then outputChatBox ("Se cumple segunda condicion") PasajSuben = 0 setTimer ( SegundoPaso, 1000, 1, PasajSuben, pia_server) else outputChatBox ("Algo falla") end end end addEvent( "HaciaServidor", true ) addEventHandler( "HaciaServidor", root, FuncParada_58_A )
  5. function create() FO = createTeam ( "Forever", 255, 0, 0 ) AV = createTeam ( "Avalanche", 255, 255, 255 ) GH = createTeam ( "Ghost", 255, 123, 0 ) end function addplayer(player, cmd, target, clan) local recipient = getPlayerFromName(target) local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( clan ) ) then outputChatBox("* " .. recipientName .. " is already in your clan" , player, 255, 0, 0, true) else if recipient then local r, g, b local recipientName = getPlayerName(recipient) local playerName = getPlayerName(player) outputChatBox("*" .. recipientName .. " #FFFFFF has been added #FF0000" .. clan .. "#FFFFFF clan" , player, 255, 0, 0, true) outputChatBox("*" .. playerName .. " #FFFFFF added you to #FF0000" .. clan .. "#FFFFFF Clan", recipient, 255, 0, 0, true) setPlayerTeam ( recipient, clan ) r, g, b = getTeamColor (clan) setPlayerNametagColor ( recipient, r, g, b ) aclGroupAddObject (aclGetGroup(clan), "user."..accName) else outputChatBox("Sorry, we got 0 matches to the name" .. recipientName, player, 255, 0, 0) end end end function kickplayer(player, cmd, target, clan) local recipient = getPlayerFromName(target) local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name local r,g,b if isObjectInACLGroup ("user."..accName, aclGetGroup ( clan ) ) then setPlayerTeam ( recipient, nil ) setPlayerNametagColor ( recipient, 225, 225, 225 ) aclGroupRemoveObject (aclGetGroup(clan), "user."..accName) else outputChatBox("The Player is Not in" .. clan .. "Clan" .. clan, player, 255, 0, 0) end end addCommandHandler("add", addplayer) addCommandHandler("ckick", kickplayer) addEventHandler ( "onResourceStart", getRootElement(), create ) This is a Clan system that i am working on, and when i run the script i get 2 errors , one is from the "setPlayerTeam" and the other one is from "GetTeamcolor" First One is : @ 'setPlayerTeam' [ Expected team at argument 2, got string 'AV' ] Second one is : @ 'getTeamColor' [Expected team at argument, got string 'AV'] Pls help me out , ik what this means but havent found a way to fix this And since This forum has helped me a lot , i am asking here , And also i would like to know a way to make this script to be able to Run for people In Acl group FOL , AVL and GHL ( which are clan leaders ) Thanks in Advance
×
×
  • Create New...