Jump to content

AstroBurn

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by AstroBurn

  1. function onChatMessage ( _, theElement ) if ( getElementType ( theElement ) ~= "player" ) then cancelEvent ( ) end end addEventHandler ( "onChatMessage", root, onChatMessage ) I actually got it, thanks for the help but it's still that "onChatMessage" is done in server, and it does not cancel the client outputchatbox, or maybe because of some other reason. At least i finished by preventing most of the spam by just adding this: addEventHandler("onClientChatMessage",root, function (msg) if msg == "" or msg:find('www.',1,true) then cancelEvent(true) end end ) So It's enough for me, there is no spam or pub, but the mapper can still use outputchatbox to comment his map. Thank to all who helped me in this thread.
  2. i tried this, and it does nothing, it looks like we can't cancel this event + i tested it and if im not wrong it doesn't detect client outputChatBox type /debugscript 3 then restart the resource that this code is in, and tell me the error message you got. I am not getting any error message, it's simply like i can't cancel this event I actually want to cancel scripts messages, not players ones
  3. i tried this, and it does nothing, it looks like we can't cancel this event + i tested it and if im not wrong it doesn't detect client outputChatBox
  4. Well thanks, but it's not helping me in any ways, when i try with the server , onChatMessage, i can't cancel this event, and it doesn't output Clients messages if anyone have an idea to help me
  5. Thx for the help, it actually works if i use the client event: function preventSpam() if not (getElementType(source) == "player") then cancelEvent() end end addEventHandler("onClientChatMessage", getRootElement(), preventSpam) But it cancel all the chatbox msg, probably because the event doesn't return the element's name i don' tknow how to fix that
  6. Hello, i wanted to prevent scripts or map to spam the chatbox with messages, so i removed the right with the acl "function.outputChatBox" access="false"> it's working well for the non-admin scripts, but I just can't do the same for the maps, i tried by removing the right to all the acls, but the in-map scritps can still use outputChatBox. Someone could help me please?
  7. sorry to up this thread again, your script is working well, but i can't make it works within the script itself, it just doesn't create a new accountName, or even if i make it byusing your command function, it doesn't load/save on it. I am using this for exemple: savePlayerData(source,"level",1) it should set the player's level to one, and create a column if there is none, but it don't do it
  8. Ah yeah it's working now, just some shit from me ^^ thx a lot for helping me.
  9. Well im sorry to bother you even more, but it's not adding a new account if the account doesn't exist in the userpanel database so i can't rly test it
  10. here it is local sqliteData = "accountName STRING, cash INT, mapsPlayed INT, mapsWon INT, everPurchasedNametagColor INT, level INT, unlockedAchievements INT, totalTimesJoined INT, totalHunters INT, totalToptimes INT, totalMoneyEarned INT, totalMoneySent INT, totalBets INT, totalBetsEarned INT, totalBetsWon INT, totalDeaths INT, totalPlayingTimeMinutes INT, totalPlayingTimeHours INT, totalReactionTests INT, bestReactionTime INT, ach1 INT, ach2 INT, ach3 INT, ach4 INT, ach5 INT, ach6 INT, ach7 INT, ach8 INT, ach9 INT, ach10 INT, ach11 INT, ach12 INT, ach13 INT, ach14 INT, ach15 INT, ach16 INT, ach17 INT, ach18 INT, ach19 INT, ach20 INT, ach21 INT, ach22 INT, ach23 INT, ach24 INT, ach25 INT, ach26 INT, ach27 INT, ach28 INT, ach29 INT, ach30 INT, ach31 INT, ach32 INT, ach33 INT, ach34 INT, ach35 INT, ach36 INT, ach37 INT, ach38 INT, ach39 INT, ach40 INT, everPurchasedSkin INT, everSetCustomVehicleColor INT, useCustomVehicleColor STRING, c1 INT, c2 INT, c3 INT, c4 INT, hlcRed INT, hlcBlue INT, hlcGreen INT, admin_redo INT, admin_nextmap INT, allowPersonalDetails STRING, allowStats STRING, useCustomNametag STRING, useCustomSkin STRING, soundMessage STRING, soundRequest STRING, showOnDeath STRING, useHunterSkin STRING, chatAcceptMode INT, joinedBefore INT, horn1 INT, horn2 INT, horn3 INT, horn4 INT, horn5 INT, horn6 INT, horn7 INT, lastSetHorn INT, pName STRING, pAge STRING, pEmail STRING, pMsn STIRNG, pSkype STRING, pXfire STRING, pICQ STRING, pXBL STRING, convertedTotal INT"
  11. addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() executeSQLCreateTable("userpanel", tostring(sqliteData)) end) and the table is fucking long x)
  12. tried, and in debugscript it's saying no such column (myaccountname) so with your code it's not adding new account but i appreciate your help
  13. i tried, but it's still making 219 records with the same accountName ...
  14. Datatype is the data info to be stored/loaded like savePlayerData(thePlayer,"cash",50000) "cash" is the datatype
  15. hello, i have never used database saving or sql, and i am stuck with this code, it's creating like 20 time my account, and it's not rly working could anyone help me ? function loadPlayerData (player,datatype) sourceAccount = getPlayerAccount ( player ) if isGuestAccount ( sourceAccount ) then return 0 else local playerIP = getAccountName (getPlayerAccount(player)) if (playerIP) then local playerRootNode = executeSQLQuery("SELECT accountName FROM userpanel WHERE accountName='"..playerIP.."'") if ( type( playerRootNode ) == "table") then local playerRootNode = executeSQLQuery("INSERT INTO userpanel (accountName) VALUES ('"..playerIP.."')") return 0 else local playerData = executeSQLQuery("SELECT "..datatype.." FROM userpanel WHERE accountName='"..playerIP.."'") if (playerData) then outputChatBox('bruh') return playerData else executeSQLQuery("INSERT INTO userpanel ("..datatype..") VALUES ('"..datatype.."') WHERE accountName='"..playerIP.."'") return 0 end end end end end function savePlayerData (player,datatype,newvalue) sourceAccount = getPlayerAccount ( player ) if isGuestAccount ( sourceAccount ) then return 0 else local playerIP = getAccountName (getPlayerAccount(player)) if (playerIP) then local playerRootNode = executeSQLQuery("SELECT accountName FROM userpanel WHERE accountName='"..playerIP.."'") if not (playerRootNode == false) then local newNodeValue = executeSQLQuery("UPDATE userpanel SET "..tostring(datatype).."='"..tostring(newvalue).."' WHERE accountName='"..playerIP.."'") return newNodeValue else local playerRootNode = executeSQLQuery("INSERT INTO userpanel (accountName) VALUES ('"..playerIP.."')") local newNodeValue = executeSQLQuery("INSERT INTO userpanel ("..tostring(datatype)..") VALUES ('"..tostring(datatype).."') WHERE accountName='"..playerIP.."'") return newNodeValue end end end end
  16. Hi, i have a mta server on a linux VPS, but i would make that it use the http-client-files folder to download the client files, for a faster download. My question is: is it possible to link the httpdownloadurl to the home folder of the vps ?
×
×
  • Create New...