Jump to content

mjau

Members
  • Posts

    589
  • Joined

  • Last visited

Everything posted by mjau

  1. Sure I am making a SQL system with exported functions to use in scripts later now im making the vehicle storage functions and was going to start creating the vehicle system in another resource wich uses theese exported functions but i need to knopw how to take all rows from the table returned and change the vehicleID wich is in the table to vehiclename then add them to gridlist...
  2. the function is exportes so i can easely send the table to client with triggerclientevent but how can i get all rows in table i selected then trun vehicle id into vehicle name and add to gridlist ?
  3. ok but if i wanna turn the id into the vehicle name and put that in gridlist how ?
  4. if i return a table like this function getOwnedCars(accountName) local vehicles = executeSQLSelect("vehicles", "vehicleID", "owner = '"..accountName.."'") return vehicles end how can i get vehicle names from all the id rows in the table and add them to a gridlist?
  5. if u update it update the color selector to the one freeroam uses now...
  6. mjau

    onLine Admins

    if you got a version of the code wich is bettter(shorter faster etc) then its no rule saying your not allowed to post it
  7. addEvent("sendMoney", true) addEventHandler("sendMoney", getRootElement(), function ( playerNick, amount ) local cash = getPlayerMoney(source) if (cash > tonumber(amount)) and tonumber(amount) > 0 then toWho = getPlayerFromName(playerNick) if (toWho ~= false) then givePlayerMoney(toWho,amount) name = getPlayerName(source) takePlayerMoney(source,amount) outputChatBox("You've given money amount of: " .. amount .. "$ to: " .. playerNick,source,255,255,150) outputChatBox(name .. " has given you money amount of: " .. amount .. "$!",toWho,255,255,245) else outputChatBox("Player did not exist",source,255,0,0) end else outputChatBox("Insufficient founds!",source,255,0,0) end end) Try this
  8. mjau

    SQL problem again

    LOoool i mixed newSkin and newClothes tnx
  9. mjau

    SQL problem again

    <meta> <info author='Kimmis9' version='1.0.0' name='SQL' description='SQL' type='script' /> <script src='main_S.lua' /> <export function="addPlayerToSQLDatabase" type="server"/> <!--Arguments(accountName) --> <export function="removePlayerFromSQLDatabase" type="server"/> <!--Arguments(accountName) --> <export function="getCurrentClothes" type="server"/> <!--Arguments(accountName) --> <export function="newClothes" type="server"/> <!--Arguments(accountName, newClothes) --> <export function="getBankMoney" type="server"/> <!--Arguments(accountName) --> <export function="depositMoney" type="server"/> <!--Arguments(accountName, amount) --> <export function="withdrawMoney" type="server"/> <!--Arguments(accountName, amount) --> <export function="getSQLCordinates" type="server"/> <!--Arguments(accountName) --> <export function="updateSQLCordinates" type="server"/> <!--Arguments(accountName, x, y, z) --> </meta>
  10. hi i have made a small sqlite script just to practice on it so i use the exported functions now my problem is im trying to save a skin id somone chooses from my skin selector my sql code so far function createSQLTableOnStart() executeSQLCreateTable("players", "accName, bankMoney, clothes, x, y, z") end addEventHandler("onPlayerJoin", getRootElement(), createSQLTableOnStart) function addPlayerToSQLDatabase(accountName) return executeSQLInsert("players", "'"..accountName.."', '20000', '0', '1644', '-2245', '14'") end function removePlayerFromSQLDatabase(accoutName) return executeSQLDelete("players", "accName = '"..accountName.."'") end function getCurrentClothes(accountName) local clothes = executeSQLSelect("players", "clothes", "accName = '"..accountName.."'") return clothes[1]['clothes'] end function newClothes(accountName, clothes) return executeSQLUpdate("players", "clothes = '"..clothes.."'", "accName = '"..accountName.."'") end function getSQLCordinates(accountName) local x, y, z = executeSQLSelect("players", "clothes", "accName = '"..accountName.."'") end function updateSQLCordinates(accountName, x, y, z) return executeSQLUpdate("players", "x = '"..x.."', y = '"..y.."', z = '"..z.."'", "accName = '"..accountName.."'") end function getBankMoney(acccountName) local money = executeSQLSelect("players", "bankMoney", "accName = '"..accountName.."'") return money[1]['money'] end function depositMoney(accountName, amount) local currentMoney = executeSQLSelect("players", "bankMoney", "accName = '"..accountName.."'") local realMoney = currentMoney[1]['currentMoney'] local newMoney = realMoney + amount return executeSQLUpdate("players", "bankMoney = '"..newMoney.."'", "accName = '"..accountName.."'") end function withdrawMoney(accountName, amount) local currentMoney = executeSQLSelect("players", "bankMoney", "accName = '"..accountName.."'") local realMoney = currentMoney[1]['currentMoney'] local newMoney = realMoney - amount return executeSQLUpdate("players", "bankMoney = '"..newMoney.."'", "accName = '"..accountName.."'") end now when i do this function skinSet(skin) local account = getPlayerAccount(source) local accountName = getAccountName(account) exports["SQL"]:newSkin(accountName, skin) spawnPlayer (source, -1977.9189453125, 292.9345703125, 35.171875, 270.21560668945, skin) setCameraTarget(source, source) triggerClientEvent ("hideSkinSelector", getRootElement()) end addEvent("setSkin", true) addEventHandler("setSkin", getRootElement(), skinSet) i get this error ERROR: call: failed to call 'SQL:newSkin' [string "?"] i open the database with sqlbrowser and the table is there and everything is as it should be exept the clothes collumn wich says its at 0 when the id i chose from skin selector was something else...
  11. mjau

    HELP

    Reinstalling gtasa wont do anything Wich server is this ? i cant help you doing it in other ways because you might just be trying to avoid the ban... jus contact the server and if the server is known the admins shouldnt have too much problems removing the ban from the banlist.xml anyway...
  12. mjau

    a bit help

    thats the plan and it expires so people cant send the link around Edit solved i use byteCommerence now
  13. mjau

    a bit help

    Do anyone know some kind of websoftware to sell things like scripts and maps ? and it must be like secure so it autogenerates a one use only link for the guy who buys so he cant copy it and let others download.... If not im willing to pay for someone to make this webpage for me...
  14. mjau

    HELP

    Well we cant help you with this contact the server HQ again and show them a pic that your still banned, shouldnt be a problem to fix
  15. Are you paying for this ? how much are you willing to pay?
  16. Yeh i started watching him not long ago to learn C++ will try to finish the playlist tomorrow
  17. Well it might depend on where you live and how good your internet connection is i played on a server with my old shitty network had about 100 200 ping now with my new network i got 45 ping
  18. mjau

    executeSQLUpdate

    if i store a number in SQL and iw ant to add example 100 to it like 0 + 100 would this thing below work ? executeSQLUpdate("players", "test + '"..testnumberVariable.."'", "accName = '"..accountName.."'")
  19. mjau

    executeSQLUpdate

    oh i think u misunderstood i just meant saving skin i call them clothes since im scripting a clothes shop(skin shop)
  20. mjau

    executeSQLUpdate

    Kenix what is this for ?
  21. mjau

    executeSQLUpdate

    really idk... new to SQL scripting and found it the easiest way
  22. mjau

    executeSQLUpdate

    Eh solidsnake every player whp logs in gets a table created with their acc name so acc would be right as argument for tablename i think function createPrivateSQLTableOnJoin(prevAcc, currentAcc) local accName = getAccountName(currentAcc) executeSQLCreateTable(accName, "bankMoney, clothes") end addEventHandler("onPlayerLogin", rootElement, createPrivateSQLTableOnJoin) function getCurrentClothes(acc) clothes = executeSQLSelect(acc, "clothes") return clothes end function newClothes(acc, clothes) if executeSQLUpdate(acc, "clothes = '"..clothes.."'") == true then return true else return false end end would this be right ?
  23. Well i had a problem like this thatmy server didnt want to start but i just went to mtaserver.conf and set serverport to the right one and a random http port
  24. Hi how does executeSQLUpdate work ? function newClothes(acc, clothes) if executeSQLUpdate(acc, "clothes = 'clothes'") == true then return true else return false end end i trigger that function with agument for the clothes i wana set, wil that do it im just wondering since the variable is in a string on executeSQLUpdate function btw the table is right i have made a table for every acc in server
×
×
  • Create New...