-
Posts
277 -
Joined
-
Last visited
Everything posted by DiGiTal
-
Hi, i've upload one skin for my premuim members, explaine;if he see as a premuim player, he will got the skin 150, if not all will get skin 200) ERROR: [13:53:37] Starting userpanel [13:53:37] SCRIPT ERROR: userpanel\c_server.lua:2322: unexpected symbol near 'then' [13:53:37] ERROR: Loading script failed: userpanel\c_server.lua:2322: unexpected symbol near 'then' [13:53:39] userpanel restarted successfully function skindonator(thePlayer) if isGuestAccount(account) then return end if getAccountData(account,"donatorEnabled") == 1 then setElementModel(thePlayer, 150 ) then outputChatBox ("Enjoy your premuim skin") else setElementModel(thePlayer, 189 ) end end addEventHandler("onPlayerLogin",getRootElement(),skindonator) thx
-
desolé @Yasar si j'ete lent mais @Citizen je crois qu'il va pas comprendre directement sur le Wiki de MTASA (par experience),j'ai lu le wiki plus de 4 fois mais RIEN COMPRIS, mais quand je suis parti pour apprendre le LUA, tous est lisable,facile a comprendre, alors je te conseille d'aller voire sur youtube ya des tutos sur cela
-
@#BrosS thx very much i didn't think the wrong will be on meta, as i know i'll not do a error like that .anyway thx
-
Hi, on my scripts it can't load the image: dxDrawImage(0,sY*0.15,sX*0.3,sX*0.15,"loginImage/logo.png",0,0,0,tocolor(255,255,255,loginData.loginAlpha))
-
yea, anyway thanks very much i like the dgs, good work ,hope you create new tools as this
-
Doesn't WORK !! can anyone help me, it's not as the GUIeditor with the cursor to create tab,memo...., i need to script ?
-
it's the price ! argument 2 but thx !!!!
-
Hi, i'm learned lua,finished now, i came to mtasa functions... ,i created a panel if anyone wanna to teleport he need to pay ! for the server.lua had, i went to client, and i don't know how to script the buttons. thx server: function (player,amount) if getPlayerMoney( player ) >= 30000 then takePlayerMoney( player, 30000 ) then end end client: GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function wdwPay () window = guiCreateWindow(0.39, 0.36, 0.22, 0.38, "SADZ Cinema HD", true) guiWindowSetSizable(window, false) guiSetAlpha(window, 0.67) GUIEditor.checkbox[1] = guiCreateCheckBox(391, 141, 0, 48, "", false, false, window) label1 = guiCreateLabel(0.19, 0.17, 0.63, 0.11, "pay", true, window) guiSetFont(label1, "default-bold-small") guiLabelSetHorizontalAlign(label1, "left", true) label2 = guiCreateLabel(0.38, 0.17, 0.62, 0.11, "50,000$", true, window) guiSetFont(label2, "default-bold-small") guiLabelSetColor(label2, 14, 67, 0) edit1 = guiCreateEdit(48, 92, 222, 26, "", false, window) button1 = guiCreateButton(0.32, 0.54, 0.47, 0.09, "PAY", true, window) guiSetFont(button1, "default-bold-small") end ) guiSetVisible(wdwPay, false)
-
Me,i learned lua on Youtube it's the best way for me, but you can buy,read the book lua as @Hale said then go to wiki as @NOONE said but if you don't understand anything on wiki ou can contact me:skype:ogg4r_fr PS: i just starting scripting !, not master lua
-
Onca i want to upload my script into 'community.multitheftauto.com/index.php?p=resources' I SEE THAT The meta.xml in the zip is invalid. Please check it for errors. <meta> <info author="N/A" title="N/A" version="1.0"/> <script src="main.lua" /> <script src="main_c.lua" /> <oop>true</oop> </meta>
-
Hi, i have a scripts for example cinema once he hit a marker if he have 30,000$ the script will work if not the script will not work
-
Once i do a Error key (need to do the right key to have the money) i have -1000$, Thanks code = "" maxAmount = 5000000 playPrice = 1000 timeOut = 5000 totalMoney = 0 prevAtt = { } function startUp() for k,v in ipairs ( getElementsByType ( 'player' ) ) do if exports["SADZcommands"]:isPlayerInTeam(v, "Criminals") then safeTable = createObject (1829 ,2580.619140625, 2328.5845703125, 17.222208404541) createBlipAttachedTo ( safeTable, 38, 3, 0, 117 , 0 , 255, 0, 99999.0 ) loadConfig() else exports.SADZcommands:sendMessage("You are not in Criminals Team!", 200, 255, 100, player ) end end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), startUp) function loadConfig() totalMoney = math.random(2500,100000) local xml = xmlLoadFile("jackpot.xml") if xml then for i,jackpot1 in ipairs(xmlNodeGetChildren(xml)) do local node = xmlFindChild(xml,"jackpot1",0) local success = xmlNodeSetValue(node,tostring(totalMoney)) xmlSaveFile(xml) xmlUnloadFile(xml) end end createCode() end function createCode() numOne = math.random(0,9) numTwo = math.random(0,9) numThree = math.random(0,9) numFour = math.random(0,9) if openSafe then destroyElement ( openSafe ) end closedSafe = createObject ( 2332, 2580.619140625, 2328.5845703125, 17.222208404541 ) setObjectRotation ( closedSafe, 0, 0, 180 ) Marker = createMarker (2580.611328125, 2330.4267578125, 16.822208404541, "cylinder", 1, 105,144,61, 170 ) setElementData ( Marker, "Safe", "Crack" ) code = tostring(numOne)..tostring(numTwo)..tostring(numThree)..tostring(numFour) outputDebugString("CODE: "..code) exports.SADZcommands:sendMessage( "*SAFE CRACKER* The safe has been filled with: $ "..tostring(totalMoney),0,200,0,getRootElement()) end function dataRequest() previousAtt = table.concat(prevAtt, ",") triggerClientEvent ( source, "showStartWindow", getRootElement(), playPrice, totalMoney, previousAtt ) end addEvent( "dataRequest", true ) addEventHandler( "dataRequest", getRootElement(), dataRequest ) function codeCheck(checkCode) takePlayPrice() if checkCode == code then exports.SADZcommands:sendMessage( "*SAFE CRACKER* You cracked the code! You earned: $"..tostring(totalMoney), 0, 200, 0, source) exports.SADZcommands:giveMoney(source, totalMoney) destroyElement( closedSafe ) destroyElement( Marker ) openSafe = createObject ( 1829, 2580.59375, 2329.0810546875, 17.822208404541 ) setObjectRotation ( openSafe, 0, 0, 180 ) setTimer( loadConfig, 300000, 1) exports.SADZcommands:sendMessage( "*SAFE CRACKER* The code of the safe has been cracked by: "..getPlayerName(source), 0, 200, 0, getRootElement()) exports.SADZcommands:sendMessage( "*SAFE CRACKER* The safe will be refilled in 5 minutes", 0, 200, 0, getRootElement()) triggerClientEvent ( "destroySafeGUI", getRootElement() ) xml = xmlLoadFile("jackpot.xml") if xml then for i,jackpot1 in ipairs(xmlNodeGetChildren(xml)) do local randBoost = math.random(750,1500) local node = xmlFindChild(xml,"jackpot1",0) local ammount = xmlNodeGetValue(xmlFindChild(xml,"jackpot1",0)) xmlNodeSetValue(node,tostring(0)) xmlSaveFile(xml) xmlUnloadFile(xml) end end else if checkCode > code then exports.SADZcommands:sendMessage( "*SAFE CRACKER* LOWER!", 255, 255, 0, source) if #prevAtt == 10 then table.insert(prevAtt, 1 , checkCode) table.remove(prevAtt, 11) else table.insert(prevAtt, 1 , checkCode) end elseif checkCode < code then exports.SADZcommands:sendMessage( "*SAFE CRACKER* HIGHER!", 255, 255, 0, source) if #prevAtt == 10 then table.insert(prevAtt, 1 , checkCode) table.remove(prevAtt, 11) else table.insert(prevAtt, 1 , checkCode) end end xml = xmlLoadFile("jackpot.xml") if xml then for i,jackpot1 in ipairs(xmlNodeGetChildren(xml)) do local randBoost = math.random(750,1500) local node = xmlFindChild(xml,"jackpot1",0) local ammount = xmlNodeGetValue(xmlFindChild(xml,"jackpot1",0)) xmlNodeSetValue(node,tostring(ammount+randBoost)) xmlSaveFile(xml) xmlUnloadFile(xml) end end end end addEvent( "codeCheck", true ) addEventHandler( "codeCheck", getRootElement(), codeCheck ) function takePlayPrice() exports.SADZcommands:takeMoney(source, playPrice) totalMoney = totalMoney + playPrice if totalMoney > maxAmount then totalMoney = maxAmount end end addEvent( "takePlayPrice", true ) addEventHandler( "takePlayPrice", getRootElement(), takePlayPrice )
-
function startUp() for k,v in ipairs ( getElementsByType ( 'player' ) ) do if exports["SADZcommands"]:isPlayerInTeam ( thePlayer , "Criminals") then safeTable = createObject (1829 ,2580.619140625, 2328.5845703125, 17.222208404541) createBlipAttachedTo ( safeTable, 38, 3, 0, 117 , 0 , 255, 0, 99999.0 ) loadConfig() else outputDebugString("wrong") end end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), startUp)
-
i've this eror, the code have the eror,?.? [18:26:45] ERROR: SADZconfirm\exports_server.lua:102: Bad argument 1 @ isPlayerInTeam [player expected, got nil] [DUP x2] [18:26:45] ERROR: SADZRoob\Safe.lua:11: call: failed to call 'SADZconfirm:isPlayerInTeam' [string "?"] [DUP x2] [18:26:45] INFO: wrong [DUP x2] thx
-
local moneyMultiplier = 1 function giveMoney(player, amount) if player then if isElement(player) then if tonumber(amount) then local currentMoney = tonumber(getElementData(player, "money")) or 0 local newMoney = math.floor(currentMoney + tonumber(amount)) setPlayerMoney(player, newMoney) setElementData(player, "money", tostring(newMoney)) return true else outputDebugString("Amount not number.",1) return false end else outputDebugString("Invalid player.", 1) return false end else outputDebugString("Missing argument.",1) return false end end addEvent("giveMoney", true) addEventHandler("giveMoney", root, giveMoney) function takeMoney(player, amount) if player then if isElement(player) then if tonumber(amount) then local currentMoney = tonumber(getElementData(player, "money")) or 0 local newMoney = math.floor(currentMoney - tonumber(amount)) setPlayerMoney(player, newMoney) setElementData(player, "money", tostring(newMoney)) return true else outputDebugString("Amount not number.",1) return false end else outputDebugString("Invalid player.", 1) return false end else outputDebugString("Missing argument.",1) return false end end addEvent("takeMoney", true) addEventHandler("takeMoney", root, takeMoney) function setMoney(player, amount) if player then if isElement(player) then if tonumber(amount) then local newMoney = math.floor(tonumber(amount)) setPlayerMoney(player, newMoney) setElementData(player, "money", tostring(newMoney)) return true else outputDebugString("Amount not number.",1) return false end else outputDebugString("Invalid player.", 1) return false end else outputDebugString("Missing argument.",1) return false end end addEvent("setMoney", true) addEventHandler("setMoney", root, setMoney) function formatNumber(amount) if type(amount) ~= "string" then amount = tostring(amount) end local outcome = amount while true do outcome,k = string.gsub(outcome,"^(-?%d+)(%d%d%d)","%1,%2") if k == 0 then break end end return outcome end function subString(str,chunkSize) if not str or type(str) ~= "string" or not chunkSize or type(chunkSize) ~= "number" then return false end local returnTable = {} while #str >= chunkSize do table.insert(returnTable,str:sub(1,chunkSize)) str = str:sub(chunkSize+1) if #str < chunkSize then table.insert(returnTable,str) end end return returnTable end function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end
-
Hi, i have added the code of "isPlayerInTeam" on folder"confirm" i created there a meta and lua i copyed there function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end and i see this ERROR: Roob\Safe.lua:11: call: failed to call 'SADZconfirm:isPlayerInTeam' [string "?"] function startUp() if exports.SADZconfirm:isPlayerInTeam( thePlayer, "Criminals") then safeTable = createObject (1829 ,2580.619140625, 2328.5845703125, 17.222208404541) createBlipAttachedTo ( safeTable, 38, 3, 0, 117 , 0 , 255, 0, 99999.0 ) loadConfig() else outputDebugString("wrong") end end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), startUp)
-
It's work very good,i just don't gave the rights !
-
Hi, i have a criminal job which you go to a place to take a bag and go to the destination BUT the probleme al (cops,civilans...)l want the job and blip apear only on car jacker classe. mark = { --Las Venturas {2630.802734375, 1824.3828125, 10.0234375}, {2184.5078125, 2805.859375, 9.8203125}, {1097.6328125, 1601.888671875, 11.546875}, {1918.73828125, 664.7099609375, 13.2734375}, {2849.0302734375, 1290.7861328125, 10.390625}, {1087.7451171875, 1076.703125, 9.838157653809}, {2182.9580078125, 1115.119140625, 11.6484375}, {2451.8359375, 1223.9072265625, 9.8203125}, {2329.740234375, 1436.3671875, 41.8203125}, {1091.53515625, 2119.6787109375, 14.350400924683}, {2005.9912109375, 2310.5322265625, 9.8203125}, {2225.2021484375, 1964.65234375, 30.779651641846}, {2026.419921875, 1916.4453125, 11.337824821472}, {1383.40625, 2183.7421875, 10.0234375}, {1418.59375, 2773.5654296875, 9.8203125}, {2291.869140625, 2451.37109375, 9.8203125}, {1704.822265625, 1025.646484375, 9.8203125}, {1600.3994140625, 2220.3740234375, 10.0625}, --San Fierro {-1947.6494140625, 795.720703125, 54.722202301025}, {-1809.30859375, 1301.337890625, 58.734375}, {-2521.078125, -623.7021484375, 131.77600097656}, {-2552.34765625, 53.529296875, 15.421875}, {-2026.630859375, -98.302734375, 34.1640625}, {-2583.583984375, 887.673828125, 63.982246398926}, {-1954.6171875, -809.1669921875, 34.890884399414}, {-1545.107421875, -440.0419921875, 7}, {-1571.2021484375, 82.6435546875, 2.5546875}, {-2419.0703125, 334.4072265625, 34.178676605225}, { -1353.466796875, -102.4404296875, 6}, --Los Santos {377.70703125, -2020.7353515625, 6.8300905227661}, {1641.6123046875, -2240.2080078125, 12.49627494812}, {1925.76171875, -1764.08984375, 12.539072036743}, {1097.671875, -1604.8408203125, 19.525354385376}, {2266.1455078125, -1667.8115234375, 14.393363952637}, {1726.861328125, -1635.6357421875, 19.216711044312}, {918.46875, -1252.248046875, 15.2109375}, {1298.591796875, -799.853515625, 83.140625}, {1980.1220703125, -1281.9013671875, 22.976850509644}, {2747.7236328125, -1692.3193359375, 10.84375}, {2094.9111328125, -1797.814453125, 12.3828125}, {2746.896484375, -1352.2314453125, 43.558689117432}, {2719.22265625, -2515.9111328125, 16.367183685303}, } bag = { --Las Venturas {2577.3095703125, 2733.6640625, 10.8203125}, {1498.7255859375, 721.623046875, 10.8203125}, {1665.47265625, 1423.3603515625, 10.783618927002}, {943.0888671875, 1733.2734375, 8.8515625}, {1486.9326171875, 2773.982421875, 10.8203125}, {2880.8017578125, 2523.0654296875, 10.8203125}, {2318.6923828125, 1261.4091796875, 67.46875}, {2617.1005859375, 717.099609375, 14.739588737488}, {2193.6787109375, 1677.2421875, 12.3671875}, {984.4345703125, 2562.916015625, 10.749537467957}, {2476.1513671875, 1876.45703125, 10.315457344055}, {1865.462890625, 2071.6962890625, 11.0625}, --San Fierro {-2765.03515625, 785.369140625, 52.78125}, {-2723.453125, -314.8759765625, 7.183753490448}, {-2343.7060546875, -166.9033203125, 35.5546875}, {-2026.23046875, 156.92578125, 29.0390625}, {-1978.89453125, 432.111328125, 25.506650924683}, {-1884.7626953125, 826.2412109375, 35.172046661377}, {-2377.771484375, 910.033203125, 45.4453125}, {-2158.24609375, 654.6279296875, 52.370674133301}, { -2180.5712890625, 706.3505859375, 53.890625}, { -2152.990234375, 481.7080078125, 35.171875}, {-1669.751953125, 1015.1767578125, 7.921875}, {-1418.03515625, -293.97265625, 14.1484375}, --Los Santos {2525.474609375, -1703.5, 13.379940986633}, {2371.5791015625, -2114.7255859375, 27.17497253418}, {1247.306640625, -902.60546875, 42.8828125}, {1449.1142578125, -2287.1103515625, 13.546875}, {1972.845703125, -1235.2744140625, 20.051183700562}, {2754.2041015625, -1400.837890625, 39.371463775635}, {1665.642578125, -990.134765625, 29.430828094482}, {2793.3388671875, -2456.2119140625, 13.632308006287}, {390.9072265625, -2058.5888671875, 10.720296859741}, } function createBag() local mt = math.random(#bag) ob = createObject(1210,bag[mt][1],bag[mt][2],bag[mt][3]) setElementCollisionsEnabled(ob,false) time = setTimer(roo,100,0,ob) mar = createMarker(bag[mt][1],bag[mt][2],bag[mt][3],"corona",0.5,255,0,0,0) bl = createBlipAttachedTo(mar,19) setElementData(mar,"num",mt) exports.SADZcommands:sendMessage("* SADZ:RPG BAG* A bag has been spawned. Go to 'Red Flag' blip on the map to grab the bag and deliver it.",177,74,0,root) end addEventHandler("onResourceStart",resourceRoot,createBag) addEventHandler("onMarkerHit",root, function (player) if ( source == mar ) then if getElementType(player) == "player" then local x,y,z = getElementPosition(player) local data = getElementData(mar,"num") local data = tonumber(data) destroyElement(mar) destroyElement(ob) destroyElement(bl) killTimer(time) setElementData(player,"bag",true) atBag = createObject(1210,x,y,z) setElementData(atBag,"num",data) exports.bone_attach:attachElementToBone(atBag,player,12,0,0.05,0.27,0,180,0) bli = createBlipAttachedTo(player,3) exports.SADZcommands:sendMessage("" .. getPlayerName(player) .. " has taken the bag.",0,255,0,root,true) marker = createMarker(mark[data][1],mark[data][2],mark[data][3],"cylinder",1.5,177,74,0,155,player) marBli = createBlipAttachedTo(marker,60,2,255,0,0,255,0,99999.0,player) end end end ) function roo(ele) local x,y,z = getElementRotation(ele) setElementRotation(ele,x,y,z + 5) end addEventHandler("onPlayerWasted",root, function () if getElementData(source,"bag") and getElementData(source,"bag") == true then local data = getElementData(atBag,"num") local data = tonumber(data) local x,y,z = getElementPosition(source) setElementData(source,"bag",false) destroyElement(atBag) destroyElement(marker) destroyElement(bli) destroyElement(marBli) ob = createObject(1210,x,y,z) setElementCollisionsEnabled(ob,false) time = setTimer(roo,100,0,ob) mar = createMarker(x,y,z,"corona",0.5,255,0,0,120) setElementData(mar,"num",data) bl = createBlipAttachedTo(mar,8) end end ) addEventHandler("onMarkerHit",root, function (player) if ( source == marker ) then if getElementType(player) == "player" then setElementData(player,"bag",false) destroyElement(marker) destroyElement(marBli) destroyElement(bli) destroyElement(atBag) exports.SADZcommands:sendMessage("*BAG* " .. getPlayerName(player) .. " has delivered the bag and won 30,000$.",255,255,0,root,true) exports.SADZcommands:giveMoney(player,30000) triggerClientEvent(player,"onShowMoney",player) setTimer(createBag,300000,1) end end end ) addEventHandler("onPlayerQuit",root, function () if getElementData(source,"bag") and getElementData(source,"bag") == true then local data = getElementData(atBag,"num") local data = tonumber(data) local x,y,z = getElementPosition(source) setElementData(source,"bag",false) destroyElement(atBag) destroyElement(marker) destroyElement(bli) destroyElement(marBli) ob = createObject(1210,x,y,z) setElementCollisionsEnabled(ob,false) time = setTimer(roo,100,0,ob) mar = createMarker(x,y,z,"corona",0.5,255,0,0,0) setElementData(mar,"num",data) bl = createBlipAttachedTo(mar,8) end end )
-
I'm so new in scripting,So, MYSQL where you store informations, as the banking money accounts, AND FTP i think is where you put your ressources of your server.