
Anubhav
Members-
Posts
2,277 -
Joined
-
Last visited
Everything posted by Anubhav
-
You CAN create a database on your PC , Search for XAMPP Did you read his post, He said 'SQL' not 'MySQL'. Use executeSQLQuery or db functions with "sqlite" connection.
-
Found one more error: executeSQLQuery("CREATE TABLE IF NOT EXISTS BoDGroupTurf ( Group TEXT, Count INT)") Same as I told. Whats going wrong/ EDIT: By using db functions this works fine.
-
I realy need help this is urgent very urgent!
-
No nothing's wrong in spelling. EDIT: If you want proof: executeSQLQuery("CREATE TABLE IF NOT EXISTS BoDGroupTurf ( Group TEXT, Count INT )") This Is Where i create table
-
function assignDimension() for k,v in ipairs(gameDimensions) do if v[1] == getElementData(localPlayer, "game") then setElementDimension(localPlayer, v[2]) return true end end end
-
executeSQLQuery("SELECT * FROM BoDGroupTurf WHERE Group=?", playerGang) Whats wrong with this? It says Database Query Failed: near "Group":syntax error
-
Thanks, but I that thing I fixed it myself. Please lock the topic
-
addEvent("toggleDrawing", true) addEventHandler('toggleDrawing', root, function(bo) if bo == true then addEventHandler("onClientRender", root, draw) else removeEventHandler("onClientRender", root, draw) end end ) It doesn't add the handler? Why? The draw function is up and created no error.
-
bro this don't makes lag Lol but your way is good .. but his way don't makes lag .. cus he insert ( Objects ) in table and make a loop and get all objects test the code by yourself and tell me if u got lag . Your code will take more ticks = can create lag.
-
Just use SQL lol. What language do you talk in? We can't help you like this.
-
Oh woah, you correct IT ONLY. You don't care if it makes lag and use alot of RAM right? Then don't talk. Whenever you create it attach it there only instead of making loops and wasting the energy.
-
Element data's are stored in tables some thing like this. someData = {} setElementData( source, "someTest", "hi") -- now it will turn into someData = { [source's uservalue]={{data="someTest", value="hi"}}, } -- I am not sure, but I guess they use nested tables, Whenever you quit the user data changes ( i assume that ) and so you can't get it back from the table I suggest you use tables wherever possible. Do not use setElementData/getElementData until its 100% important because it takes alot of CPU and using it alot can cause lag.
-
You will waste his CPU on adding event handler by one more loop lol. local areas = { } function joyn ( ) local objects = getElementsByType( "object" ) for i, v in ipairs( objects ) do if ( getElementModel( v ) == 1381 ) then local col = createColSphere ( 0, 0, 0, 2 ) attachElements ( col, v, 0, 0, 1 ) setElementData ( col, "type", "mine" ) table.insert ( areas, col ) addEventHandler ( 'onColShapeHit', col, colHit ) end end end end addEventHandler ( "onResourceStart", resourceRoot, joyn ) function colHit ( theElement ) if ( getElementType ( theElement ) == "vehicle" ) then if ( getElementData(source, "type") == "mine" ) then if ( getAttachedElements( source ) ) then for _,v in ipairs ( getAttachedElements( source ) ) do if ( getElementModel( v ) == 1381 ) then local x, y, z = getElementPosition ( v ) createExplosion ( x, y, z, 8 ) destroyElement ( v ) destroyElement ( source ) end end end end end end
-
How will it work like that? It will do it for each CLIENT. You must trigger from server like this Server: triggerClientEvent(someElement, "hi", someElement) Client: addEvent("hi", true) addEventHandler('hi', root, function() -- do stuff end This will be triggered for specified element/player. This is only a example, do it yourself and tell us if you get a error.
-
Why won't it?
-
setTimer( addTeamBlip, 10000, 0 )
-
He was wrong then, it is better performance to get the account outside the loop. addCommandHandler("duty", function(p) local acc = getPlayerAccount(p) for k,v in ipairs(players) do -- loop code end -- rest of your code end ) Damn you misunderstood that. I was telling TAPL is correct, he told me to take it of loop anyways.
-
Arnold told me to increase the performance by that and I did it. Anyways thanks to you too.
-
Problem solved, the problem was: I was replacing the script in other folder LOL
-
Its realy strange dude, I don't know whats wrong. What do you mean by p was checked?
-
addCommandHandler("duty", function(p) for k,v in ipairs(players) do local acc = getPlayerAccount(p) This is only piece of code. Error: Expect element at argument one, got nil
-
Thats why I am saying. Chris!i!, some MTA:SA adminstrator caught the server and added it into anti-tag protection list. Now tell contact ccw by a PM to request him. ( That's what I did when I had a question about it, I got the reply so fast! )
-
Nice! Keep it up, loving it!