-
Posts
1,414 -
Joined
-
Last visited
-
Days Won
19
Everything posted by Tekken
-
<>= this is not a valid operator! what do you mean by "in his hands" ?
-
Make sure to use the scaling for both position and size like so: local sW,sH = guiGetScreenSize(); local scalex,scaley = sW/1920, sH/1080; -- make sure to check they look good on 1920*1080! -- so to draw a square or 200*200px on the middle of the screen: local width, height = 200, 200; dxDrawRectangle(sW/2-(width*scalex)/2, sH/2-(height*scaley)/2, width*scalex, height*scaley); Also i suggest you to checkout this tutorial:
-
Replace if isCardShop(true) then with if isCardShop == true then Also to set it true or false do isCardOpen = true or isCardOpen = false
-
Just change player and thePlayer with source restart and reconnect it should work
-
May I see how you implement it?
-
Hello, "onPlayerJoin" > fadeCamera(player, true) also spawn the player and setCameraTarget(player)
-
You will have to check if the player is in that colshape https://wiki.multitheftauto.com/wiki/IsElementWithinColShape or check when he hits that colshape https://wiki.multitheftauto.com/wiki/OnElementColShapeHit
-
function onPlayerChat(msg,type) if (msg:lower():find("mtasa") or msg:find("://")) or msg:find("%d") then --the 3rd operation was and instead of or :) cancelEvent() source:kick("Divulgação!") end end addEventHandler("onPlayerChat", root, onPlayerChat) This should work
-
Well first of all what's wrong ? Second of all the script you shown only create a col sphere and save it to a table so I assume it's more to it isn't it?
-
Hi, why not sending the code already? Also to do so you might need: https://wiki.multitheftauto.com/wiki/GetDistanceBetweenPoints3D or a 'better' solution for me would be: https://wiki.multitheftauto.com/wiki/CreateColPolygon
-
Hi, check this out, might help you https://wiki.multitheftauto.com/wiki/Resource:OnElementSpawn
-
Hi, for better assistance we need to see the code
-
24 what ? hours, minutes, seconds ? ?
-
Timer for what ?
-
Hi, I suspect you try using ‘0’ CJ skin? If so bonne_attach won’t work by default with it so you would need a workaround, yet I highly recommend you to change it with pAttach: https://forum.multitheftauto.com/topic/129019-rel-pattach-optimized-bone-attach/#comment-991624 it does the same yet faster and lighter, however offsets may need to be changed
- 1 reply
-
- 1
-
Hi, to do so you will need a table where you will store IP’s and attempts like so: local trys = {}; -- when someone joins trys[IP] = 0; -- default to 0; -- when the player 'attempts' something you do a check; if trys[IP] < 10 then --do the thing; trys[IP] = #trys[IP] + 1; --add 1 to his attempts; end Note that this will drop when you restart server/resource so you mai need to make a backup of the table
-
Hi, this is how I'd do it: local GatesData = { -- Create a table with all data for later use, also it looks cleaner :) {2930, 3433.6999511719,-2461,2.9000000953674, 0, 0, 90}, {2930, 3428.6000976562,-2461,2.9000000953674, 0, 0, 90}, {2930, 3423.6000976562,-2461,2.9000000953674, 0, 0, 90}, {2930, 3418.6000976562,-2461,2.9000000953674, 0, 0, 90}, {2930, 3413.6000976562,-2461,2.9000000953674, 0, 0, 90}, {2930, 3408.6000976562,-2461,2.9000000953674, 0, 0, 90}, {2930, 3403.6000976562,-2461,2.9000000953674, 0, 0, 90}, {2930, 3398.6000976562,-2461,2.9000000953674, 0, 0, 90}, {2930, 3394.1000976562,-2463.5,2.9000000953674, 0, 0, 125}, {2930, 3393.3000488281,-2466.3999023438,2.9000000953674, 0, 0, 0}, {2930, 3393.3999023438,-2471.1000976562,2.9000000953674, 0, 0, 0}, {2930, 3393.3999023438,-2476,2.9000000953674, 0, 0, 0}, {2930, 3393.3999023438,-2481.1000976562,2.9000000953674, 0, 0, 0}, {2930, 3393.8999023438,-2485.8999023438,2.9000000953674, 0, 0, 48}, {2930, 3398,-2488,2.9000000953674, 0, 0, -270}, {2930, 3403.1000976562,-2488,2.9000000953674, 0, 0, -270}, {2930, 3408.1999511719,-2488,2.9000000953674, 0, 0, -270}, {2930, 3413.3000488281,-2488,2.9000000953674, 0, 0, -270}, {2930, 3418.3999023438,-2488,2.9000000953674, 0, 0, -270}, {2930, 3423.5,-2488,2.9000000953674, 0, 0, -270}, {2930, 3428.6000976562,-2488,2.9000000953674, 0, 0, -270}, {2930, 3433.6999511719,-2488,2.9000000953674, 0, 0, -270} }; local JailGates = {}; -- This table we'll store 'gates' later for i = 1, #GatesData do -- iterate through data to create gates local model,x,y,z,rx,ty,rz = unpack(GatesData[i]); --gather data local obj = createObject(model,x,y,z,rx,ty,rz); --crate object JailGates[#JailGates + 1] = obj; --store the object for later use setElementDimension(obj, 3); end addCommandHandler("open", function() for i = 1, #JailGates do --iterate through gates local rx, ry, rz = getElementRotation(JailGates[i]); --get the current rotation of the object setElementRotation(JailGates[i], rx, ry, rz + 90); --turn the gates 90°, NOTE that this may not fit correctlly for every gate so you may have to do a workaround like different tables end end); This is not tested but it should work
-
Hi, will you try this local markers = {}; addCommandHandler("test", function() mark = createMarker(-106.93572235107, -1150.2275390625, 1.0437397956848-1, "cylinder", 4.0, 53, 151, 255, 45); markers[mark] = #markers + 1; mark = createMarker(-129.19007873535, -1202.5013427734, 2.1060457229614, "cylinder", 4.0, 53, 151, 255, 45); markers[mark] = #markers + 1; mark = createMarker(-142.54978942871, -1272.1796875, 2.1073033809662, "cylinder", 4.0, 53, 151, 255, 45); markers[mark] = #markers + 1; end); addEventHandler("onClientMarkerHit", root, function() if markers[source] then outputChatBox(markers[source]); destroyElement(source); markers[source] = nil; end end); Should be working, been a while since I edited MTA Lua
-
Either SQL or the built in account system will work just fine, what I whould do is locally store player data in a table and ONLY change that table ( A lot faster and better than sending SQL requests/execute get/setAccountData all the time ) and save/load that table to account system/SLQ I made you a quick example : playerData = {}; -- This is the table that will serve us as a database! addEventHandler("onPlayerLogin", root, function(oldAcc, acc) if not playerData[source] then playerData[source] = {}; -- create a entry on the table for our player! end local data = getAccountData(acc, "server.data.table") or false; -- get player data if stored already if data then playerData[source] = fromJSON(data); -- cash data in table for later use! end end); function playerHasLeft(player) if playerData[player] then local acc = getPlayerAccount(player); if acc then setAccountData(acc, "server.data.table", toJSON(playerData[player])); playerData[player] = {}; --clear cash end end end addEventHandler("onPlayerQuit", root, function() playerHasLeft(source); end); addEventHandler("onPlayerLogout", root, function() playerHasLeft(source); end); function setPlayerSomeData(player, key, data) if player and key and data then if not playerData[player] then playerData[player] = {}; end playerData[player][key] = data; -- save to cash table return true; end return false; end function getPlayerSomeData(player, key) if player and key then if not playerData[player] then return false; end return playerData[player][key]; end return false; end addCommandHandler("test1", function(player) setPlayerSomeData(player, "M4", 5); setPlayerSomeData(player, "AK-47", 1); end); -- etc... -- TEST addCommandHandler("test2", function(player) outputChatBox("You have:"); for key, value in pairs(playerData[player]) do outputChatBox(value.." x "..key); end end);
-
Da, am cam abandonat proiectul de cand mi-am luat XSX dar ma tot duce gandul sa ma reapuc, dar tot imi aduc aminte de esecurile din trecut, iar pe international nu stiu daca pot sa ma impun in fata "gigantilor" top-gta, nonstop si ultimate
-
Hello and welcome! Do you have those resources on your server ?