Jump to content

Anubhav

Members
  • Posts

    2,277
  • Joined

  • Last visited

Everything posted by Anubhav

  1. Anubhav

    SetGroupData

    function FILESet(what,to) if what and to then local file = FILEGetFile(what) if file then if fileExists("Data/"..what..".data") then fileClose(file) fileDelete("Data/"..what..".data") end local file = FILEGetFile(what) if file then fileWrite(file,to) fileFlush(file) fileClose(file) end end end end
  2. Anubhav

    SetGroupData

    function setGroupData(group,data,key) if ( group and data and key ) then return FILESet("MyGroup-##"..group.."-"..data,key) end end
  3. Anubhav

    SetGroupData

    Gr0x @ Why was it setting when I created the group?? (wonder) Why isn't it working now??
  4. Anubhav

    SetGroupData

    Lol, are you serious??? There are 804 lines.... Do you think I'll post whole code? Answer is no, If I do also you'll leak them.
  5. Anubhav

    SetGroupData

    function changeTurfColor ( r, g, b, group ) if ( not tonumber ( r ) or not tonumber ( g ) or not tonumber ( b ) or not group ) then outputChatBox ( "Invalid input - r"..tostring(r).." | g:"..tostring(g).." | b:"..tostring ( b ).." | group: "..tostring ( group ), source, 255, 0, 0 ) else outputChatBox ( "You have changed the turf color sucessfully!", source, 0, 255, 0 ) setGroupData ( group, "TurfColor", table.concat ( { tostring ( r ), tostring ( g ), tostring ( b ) }, ", " ) ) refreshData(source) return true end return false end addEvent ( "onClientPlayerChangeTurfColor", true ) addEventHandler ( "onClientPlayerChangeTurfColor", root, changeTurfColor )
  6. How can you check if he is downloading the resources then lol?? Thats only the way I know.
  7. Anubhav

    SetGroupData

    Uhmm.. I realy need help now. The problem is this: setGroupData ( group, "TurfColor", table.concat ( { tostring ( r ), tostring ( g ), tostring ( b ) }, ", " ) ) When I create a group it works perfect and set it to 255,255,255 but here is its not setting it AT ALL!
  8. Thats wrong! Cleary wront! addEventHandler("onClientRender", root, function() if isTransferBoxActive() then dxDrawImage("youArguments") end end )
  9. function setupRandomRobber () local myPlayer = getRandomPlayer () local myBlip = createBlipAttachedTo ( myPlayer, 23 ) end
  10. local team = createTeam ( "TeamName", 0, 255, 0 ) local theMarker = createMarker ( -711.68450927734, 957.69964599609, 12.388543128967, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler("onMarkerHit", theMarker, function (thePlayer) if ( getElementType ( thePlayer ) == 'player' ) then if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer ) ) == 'TeamName' ) then setElementHealth ( thePlayer, 100 ) setPedArmor ( thePlayer, 100 ) giveWeapon ( thePlayer, 31, 2000 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), giveWeaponsOnSpawn ) end end )
  11. Anubhav

    SQL.

    Thanks for the help, worked!
  12. Anubhav

    SQL.

    dbExec(connection,"CREATE TABLE IF NOT EXISTS groupData (group TEXT, key TEXT, value TEXT)") dbExec failed; (1); near "group": Syntax error Whats wrong???
  13. Its maybe true. I am just trying to help...
  14. Anubhav

    [Help] xml

    I found the error, show me your loadSettingsFromXML.
  15. I never saw that topic. Maybe one day it would be hard. If the guy isn't a scripter, he won't understand anything (lol)>
  16. If text is already rendered before then it will show the error. I don't know where is your problem.. Because as you told in function test and blablabla. Anyways try this: function test() -- dxdraw and :~ bla bla -- couple of ends without handler function firstFunction() setElementData(localPlayer,"apple",1) removeEventHandler("onClientRender",getRootElement(),test) addEventHandler("onClientRender",root,test) end addEvent("firstFunctionn",true) addEventHandler("firstFunctionn",root,firstFunction) function secondFunction() setElementData(localPlayer,"apple",0) thirdFunction() end addEvent("secondFunction",true) addEventHandler("secondFunction",root,secondFunction) function thirdFunction() removeEventHandler("onClientRender",getRootElement(),test) end
  17. Facebook came here? Seriously lel.. MTA SA and Facebook have a big difference. And it can't be de-compiled at all if you click on anti-decompile!
  18. function zapytanie(player) local playerName = getPlayerName(player) local register = mysql_query(handler, "INSERT INTO `Players` SET `Nick`=? ", playerName ) outputChatBox("Poprawne zapytanie") end
  19. 1. Decompiling is not possible if you tick the Encrypt button and Anti-Decompile. 2. Thanks for telling, I din't noticed that!
  20. Today while I was thinking of a security. Some people compile thier scripts but the server gets hacked and they steal the server side. So why not make a script which WON'T WORK ON THE SERVER AT ALL? That would protect your scripts and prevent being leaked! Some functions you can use: local serverName = getServerName() function blablabla() if serverName == "Your server name here" then -- your script starts! end end Make sure to compile it. See? Whenever blablablaba function starts you should make this check. You can even use setElementData! Something like this would work: First script: local sec = false function enableAccount(source) if getAccountName(getPlayerAccount(source)) == "adminAccName" then -- to check if the acc name is of admin then only! Keep your acc name! setElementData( root, "serverProtected", true ) sec = true end end addCommandHandler("enableSecurity", enableAcconut) function join() if sec == true then setElementData( root, "serverProtected", true ) end end addEventHandler("onPlayerLogin", root, join) And in your another script you can use getElementData( root, "serverProtected") Like this: function one() if getElementData( root, "serverProtected" ) == true then end end Please remember to compile them. This will make your security system more better. Please tell some scripters who din't visit this page to do. It can help them to. I'll be finding more things to improve MTA SA security.
  21. Anubhav

    Help URGENT!!

    Go to wiki and click on Usefull Functions. Click on smoothMoveCamera!
  22. local connection = dbConnect("mysql","see_wiki") dbExec(connection, "CREATE TABLE IF NOT EXISTS tableName(column1,blablabla)") -- to create a table if it doesn't exist dbExec(connection, "INSERT INTO tableName VALUES(?,?,?)", "what", "hi", "bye") -- To insert a value into a TABLE. NOTE VALUS(?,?,?) should have question marks depending on columns. If columns are two there will be 2 question markers. and then it must be inserted after a comma. local query = dbQuery(connection,"SELECT * FROM tableName") -- Selects everything from the tableName! local poll = dbPoll(query,-1) -- Gets the result until it doesn't come answer = poll[1] -- The result is this. local query2 = dbQuery(connection,"SELECT column1 FROM tableName") -- selects column1 from a table name! local poll = dbPoll(query,-1) -- told before answer = poll[1] -- told before too
×
×
  • Create New...