-
Posts
1,028 -
Joined
-
Last visited
-
Days Won
1
Everything posted by ..:D&G:..
-
Same error Here is the whole function... function createSlotmachine(thePlayer, ...) if thePlayer and isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then local dimension = getElementDimension(thePlayer) local interior = getElementInterior(thePlayer) local x, y, z = getElementPosition(thePlayer) local rotation = getPedRotation(thePlayer) z = z - 0.3 local id = executeSQLQuery("INSERT INTO `slotmachines`(`x`,`y`,`z`,`rotation`,`interior',`dimension`) VALUES(?,?,?,?,?,?)", x, y, z, rotation, interior, dimension ) if (id) then local object = loadSlotMachines(x, y, z+0.58, 0, 0, rotation-180, interior, dimension) setElementData(object, "dbid", id) local px = x + math.sin(math.rad(-rotation)) * 0.8 local py = y + math.cos(math.rad(-rotation)) * 0.8 local pz = z x = x + ((math.cos(math.rad(rotation)))*5) y = y + ((math.sin(math.rad(rotation)))*5) setElementPosition(thePlayer, x, y, z) outputChatBox("Slot machine created with ID #" .. id .. "!", thePlayer, 0, 255, 0) else outputChatBox("There was an error while creating a slot machine Try again.", thePlayer, 255, 0, 0) end end end addCommandHandler("addslotm", createSlotmachine) EDIT - Even though there is an error in the syntax, the slot machine is still spawning but is not added into the db. When I spawn it it doesn't say that I did,..
-
I get syntax error near "dimension" local id = executeSQLQuery("INSERT INTO `slotmachines`(`id`,`x`,`y`,`z`,`rotation`,`interior',`dimension`) VALUES(?,?,?,?,?,?,?)", id, x, y, z, rotation, interior, dimension )
-
How can I use AUTO_INCREMENT in SQLite?
-
Hello guys, is there any way to get the value of the last data inserted using executeSQLQuery("INSERT INTO") like an ID? I want to make a slot machine system that saves in SQLite and I want each slot machine to have an unique id, and I need to get the ID of the latest slot machine created and then +1. Anybody any ideas?
-
Um.. thanks for trying but WTF is that? You changed my SQLite line into the mysql one from mta paradise (doesn't even save an ID) and you replaced my "id" with "slotID" Thanks for trying to help anyway
-
Download Valhalla gaming roleplay from google and get the resource called 'vgscoreboard' and get the example from there.
-
Hello everyone! I am trying to make a slot machine system that saves in SQLite and I would like to know how can I add an unique ID to each slot machine created? Here is the code I made for adding. function createSlotmachine(thePlayer, ...) if thePlayer and isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then local dimension = getElementDimension(thePlayer) local interior = getElementInterior(thePlayer) local x, y, z = getElementPosition(thePlayer) local rotation = getPedRotation(thePlayer) z = z - 0.3 local id = executeSQLQuery("INSERT INTO 'slotmachines'('id','x','y','z','rotation','interior','dimension') VALUES(?,?,?,?,?,?,?)", id, x, ,y, z, rotation, interior, dimension ) if (id) then local object = createSlotMachine(x, y, z+0.58, 0, 0, rotation-180, interior, dimension) setElementData(object, "dbid", id) local px = x + math.sin(math.rad(-rotation)) * 0.8 local py = y + math.cos(math.rad(-rotation)) * 0.8 local pz = z x = x + ((math.cos(math.rad(rotation)))*5) y = y + ((math.sin(math.rad(rotation)))*5) setElementPosition(thePlayer, x, y, z) outputChatBox("Slot machine created with ID #" .. id .. "!", thePlayer, 0, 255, 0) else outputChatBox("There was an error while creating a slot machine Try again.", thePlayer, 255, 0, 0) end end end addCommandHandler("addslotm", createSlotmachine) I tried to do something before, but when I look at it know it makes no sense Anyone know how to add an unique ID?
-
Haha, chiar vroiam sa iti spun cum de mama drq Mihay ala iti vinde scripturile )) Are si tupeul sa faca un topic pe forum
-
It works thanks. SOLVED!
-
Hello guys, I am trying to make a teleport script for a friend, but its the first time I try to put the locations for teleporting in a table and get the data from there, here is what I done: locations = { { "lsairport", 1881.33533, -2420.99878, 13.55469 }, } function teleportPlayer(player, cmd, location) local player = getLocalPlayer() if not tostring(location) then outputChatBox("[sYNTAXA] /teleport [locatie]", 255, 255, 0) return end location = string.lower(tostring(location)) for i, v in ipairs(locations) do if locations[ v[1] ] then setElementLocation(player, v[2], v[3], v[4]) outputChatBox("Te-ai teleportat cu succes la teleport-ul: "..v[1], 255, 255, 0) else outputChatBox("Alege o locatie din urmatoarele:", 255, 255, 0) for k, v in pairs(locations) do outputChatBox(k, 255, 255, 0) end end end end addCommandHandler("teleport", teleportPlayer) I want the players to type in /teleport, and if they haven't entered the name of the location, they should get the list of locations. And if they did /teleport lsairport then their location should be set to the one from the table, next to the location name. I don't get any errors but also it doesn't work.. Any ideas guys? Thanks.
-
Haideti sa incepem revolutia serverelor din Romania
..:D&G:.. replied to razvan2299's topic in General
Intradevar mare dreptate, dar acolo stau aia au implinit 4 ani de cand exista, sincer da tu jail 100 de minute pentru /q in Roleplay daca acel player nu va pleca dupa server-ul tau eu ma las de MTA, eu iti urez noroc cu server-ul tau si chiar as vrea sa vad ce schimbari poti face in zona aceasta, de la mine ai sprijin . De ce mereu scri cu font-uri si stiluri diferite? Stop begging for attention, anyway. Topicul asta nu a fost facut cu gandul de a face ceva pentru comunitatea romaneasca, ci pentru a gasii un prost sa ofere un "VPS" pe gratis unui tip necunoscut. Un prieten de al meu ti-a oferit un host, dar ai facut nazuri si nu ai acceptat ca vrei VPS ca sa te conectezi nush cum... Dar mno, stiti vorba aia "Saracul e si fudul" -
I don't think there should be arguments. Also, I use FatalTerror's Sims gamemode, I just got it now and I don't know how it works
-
Somewhere here:
-
Hello guys, when I open up my server and try to login I keep getting this error: attempt to index local 'results' a nil value on line 17. I really don't know what's the problem here, does any one know how to fix it?
-
Haideti sa incepem revolutia serverelor din Romania
..:D&G:.. replied to razvan2299's topic in General
Am avut server, chiar 3, dar nu se merita atata truda pentru acesti fucked in the ass kids. Acum hostez serverul de play al unui prieten, ca sa vada si el ce fel de jucatorii sunt pe MTA. Oricum, acum ajut vR-ul (noul Arena Gaming) -
Haideti sa incepem revolutia serverelor din Romania
..:D&G:.. replied to razvan2299's topic in General
Sa sti ca nu esti singurul care are scripturile oG Si eu am ultima versiune (pe 28 ianuarie 2015 le-am luat) plus UCP-ul si forum-ul. Insa, iti recomand sa nu le folosesti daca nu sti scripting FOARTE BINE, pentru ca au multe "backdoor"-uri, un prieten de al meu a deschis un server cu scripturile owl, si peste 2 minute sa trezit cu 4 indivizi, care iau spart baza de date, iau sters-o, plus hostul spart si forumul etc... Deci.. mno -
Hello guys, does anyone have a tent/vehicle save system for dayz servers? Thanks in advance.
-
Hello guys, I am trying to make a small function to delete all the vehicles from the server, but it doesn't seem to work and there are no errors: function delAllVehs(player) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then for key, value in pairs( getElementsByType( "vehicle" ) ) do if isElement( value ) then destroyElement( value ) outputChatBox(#value.." vehicles deleted!", player) end end end end addCommandHandler("delvehs", delAllVehs) Thank you.
-
addEventHandler("onResourceStart", getRootElement(), local xml = getResourceConfig("settings.xml") -- load XML file and get its root element local carmodel = xmlNodeGetAttribute(xml, "model") -- get attribute of root element local carX = xmlNodeGetAttribute(xml, "posX") local carY = xmlNodeGetAttribute(xml, "posY") local carZ = xmlNodeGetAttribute(xml, "posZ") local carA = xmlNodeGetAttribute(xml, "rot") createVehicle(carmodel, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carA)) end )
-
Hello, I am trying to make a job script, and I want to make a function where, if the player is not in the Criminal job then the gui will appear, else outputChatBox a message, here is the code: addEventHandler ( "onClientMarkerHit" , Marker , function ( hitPlayer ) if not (getPlayerTeam(hitPlayer) == "Criminal") then guiSetVisible ( GUIEditor.window[1] , true ) showCursor ( true ) else outputChatBox("You are already a criminal!", hitPlayer, 255, 0, 0) end end , false ) It doesn't output the message nor the gui.
-
Lol, I tried that before but it didn't work, and it was because I didn't use getTeamFromName Silly me. Thanks.
-
Hello guys, I wanted to make a script that sets admins into the "Staff" team when they login, here is the code: addEventHandler("onPlayerLogin", resourceRoot, function ( ) local Admins = getOnlineAdmins() if #Admins ~= 0 then for k,v in ipairs ( Admins ) do setPlayerTeam ( getPlayerName(v), "Staff") end end end ) function getOnlineAdmins() local t = {} for k,v in ipairs ( getElementsByType("player") ) do while true do local acc = getPlayerAccount(v) if not acc or isGuestAccount(acc) then break end local accName = getAccountName(acc) local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup("Admin")) if isAdmin == true then table.insert(t,v) end break end end return t end There are no errors and it doesn't set the player in the team, anyone know what's wrong?
-
As I already said, you cannot add a weapon in GTA/MTA! You can imitate a weapon but it is really hard (You have to mod an object into a weapon, attach it to the player, make sure that the player has the shooting animation when shooting and also create bullet effects and make them effective on the victim) And createWeapon is to spawn an already exising weapon (Default weapons) as an object on the map, and make them fire (or lets players fire with them I think)