Jump to content

newtimes

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by newtimes

  1. the whole paradise roleplay is successful installed i have at the moment a localhosted server on my pc just to test i'm using navicat + Mysql
  2. lest have a shot i have zero scripting skills
  3. ah ok thanks anyway i'll just wait for someone to help me
  4. thanks for the reply i did that now i'm up with an error ERROR: payday\payday.lua:6: attempt to index local 'result' (a boolean value) my code now : function allPlayersPayDay() local result = exports.sql:query_assoc( "SELECT * FROM bank_accounts WHERE charactid IS player" ) local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do givePlayerMoney ( value, result[value]*0.1) outputChatBox (" ------Payslip------ ", value, 255, 255, 255, false) outputChatBox ("|--------------------------|", value, 0, 255, 00, false) outputChatBox ("You just got 10 percent of your bank value!", value , 0, 255, 0, false) outputChatBox ("-2$ Tax", value, 255, 0, 0, false) outputChatBox ("|--------------------------|", value, 0, 255,00 , false) end end function onResourceStart(thisResource) setTimer ( allPlayersPayDay, 40000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart )
  5. Hi, I'm editing the MTA PARADISE game mode (just to practice scripting in lua files) bud now i wan't to create a Payday script so i got an script from the resource page and i hoped i could fix it as i want it bud i noticed i fail what do i want : the characters will get a payday of 10% over their bank account function allPlayersPayDay() local result = exports.sql:query_assoc( "SELECT * FROM bank_accounts WHERE charactid IS player" ) local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do givePlayerMoney ( value, ") outputChatBox (" ------Payslip------ ", value, 255, 255, 255, false) outputChatBox ("|--------------------------|", value, 0, 255, 00, false) outputChatBox (", value, 0, 255, 0, false) outputChatBox ("", value, 255, 0, 0, false) outputChatBox ("|--------------------------|", value, 0, 255,00 , false) end end function onResourceStart(thisResource) setTimer ( allPlayersPayDay, 480000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart ) so now i fail at the part how to get 10% (or something) and give it to players thanks for reading
×
×
  • Create New...