undefined

Members

500

1. math.random

random_number = function(first, second) if first < 0 and second < 0 then return -math.random(math.abs(first), math.abs(second)) elseif first > 0 and second < 0 then if math.random(2) == 1 then return math.random(0, first) else return -math.random(0, math.abs(second)) end elseif first < 0 and second > 0 then if math.random(2) == 1 then return -math.random(0, math.abs(first)) else return math.random(0, second) end else return math.random(first, second) end end Solved.
2. Report community resources here!

https://community.mtasa.com/?p=resources&s=details&id=15483 https://community.mtasa.com/index.php?p=resources&s=details&id=14542 DONE

4. setTimer function with OOP

player_tbl = { index = { in_zone = false, zombie_proof = false, zombies = {}, zombie_limit = 60, create_zombie = function(player) outputChatBox("test") if player.zombie_proof or not player.in_zone or isPedDead(player.element) then return end local zombie_count = 0 while zombie_count < 3 do triggerClientEvent ("find_spawn_location", player.element) zombie_count = zombie_count + 1 end end }, players = {} } addEventHandler("onResourceStart", resourceRoot, function() for i, player in ipairs(getElementsByType("player")) do local self = setmetatable({ element = player }, { __index = player_tbl.index }) table.insert(player_tbl.players, self) Timer(function(self) self:create_zombie() -- this line --self.create_zombie(self) -- or this line end, 10000, 0, self) end end) What is the cause of the mistake?
5. [REL] Weapon System

Script has 2 language(Turkish and English). You can change it with 'selected' variable in options.lua. Current language is Turkish. This script brings the limit to the player's gun and bullets. For example, the player can have a maximum of 1 melee weapon and 2 weapons. All the required properties can be changed in the options.lua file. Link: https://community.mtasa.com/?p=resources&s=details&id=15483 Video:

Thanks
7. Opening GTA

https://pastebin.mtasa.com/103562576
8. Opening GTA

The GTA is opening when I try to open MTA. How can i fix it? I have tried to solve it many times. I formatted the computer. But it did not improve.
9. SQL Error!

Send creating table row.

11. onColShapeHit

setWeaponProperty(weapon,level,"flag_anim_crouch", false)
12. [ Problem ]

local xml = addResourceMap(":File/map2.map", 0) local map = xmlFindChild(xml, "map", 0) xmlNodeSetAttribute(map, "src", "map2.map") You can do it manual.

setGameType
14. Not working table!

local szefpozicio = { {2485.87524, -1666.34705, 13.34380}, {2487.87526, -1666.34705, 13.34380} } local szef = createObject (2634, unpack(szefpozicio[1])) local szefrectangle = createColRectangle (2485.8720703125, -1665.8211669922, 5, 5) function szefopen(jatekos) if isElementWithinColShape (jatekos, szefrectangle) then moveObject (szef, 5000, unpack(szefpozicio[2])) outputChatBox (math.random(1, 2)) end end addCommandHandler ("felfeszit", szefopen)
15. How to save player coins to account?

Because i wrote it for 1B0Y's code. You should use both.
16. How to save player coins to account?

addEventHandler("onPlayerLogin", root, function() local coin = getAccountCoinValue(source) or 0 setElementData(source, "moneycoins", coin) end) addEventHandler("onPlayerQuit", root, function() local coin = getElementData(source, "moneycoins") or 0 setAccountCoinValue(source, coin) end) addEventHandler("onResourceStart", resourceRoot, function() for _, player in pairs(getElementsByType("player")) do local coin = getAccountCoinValue(player) if coin then setElementData(player, "moneycoins", coin) end end end)
17. setModelHandling problems!

setModelHandling(602, "driveType", "rwd") Use 'rwd', 'fwd' or 'awd'.
18. setModelHandling problems!

Use fileGetSize function. If you use this on client, it returns your downloaded file size; if you use it on server, it returns total file size.
20. mysql [MySQL RESULT]I NEED HELP ABOUT MySQL RESULT FUNCTION

Can you post your creating table code? If you want to view 'result' table, you can use this: outputConsole(toJSON(result))

22. mysql-result I Need help for mysql result

I don't use social media. You can contact me only here with private message.

24. shooting while moving

Avagard is not use 28 id. ------ local properties = { weapons = {23,24,25,26,27,29,30,31,33,34}, levels = {"poor", "std", "pro"} } function shootingWhileMoving() for _, id in pairs(properties.weapons) do for _, level in pairs(properties.levels) do setWeaponProperty(id, levels, "flags", 0x000010) setWeaponProperty(id, levels, "flags", 0x000020) end end end Try it.
25. dxgridlist [HELP] dxGridList

Change nnn to nns
×

• Social Media

×
• Create New...