function avvertilogin(thePlayer)
outputChatBox("** Login or register for ranking system and save money", getRootElement(), 100, 255, 0)
end
addEventHandler("onPlayerJoin",thePlayer,avvertilogin)
function registrazionedb(thePlayer)
local account = getAccountName(getPlayerAccount(thePlayer))
if(account) then
executeSQLSelect("Giocatori", "Giocatore", "Giocatore = '" ..account.. "'")
if (type(result) == "table" and #result == 0) or not result then
outputChatBox("** One moment while your account is registered in Database ", getRootElement(), 100, 255, 0)
executeSQLInsert("Giocatori","'"..account.."',0,0,0")
outputChatBox("** Ok, Account succesfuly registered ! ", getRootElement(), 100, 255, 0)
end
outputChatBox("** Ok, Account succesfuly loaded from Database ! ", getRootElement(), 100, 255, 0)
local datiaccount = executeSQLSelect("Giocatori", "Soldi, Kill, Morti", "Giocatore = '" ..account.. "'")
setPlayerMoney(thePlayer,datiaccount[1]['Soldi'])
textCreateTextItem("Kill :", 0.8, 0.35, "medium", 255, 255, 0)
textCreateTextItem("Death :", 0.8, 0.4, "medium", 255, 255, 0)
textCreateTextItem("Ratio :", 0.8, 0.4, "medium", 255, 255, 0)
end
end
addEventHandler("onPlayerLogin",thePlayer,registrazionedb)
When i start the resource mta server give me 2 warning :
Bad Argument @ 'AddEventHandler' string defined function
Bad Argument @ 'AddEventHandler' string defined function