Jump to content

monumento

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by monumento

  1. Isn't a db easier to edit? Or... maybe the better idea would be loading all phrases from DB (i really want to make a PHP interfrace so the MySQL is best for me) when server starts and then just making a table with them. Also good. P.S: I just wont to call the query from MTA SERVER because i want maximum speed, the PHP server and callRemote will do their job correctly. (I guess it's faster ) P.S2: Is there a possibility to change the callRemote user-agent (if the MTA is acting like a browser(?) when executing a callRemote)? @Edit: Nevermind P.S2. I found LuaSocket, i'll testi it later. Hope it'll give me exactly what what i expect.
  2. [url=https://community.multitheftauto.com/?p=resources&s=details&id=]https://community.multitheftauto.com/?p=resources&s=details&id=[/url]8612 Here is it. Just make a timer to save them or [url=https://wiki.multitheftauto.com/wiki/OnResourceStop]https://wiki.multitheftauto.com/wiki/OnResourceStop[/url]
  3. Hey. I have a question about the multi-language. What would be best for you? #1: -- some code if getElementData(element, "s:lang") == "pl_PL" then outputChatBox("omgwtf POL") elseif getElementData(element, "s:lang") == "en_US" then outputChatBox("omgwtf ENG") end -- somecode or... function langKey(playah, langKey) if getElementData(element, "s:lang") == "pl_PL" then -- searching for langKey in mysql database elseif getElementData(element, "s:lang") == "en_US" then -- searching for langKey in mysql database end return langKey end function cmd(player) outputChatBox(langKey(playah, "lang.command.test")) end -- command handler (it's just pseudocode) Which would be better for you? The second option wouldnt lag me cuz i'd use the PHP requests instead of lagging mysql_query from MTA.
  4. Ciebie chyba nie kosztuje? IPB jest chyba najlepszym dostępnym silnikiem forum. chyba sie nie zrozumielismy do konca. zwrocilem uwage na to, ze jest drogie w sensie, ze nic za nie nie dali tylko sciagneli z internetpow
  5. HI. I have ubuntu 14 and i want to play MTA:SA so... I just installed the GTA: San Andreas and with single player everything is okay. Literally, no general problems. Then i installed MTA:SA. When im opening it in wine: wine "Multi Theft Auto.exe" Then it's showing the virtual desktop and and its closing - the mod doesnt work. I tried to change some options in wine graphic configuration but nothing is helping. Can any1 help me? Thanks. Edit: THE logfile:
  6. wow 25 slotow serwer chujowy hosting ts3 lokalny/rdp drogie ipb __ Serio?
  7. monumento

    My Request

    omg https://community.multitheftauto.com/index.php?p= ... ls&id=5028
  8. It's possible. But if you want to make to make it for DD server you need to put it somewhere else, not in onpalyerentercar because player is teleported to car.
  9. getElementsByType for loop getElementData outputChatBox
  10. monumento

    Money hack

    That may be a bug somewhere in your scripts/script. That's all.
  11. If the file is compiled then you cant.
  12. vehicle_spawns.lua then just add them to the table like others. ( X,Y,Z values )
  13. function checkAllNicksOfPlayer(who, cmd, playah) local targetPlayer = getPlayerFromNamePart(playah) -- searching player from name part so we dont need to write all the name if not targetPlayer then outputChatBox("this player does not exist", who) else local targetSerial = getPlayerSerial(targetPlayer) -- getting serial to check the db local searchForANicks = executeSQLQuery("SELECT `nicks` from `aliases` WHERE `serial`=?", targetSerial) -- checking if #searchForANicks > 0 then -- we found player outputChatBox("#FFD330History of nicks for "..getPlayerName(targetPlayer)..":#FAFAFA "..searchForANicks[1].nicks, who, 0, 0, 0, true) -- show message to command executor with player nicks history else outputChatBox("#FFD330This player doesnt have a nick history (Which mean problem with your sqlite db...)", who, 0, 0, 0, true) end end end as always debugscript 3 then try. if you got This player doesnt have a nick history (Which mean problem with your sqlite db...) then send me your registry.db (better on the pm) #edit: i just gave it to my friends and it works fine for them
  14. Dat's because you put wrong nick... Look at this local targetPlayer = getPlayerFromNamePart(playah) -- searching player from name part so we dont need to write all the name local targetSerial = getPlayerSerial(targetPlayer) -- getting serial to check the db And think. Change all the function for this: function checkAllNicksOfPlayer(who, cmd, playah) local targetPlayer = getPlayerFromNamePart(playah) -- searching player from name part so we dont need to write all the name if not targetPlayer then outputChatBox("this player does not exist", who) else local targetSerial = getPlayerSerial(targetPlayer) -- getting serial to check the db local searchForANicks = executeSQLQuery("SELECT `nicks` from `aliases` WHERE `serial`=?", targetSerial) -- checking if #searchForANicks == 1 then -- we found player outputChatBox("#FFD330History of nicks for "..getPlayerName(targetPlayer)..":#FAFAFA "..searchForANicks[1].nicks, who, 0, 0, 0, true) -- show message to command executor with player nicks history end end end Then try. Nahh men. Both forms are ok.
  15. https://community.multitheftauto.com/ind ... ls&id=9031 Download it. Line 32 there is: addEventHandler("onPlayerChangeNick", getRootElement(), whenPlayerChangeNick) -- adding event handler, you should know why you need to do it, if not then click "addeventhandler" and you'll get an wiki article. idk where u find that 32 line and executing a query
  16. /debugscript 3 What errors you got? Also... i released a resource for it: https://community.multitheftauto.com/ind ... ls&id=9031 It works.
  17. monumento

    Radar

    Default radar uses hardcoded blips. CreateBlipAttachedTo createBlip createBlipAttachedTo getBlipColor getBlipIcon getBlipSize setBlipColor setBlipIcon setBlipSize getBlipOrdering setBlipOrdering getBlipVisibleDistance setBlipVisibleDistance
  18. 1. Search and use the "VUVUZELE"/"VUVUZELA" script. It have in-built alias/pma. 2. I wrote smthing for you function whenPlayerJoinTheServer() local playerNick = removeHexColorCode(getPlayerName(source)) local playerSerial = getPlayerSerial(source) local searchForAPlayer = executeSQLQuery("SELECT `nicks` FROM `aliases` WHERE `serial`=?", playerSerial) -- trying to select a player from the db if #searchForAPlayer == 0 then -- if we havent found our player then executeSQLQuery("INSERT INTO `aliases`(serial, nicks) VALUES (?, ?)", playerSerial, playerNick) -- insert his record to the table else -- we found our player local actualNicks = searchForAPlayer[1].nicks -- get the 'nicks' data from record if string.find(actualNicks, playerNick) then -- if he have SAME NICK as in the database -- do nothing, why we should double player nicks in db? else -- he dont have this nick in DB local addNewNick = actualNicks .. ", " .. playerNick -- expand variable by adding nick player have now executeSQLQuery("UPDATE `aliases` SET `nicks`=? WHERE `serial`=?", addNewNick, playerSerial) -- executing sql query which updates `texts` value with extanded variable containing new nick end -- ending end-- ending end-- ending addEventHandler ("onPlayerJoin", getRootElement(), whenPlayerJoinTheServer) -- adding event handler, you should know why you need to do it, if not then click "addeventhandler" and you'll get an wiki article. function getPlayerFromNamePart(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function checkAllNicksOfPlayer(who, cmd, playah) local targetPlayer = getPlayerFromNamePart(playah) -- searching player from name part so we dont need to write all the name local targetSerial = getPlayerSerial(targetPlayer) -- getting serial to check the db local searchForANicks = executeSQLQuery("SELECT `nicks` from `aliases` WHERE `serial`=?", targetSerial) -- checking if #searchForANicks == 1 then -- we found player outputChatBox("#FFD330History of nicks for "..getPlayerName(targetPlayer)..":#FAFAFA "..searchForANicks[1].nicks, who, 0, 0, 0, true) -- show message to command executor with player nicks history end end addCommandHandler("pma", checkAllNicksOfPlayer) -- adding command function createTables() local a = executeSQLQuery("CREATE TABLE IF NOT EXISTS `aliases` (`serial` TEXT, `nicks` TEXT)") -- adding sqlite table with serial (to identificate player) and all nicks if a then outputDebugString("Created table for players aliases") end -- show a msg in console to be sure it all works end addEventHandler("onResourceStart", getResourceRootElement(), createTables) -- adding event handler, you should know why you need to do it, if not then click "addeventhandler" and you'll get an wiki article. function removeHexColorCode(s) return s:gsub( '#%x%x%x%x%x%x', '' ) or s end My english is bad so if you dont understand comments just tell me. And you need also to make a saving when player CHANGE nick while being on the server. Have fun
  19. 1. You can make your own weapon system (you can make your own binds, then when bind getElementData if he have gun and give it to him, or smthing similiar. 2. Try to use this script: addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), -- adding an event handler for onplayerweaponswitch function ( previousWeaponID, currentWeaponID ) if previousWeaponID == 22 and getElementData(source, "deagle") == true then -- checking if previous weapon was colt and giving dgl giveWeapon(source, 24, 30) -- giving playah a dgl end if previousWeaponID == 24 and getElementData(source, "colt") == true then -- checking if previous weapon was dgl and giving colt giveWeapon(source, 22, 30) -- giving playah a colt end end ) function givePlayerAGun (who, cmd, agun) -- 'gun' argument: 1 - colt, 2 - deagle outputChatBox("YOU EXECUTED: "..tostring(cmd), who) if agun == "1" then giveWeapon(who, 22, 30, true) -- giving playah a colt setElementData(who, "colt", true) -- element data fun, i think there is other idea to do it, think elseif agun == "2" then giveWeapon(who, 24, 30, true) -- giving playah a dgl setElementData(who, "deagle", true) -- element data fun, i think there is other idea to do it, think end end addCommandHandler ( "givemeagun", givePlayerAGun )-- command giving a weapon, use /givemeagun 1 or /givemeagun2 It works but its just basic, you need to do some shit client-side also to get ammo and recover it, blah blah It works as it should.
  20. IMHO he have other script to have colored rims and he took screenshoot wile he has that other script running
  21. monumento

    Bots

    Aggressive ped attacking other players? slothbot \
  22. Make a timer. In your code protect function will be executed one-time when you start resource. setTimer
  23. So, you want to have two weapons from one type at the same time? Try this on(Client)PlayerWeaponSwitch
×
×
  • Create New...