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