
knash94
Members-
Posts
143 -
Joined
-
Last visited
Everything posted by knash94
-
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 )
-
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.
-
Im sorry but you must be able to tell the diffrence if you look at both codes
-
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
-
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
-
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
-
pretty obvius i meant server but lol my mistake
-
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...
-
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
-
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
-
Is that why it works in DP2.3? But thanks for trying to help (Y)
-
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 ;\
-
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.
-
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.
-
Maybe you zipped the folder not the contents?
-
Replacing original people with multiplayer people.
knash94 replied to Thehookerkiller01's topic in Scripting
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 -
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
-
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 )
-
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
-
ohh its you guys... The rapists, lol. Them beds are crazy.. i remember using them to cheat on fallout
-
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
-
hmm spotted somthing showCursor(true,false) Shouldnt it be showCursor( source, true)
-
Thanks for the help, it works fine =) Ive also updated the first post.
-
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
-
Are you vista? try "gta root/mta/core config.xml... use "248" ( Replace the old line ) That might work idk