Jump to content

knash94

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by knash94

  1. knash94

    save values

    Well the server your using does it have teams on it? It dont work without teams and updateDB doesnt need to be used.. It was to test it before. ( And its outdated )
  2. Well ive updated it quite alot you will need other scripts now that aint being released and dont say "OMG".. Ive released this script so dont complain... If there is a problem i guess you better have a look at dev wiki.
  3. knash94

    save values

    Im sorry but you must be able to tell the diffrence if you look at both codes
  4. knash94

    save values

    function dbadd () executeSQLCreateTable ( "ppplayers", "money INTEGER, health INTEGER, armour INTEGER, job TEXT, wanted INTEGER, player TEXT" ) end addCommandHandler ("dbadd", dbadd) function updatedb ( sourcePlayer, theTeam ) sourcename = getPlayerName ( sourcePlayer ) player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then outputChatBox("You have no account to update", sourcePlayer) else executeSQLUpdate ( "ppplayers", "money = '800', health = '50', armour = '100', job = 'Police', wanted = '1'", "player = '" .. sourcename .. "'" ) outputChatBox ("Update finished", sourcePlayer) end end addCommandHandler ("updatedb", updatedb) function onjoindb () local sourcename = getPlayerName ( source ) player = executeSQLQuery("SELECT money FROM ppplayers WHERE player=?", sourcename) if(#player == 0) then executeSQLInsert ( "ppplayers", "'600', '100', '0', 'Civillian', '0', '" .. sourcename .. "'" ) outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) else setPlayerMoney( source, player[1].money ) -- wanted = executeSQLQuery("SELECT wanted FROM ppplayers WHERE player=?", sourcename) setPlayerWantedLevel ( source, wanted[1].wanted ) -- job = executeSQLQuery("SELECT job FROM ppplayers WHERE player=?", sourcename) end end addEventHandler ( "onPlayerJoin", getRootElement(), onjoindb ) function onquitdb () local sourcename = getPlayerName ( source ) getmoney = getPlayerMoney ( source ) getplayerTeam = getPlayerTeam ( source ) wanted = getPlayerWantedLevel( source ) playerTeam = getTeamName ( getplayerTeam ) executeSQLUpdate ( "ppplayers", "money = '" .. getmoney .. "', health = '50', armour = '100', job = '" .. playerTeam .. "', wanted = '" .. wanted .. "'", "player = '" .. sourcename .. "'" ) end addEventHandler ( "onPlayerQuit", getRootElement(), onquitdb ) Not all the functions work but you can easily change/fix it
  5. knash94

    save values

    https://mtasa.com/forum/viewtopic.php?f= ... 92c1a90794 may help you on my post... if you are on nightly i will update the script later so it will work
  6. function createdb () executeSQLCreateTable ( "ppplayers", "money INTEGER, health INTEGER, armour INTEGER, job TEXT, wanted INTEGER, skin INTEGER,player TEXT" ) end addCommandHandler ("dbadd", createdb ) function updatedb ( sourcePlayer, theTeam ) sourcename = getClientName ( sourcePlayer ) player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then outputChatBox("You have no account to update", sourcePlayer) else executeSQLUpdate ( "ppplayers", "money = '800', health = '50', armour = '100', job = 'Police', wanted = '1'", "skin = '110'", "player = '" .. sourcename .. "'" ) outputChatBox ("Update finished", sourcePlayer) end end addCommandHandler ("updatedb", updatedb) function onjoindb () local sourcename = getClientName ( source ) player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then executeSQLInsert ( "ppplayers", "'600', '100', '0', 'Civillian', '0', '110', '" .. sourcename .. "'" ) outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) else local money = executeSQLSelect ( "ppplayers", "money", "player = '" .. sourcename .. "'" ) setPlayerMoney( source, money[1][1] ) -- local wanted = executeSQLSelect ( "ppplayers", "wanted", "player = '" .. sourcename .. "'" ) setPlayerWantedLevel ( source, wanted[1][1] ) -- local job = executeSQLSelect ( "ppplayers", "job", "player = '" .. sourcename .. "'" ) setPlayerTeam( source, getTeamFromName( job[1][1] ) ) -- local skin = executeSQLSelect ( "ppplayers", "skin", "player = '" .. sourcename .. "'" ) setPlayerSkin ( source, skin[1][1] ) outputChatBox("Welcome back " .. sourcename .. " to the " .. job[1][1] .. " team... You have $" .. money[1][1], source) end end addEventHandler ( "onPlayerJoin", getRootElement(), onjoindb ) function onquitdb () local sourcename = getClientName ( source ) getmoney = getPlayerMoney ( source ) getplayerTeam = getPlayerTeam ( source ) wanted = getPlayerWantedLevel( source ) skin = getPlayerSkin ( source ) playerTeam = getTeamName ( getplayerTeam ) executeSQLUpdate ( "ppplayers", "money = '" .. getmoney .. "', health = '50', armour = '100', job = '" .. playerTeam .. "', wanted = '" .. wanted .. "', skin = '" .. skin .. "', player = '" .. sourcename .. "'" ) end addEventHandler ( "onPlayerQuit", getRootElement(), onquitdb ) I have not tested it but it should work edit: i wont do weapons quite yett
  7. pretty obvius i meant server but lol my mistake
  8. DP2.3? https://mtasa.com/forum/viewtopic.php?f= ... a12d53f53b and look at my post with the big script Its client side so your meta should be...
  9. I now know its player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then There has been no change to SQLselect recently and that has not been announced ? Sorry for the hassle.. Im just stuck
  10. Nice one (Y) Sounds like it will save me alot of time and handy for the meta.xml too , Ive only used notepad2 so far but im sure im gnna use this when its finished I really wish i had coding skills like you
  11. Is that why it works in DP2.3? But thanks for trying to help (Y)
  12. Sorry to bump but i need to start moving on with some scripts and this needs to be fixed before i can continue... Anyone knows what the problem is? works like a dream in DP2.3 tho ;\
  13. function dbadd () executeSQLCreateTable ( "ppplayers", "money INTEGER, health INTEGER, armour INTEGER, job TEXT, wanted INTEGER, player TEXT" ) end addCommandHandler ("dbadd", dbadd) function updatedb ( sourcePlayer, theTeam ) sourcename = getClientName ( sourcePlayer ) player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then outputChatBox("You have no account to update", sourcePlayer) else executeSQLUpdate ( "ppplayers", "money = '800', health = '50', armour = '100', job = 'Police', wanted = '1'", "player = '" .. sourcename .. "'" ) outputChatBox ("Update finished", sourcePlayer) end end addCommandHandler ("updatedb", updatedb) function onjoindb () local sourcename = getClientName ( source ) player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then executeSQLInsert ( "ppplayers", "'600', '100', '0', 'Civillian', '0', '" .. sourcename .. "'" ) outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) else local money = executeSQLSelect ( "ppplayers", "money", "player = '" .. sourcename .. "'" ) setPlayerMoney( source, money[1][1] ) -- local wanted = executeSQLSelect ( "ppplayers", "wanted", "player = '" .. sourcename .. "'" ) setPlayerWantedLevel ( source, wanted[1][1] ) -- local job = executeSQLSelect ( "ppplayers", "job", "player = '" .. sourcename .. "'" ) setPlayerTeam( source, getTeamFromName( job[1][1] ) ) outputChatBox("Welcome back " .. sourcename .. " to the " .. job[1][1] .. " team... You have $" .. money[1][1], source) end end addEventHandler ( "onPlayerJoin", getRootElement(), onjoindb ) function onquitdb () local sourcename = getClientName ( source ) getmoney = getPlayerMoney ( source ) getplayerTeam = getPlayerTeam ( source ) wanted = getPlayerWantedLevel( source ) playerTeam = getTeamName ( getplayerTeam ) executeSQLUpdate ( "ppplayers", "money = '" .. getmoney .. "', health = '50', armour = '100', job = '" .. playerTeam .. "', wanted = '" .. wanted .. "'", "player = '" .. sourcename .. "'" ) end addEventHandler ( "onPlayerQuit", getRootElement(), onquitdb ) function cash ( sourcePlayer ) setPlayerMoney ( sourcePlayer, "50000") end addCommandHandler ("cash", cash) I keep getting error: db.lua line 33: attempt to call index field '?' (A nil value) This is on MTA nightly and if anyone can help to clean up this script to mta 1 i will be grateful.. Thank you.
  14. It is still in its early stages so it will still take some time untill it is out yet But it is looking quite good so far. I also use my hamachi server while im working on it so if you have hamachi join network: Virtuastudios... I know it may sound a bit noobie using Hamachi but it is nice n fast & private.
  15. Maybe you zipped the folder not the contents?
  16. Why do you keep posting new topics? Keep it to one help thread please And its more a less impossible... If you had that much peds in mta i think it might crash and that you have to script evry single ped... quite annoying
  17. It should work.. the only thing i can think of is that your not entering the port correctly.. say on game monitor you found: 125.125.21.21:22004 and then on quick connect you will see somthing like Server ip port if that dont work type into internet explorer or run or somthing like this: mtasa://125.125.21.21:22004
  18. I aint fixed it up for regular use and it was 50 health for when i was testing it also you wont need to put dbadd evry time.. if you wish you can change the handler for when resource starts. ( But it dont make no diffrence )
  19. function createdb () executeSQLCreateTable ( "ppplayers", "money INTEGER, health INTEGER, armour INTEGER, job TEXT, wanted INTEGER, player TEXT" ) end addCommandHandler ("dbadd", createdb ) function updatedb ( sourcePlayer, theTeam ) sourcename = getClientName ( sourcePlayer ) player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then outputChatBox("You have no account to update", sourcePlayer) else executeSQLUpdate ( "ppplayers", "money = '800', health = '50', armour = '100', job = 'Police', wanted = '1'", "player = '" .. sourcename .. "'" ) outputChatBox ("Update finished", sourcePlayer) end end addCommandHandler ("updatedb", updatedb) function onjoindb () local sourcename = getClientName ( source ) player = executeSQLSelect ( "ppplayers", "player", "player = '" .. sourcename .. "'" ) if ( player == false ) then executeSQLInsert ( "ppplayers", "'600', '100', '0', 'Civillian', '0', '" .. sourcename .. "'" ) outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) else local money = executeSQLSelect ( "ppplayers", "money", "player = '" .. sourcename .. "'" ) setPlayerMoney( source, money[1][1] ) -- local wanted = executeSQLSelect ( "ppplayers", "wanted", "player = '" .. sourcename .. "'" ) setPlayerWantedLevel ( source, wanted[1][1] ) -- local job = executeSQLSelect ( "ppplayers", "job", "player = '" .. sourcename .. "'" ) setPlayerTeam( source, getTeamFromName( job[1][1] ) ) outputChatBox("Welcome back " .. sourcename .. " to the " .. job[1][1] .. " team... You have $" .. money[1][1], source) end end addEventHandler ( "onPlayerJoin", getRootElement(), onjoindb ) function onquitdb () local sourcename = getClientName ( source ) getmoney = getPlayerMoney ( source ) getplayerTeam = getPlayerTeam ( source ) wanted = getPlayerWantedLevel( source ) playerTeam = getTeamName ( getplayerTeam ) executeSQLUpdate ( "ppplayers", "money = '" .. getmoney .. "', health = '50', armour = '100', job = '" .. playerTeam .. "', wanted = '" .. wanted .. "'", "player = '" .. sourcename .. "'" ) end addEventHandler ( "onPlayerQuit", getRootElement(), onquitdb ) You may want to delete the useless information.. its very is moddable too. Their may be a few bugs but this is just finished so.. dont rely on it too much
  20. knash94

    Gameplay pics!

    ohh its you guys... The rapists, lol. Them beds are crazy.. i remember using them to cheat on fallout
  21. I remember being in this server before with gamesnert. Looks like it has a good start and ill quite look foward to playing it in the future , i dont really want to join the dev team because im not sure if i would be much help and + im working on my own project... But good luck
  22. hmm spotted somthing showCursor(true,false) Shouldnt it be showCursor( source, true)
  23. Thanks for the help, it works fine =) Ive also updated the first post.
  24. Hello all MTA players. I have been making an rpg script for a while now but now im starting to get to my data storage script where it will store all types of information ( Money, jobs, wanted level, licenses and much more ) The rpg script so far contains.. -> Basic Arrest system -> Basic heal system ( Due to change ) -> Gui menus to join teams ( Changing soon ) -> 6 teams -> Datastorage -> Job center The following contains scripts that will be added at a later date -> Drivers License -> Car shop -> Anti theft system ( Also works for cop cars ) -> 24/7 ( Please post ideas of items that could be sold ) -> Taxi -> Robbbers ( Rob buildings NOT players ) -> Much more Please reply with ideas or to become a developer for this RPG script. Thank you K.Nash
  25. Are you vista? try "gta root/mta/core config.xml... use "248" ( Replace the old line ) That might work idk
×
×
  • Create New...