-
Posts
980 -
Joined
-
Last visited
-
Days Won
1
Everything posted by manawydan
-
probar: a = exports [ "zombies" ]:createZombie ( -2164.3, 2772.7, 167.1, 0, 301, 0, 0 ) b = exports [ "zombies" ]:createZombie ( -2161.9, 2767.7, 167.5, 0, 301, 0, 0 ) addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) if source == a then a = exports.zombies:createZombie(-2164.3, 2772.7, 167.1, 0, 301, 0, 0) elseif source == b then b = exports.zombies:createZombie(-2161.9, 2767.7, 167.5, 0, 301, 0, 0) end end )
-
you can try use: for ipairs getElementsByType
-
edit: local DanceTable = {} table.insert(DanceTable, "bd_clap") --no need to specify the index (auto incrementing and starting at 1) table.insert(DanceTable, "bd_clap1") table.insert(DanceTable, "dance_loop") table.insert(DanceTable, "DAN_Down_A") table.insert(DanceTable, "DAN_Left_A") table.insert(DanceTable, "DAN_Loop_A") table.insert(DanceTable, "DAN_Right_A") table.insert(DanceTable, "DAN_Up_A") table.insert(DanceTable, "dnce_M_a") table.insert(DanceTable, "dnce_M_b") table.insert(DanceTable, "dnce_M_c") table.insert(DanceTable, "dnce_M_d") table.insert(DanceTable, "dnce_M_e") local DanceP = {} function Dance( player ) if not DanceP[player] then DanceP[player] = 1 else if DanceP[player] >13 then DanceP[player] = DanceP[player] +1 else DanceP[player] = DanceP[player] -1 end end setPedAnimation(player,"DANCING",DanceTable[DanceP[player]], 5000, true, true, false) end addCommandHandler("Dance", Dance) sorry for missing comma
-
one edit in citizen code: local DanceTable = {} table.insert(DanceTable, "bd_clap") --no need to specify the index (auto incrementing and starting at 1) table.insert(DanceTable, "bd_clap1") table.insert(DanceTable, "dance_loop") table.insert(DanceTable, "DAN_Down_A") table.insert(DanceTable, "DAN_Left_A") table.insert(DanceTable, "DAN_Loop_A") table.insert(DanceTable, "DAN_Right_A") table.insert(DanceTable, "DAN_Up_A") table.insert(DanceTable, "dnce_M_a") table.insert(DanceTable, "dnce_M_b") table.insert(DanceTable, "dnce_M_c") table.insert(DanceTable, "dnce_M_d") table.insert(DanceTable, "dnce_M_e") function Dance( player ) if not getElementData(player, "dancing") then local valRandom = math.random(#DanceTable) --#myTable returns the size of myTable outputChatBox("#0046C8[bF3]: Random Dance: "..tostring(DanceTable[valRandom]), 255,255,255,true) setPedAnimation(player, tostring(DanceTable[valRandom]), 5000, true, true, false) setElementData(player, "dancing", true) --used for the if statement else setPedAnimation(player) --cancelling the animation removeElementData(player, "dancing") --let the player to use /Dance again end end addCommandHandler("Dance", Dance)
-
is just one "test" for know the string, whats mensage say?
-
you can use tables or element data...
-
or u can change StreamMethod to 0 and make one script like this (just example): local x,y,z = 0,0,0 -- change 0,0,0 to area 51 cordinates local MaxZombies = 10 function SpawnSomeZombiesInArea51() for i=1,MaxZombies do exports["zombies"]:createZombie(x+math.random(-4,4),y+math.random(-4,4),z) outputChatBox("Zombies Spawned, amount: "..MaxZombies,root) end end setTimer(SpawnSomeZombiesInArea51,60000,0) -- loop, in 1 minute to spawn more zombies
-
try use this: https://community.multitheftauto.com/in ... ls&id=6210 download any "target" image and use with this script.
-
aparentemente voce quer muda a velocidade maxiam do veiculo 551. como o dnl291 disse o segundo argumento é uma string. então o correto seria: setModelHandling(551,"maxVelocity",200000) onde 551 é o modelo do veiculo, "maxVelocity" é propriedade e o numero 200000 é o valor que voce esta setando nela.
-
you can post script? you use addEventHandler("onClientRender"....) to render image?
-
[FS] MP3 System - Custom Radio stations - MySQL
manawydan replied to glowdemon1's topic in Resources
looks good -
you can use math.percent function to return percent. https://wiki.multitheftauto.com/wiki/Math.percent
-
so i try it: -- by manawydan, sqlsavesystem addEventHandler("onResourceStart",resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS SistemaDeDados (atual TEXT, x INT, y INT, z INT, skin INT, arma0 INT, arma1 INT, arma2 INT, arma3 INT, arma4 INT, arma5 INT, arma6 INT, arma7 INT, arma8 INT, arma9 INT, arma10 INT, arma11 INT, arma12 INT, marma0 INT, marma1 INT, marma2 INT, marma3 INT, marma4 INT, marma5 INT, marma6 INT, marma7 INT, marma8 INT, marma9 INT, marma10 INT, marma11 INT, marma12 INT, vida INT, colete INT, interior INT, dimension INT, dinheiro INT, time TEXT)") local valores = executeSQLQuery("SELECT * FROM SistemaDeDados") if #valores == 0 then outputDebugString("Sistema de salvamento sendo iniciado.") outputDebugString("Valores atuais da tabela sendo criados.") end end) addEventHandler("onPlayerQuit",root, function() local conta = getPlayerAccount(source) if not isGuestAccount(conta) then setAccountData(conta,"JajogouAki",true) local c = getAccountName(conta) local x,y,z = getElementPosition(source) local health = getElementHealth(source) local colete = getPedArmor(source) local skin = getElementModel(source) local interior = getElementInterior(source) or 0 local dimension = getElementDimension(source) local dinheiro = getPlayerMoney(source) or 0 local time = getPlayerTeam(source) local arma0 = getPedWeapon(source,0) local arma1 = getPedWeapon(source,1) local arma2 = getPedWeapon(source,2) local arma3 = getPedWeapon(source,3) local arma4 = getPedWeapon(source,4) local arma5 = getPedWeapon(source,5) local arma6 = getPedWeapon(source,6) local arma7 = getPedWeapon(source,7) local arma8 = getPedWeapon(source,8) local arma9 = getPedWeapon(source,9) local arma10 = getPedWeapon(source,10) local arma11 = getPedWeapon(source,11) local arma12 = getPedWeapon(source,12) local marma0 = getPedTotalAmmo(source,0) local marma1 = getPedTotalAmmo(source,1) local marma2 = getPedTotalAmmo(source,2) local marma3 = getPedTotalAmmo(source,3) local marma4 = getPedTotalAmmo(source,4) local marma5 = getPedTotalAmmo(source,5) local marma6 = getPedTotalAmmo(source,6) local marma7 = getPedTotalAmmo(source,7) local marma8 = getPedTotalAmmo(source,8) local marma9 = getPedTotalAmmo(source,9) local marma10 = getPedTotalAmmo(source,10) local marma11 = getPedTotalAmmo(source,11) local marma12 = getPedTotalAmmo(source,12) executeSQLQuery("INSERT INTO SistemaDeDados('atual','x','y','z','skin','arma0','arma1','arma2','arma3','arma4','arma5','arma6','arma7','arma8','arma9','arma10','arma11','arma12','marma0','marma1','marma2','marma3','marma4','marma5','marma6','marma7','marma8','marma9','marma10','marma11','marma12','vida','colete','interior','dimension','dinheiro','time') VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",'c','x','y','z','skin','arma0','arma1','arma2','arma3','arma4','arma5','arma6','arma7','arma8','arma9','arma10','arma11','arma12','marma0','marma1','marma2','marma3','marma4','marma5','marma6','marma7','marma8','marma9','marma10','marma11','marma12','vida','colete','interior','dimension','dinheiro','time') end end) addEventHandler("onPlayerLogin",root, function(antes,atual) if atual and not isGuestAccount(atual) then if getAccountData(atual,"JajogouAki") then local c = getAccountName(atual) local Data = executeSQLQuery("SELECT * FROM SistemaDeDados WHERE atual=?", c) setElementHealth(source, Data[1].vida) setElementPosition(source, Data[1].x, Data[1].y, Data[1].z) end end end) debug say: line 63 attemp to index field '?' no errors in quit.
-
thanks guy, but i get errors and the data no save. debug when i quit: database query failed, no such colum: false
-
so just use getAccountName and work?
-
so, i start read sql and i am try make one save system, but no work. can help me? -- by manawydan, sqlsavesystem addEventHandler("onResourceStart",resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS SistemaDeDados (atual TEXT, x INT, y INT, z INT, skin INT, arma0 INT, arma1 INT, arma2 INT, arma3 INT, arma4 INT, arma5 INT, arma6 INT, arma7 INT, arma8 INT, arma9 INT, arma10 INT, arma11 INT, arma12 INT, marma0 INT, marma1 INT, marma2 INT, marma3 INT, marma4 INT, marma5 INT, marma6 INT, marma7 INT, marma8 INT, marma9 INT, marma10 INT, marma11 INT, marma12 INT, vida INT, colete INT, interior INT, dimension INT, dinheiro INT, time TEXT)") local valores = executeSQLQuery("SELECT * FROM SistemaDeDados") if #valores == 0 then outputDebugString("Sistema de salvamento sendo iniciado.") outputDebugString("Valores atuais da tabela sendo criados.") end end) addEventHandler("onPlayerQuit",root, function() local conta = getPlayerAccount(source) if not isGuestAccount(conta) then setAccountData(conta,"JajogouAki",true) local x,y,z = getElementPosition(source) local health = getElementHealth(source) local colete = getPedArmor(source) local skin = getElementModel(source) local interior = getElementInterior(source) or 0 local dimension = getElementDimension(source) local dinheiro = getPlayerMoney(source) or 0 local time = getPlayerTeam(source) local arma0 = getPedWeapon(source,0) local arma1 = getPedWeapon(source,1) local arma2 = getPedWeapon(source,2) local arma3 = getPedWeapon(source,3) local arma4 = getPedWeapon(source,4) local arma5 = getPedWeapon(source,5) local arma6 = getPedWeapon(source,6) local arma7 = getPedWeapon(source,7) local arma8 = getPedWeapon(source,8) local arma9 = getPedWeapon(source,9) local arma10 = getPedWeapon(source,10) local arma11 = getPedWeapon(source,11) local arma12 = getPedWeapon(source,12) local marma0 = getPedTotalAmmo(source,0) local marma1 = getPedTotalAmmo(source,1) local marma2 = getPedTotalAmmo(source,2) local marma3 = getPedTotalAmmo(source,3) local marma4 = getPedTotalAmmo(source,4) local marma5 = getPedTotalAmmo(source,5) local marma6 = getPedTotalAmmo(source,6) local marma7 = getPedTotalAmmo(source,7) local marma8 = getPedTotalAmmo(source,8) local marma9 = getPedTotalAmmo(source,9) local marma10 = getPedTotalAmmo(source,10) local marma11 = getPedTotalAmmo(source,11) local marma12 = getPedTotalAmmo(source,12) executeSQLQuery("INSERT INTO SistemaDeDados(atual,x,y,z,skin,arma0,arma1,arma2,arma3,arma4,arma5,arma6,arma7,arma8,arma9,arma10,arma11,arma12,marma0,marma1,marma2,marma3,marma4,marma5,marma6,marma7,marma8,marma9,marma10,marma11,marma12,vida,colete,interior,dimension,dinheiro,time) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",conta,x,y,z,skin,arma0,arma1,arma2,arma3,arma4,arma5,arma6,arma7,arma8,arma9,arma10,arma11,arma12,marma0,marma1,marma2,marma3,marma4,marma5,marma6,marma7,marma8,marma9,marma10,marma11,marma12,health,colete,interior,dimension,dinheiro,time) end end) addEventHandler("onPlayerLogin",root, function(antes,atual) if atual and not isGuestAccount(atual) then if getAccountData(atual,"JajogouAki") then local Data = executeSQLQuery("SELECT * FROM SistemaDeDados WHERE atual=?",atual) setElementHealth(source,Data[1]) setElementPosition(source,Data[2],Data[3],Data[4]) end end end)
-
you change you meta script ex: server.lua to server.luac?
-
try change addEventHandler("onPedWasted",getRootElement(), function (_,killer) for i, nemesis in ipairs(nemesisBots) do if (source == nemesis) then givePlayerMoney(killer,math.random(1000,1000)) local killerName = getPlayerName(killer) local weapon = getPedWeapon(killer) local wr, wg, wb = getPlayerNametagColor(killer) exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=141,g=7,b=220},"Nemesis"},getRootElement(),wr,wg,wb ) exports.exp_system:addPlayerEXP ( killer, math.random(1, 200)) break end end end)
-
just create team local Nemesis = createTeam("Nemesis",250,0,0) local nemesisBots = {} function BossNemesis ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then for i=1, 10 do local x, y, z = getElementPosition ( thePlayer ) nemesisBots[i] = exports [ "slothBot" ]:spawnBot ( x+i,y+i,z+(i/2), 90, math.random ( 300, 303 ), 0, 0, Nemesis, 38, "hunting", true ) exports.extra_health:setElementExtraHealth ( nemesisBots[i], 150 ) setElementModel ( nemesisBots[i], 107 ) end end end addCommandHandler ( "nemesis",BossNemesis ) addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), function (killer) for i, nemesis in ipairs(nemesisBots) do if (source == nemesis) then givePlayerMoney(killer,math.random(1000,1000)) local killerName = getPlayerName(killer) local weapon = getPedWeapon(killer) local wr, wg, wb = getPlayerNametagColor(killer) exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=141,g=7,b=220},"Nemesis"},getRootElement(),wr,wg,wb ) exports.exp_system:addPlayerEXP ( killer, math.random(1, 200)) break end end end)
-
voce n criou os markers