Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sSetting["aviableDatas"] = {
- ["id"] = "Playerid",
- ["lastx"] = "Lastx",
- ["lasty"] = "Lasty",
- ["lastz"] = "Lastz",
- ["lastint"] = "Lastint",
- ["tode"] = "Tode",
- ["morde"] = "Morde",
- ["flashlight"] = "Flashlight",
- ["mission"] = "Mission",
- ["weapons"] = "Weapons",
- ["carx"] = "Carx",
- ["cary"] = "Cary",
- ["carz"] = "Carz",
- ["carrx"] = "Carrx",
- ["carry"] = "Carry",
- ["carrz"] = "Carrz",
- ["carid"] = "Carid",
- ["openworld"] = "Openworldmission",
- ["adminlevel"] = "Adminlevel",
- ["firstjoined"] = "Firstjoined",
- ["playtime"] = "Playtime",
- ["shaders"] = "Shaders",
- }
- -- FUNCTIONS --
- sSetting["player_cars"] = {}
- sFunc["loginPlayer"] = function(thePlayer)
- if(getElementType(thePlayer) == "player") then
- playerData[thePlayer] = {}
- local query = dbQuery(handler, "select * from accounts where Serial = '"..getPlayerSerial(thePlayer).."'")
- local result, numrows = dbPoll(query, dbpTime)
- if(result and numrows > 0) then
- local name = result[1]['Name']
- if(name ~= getPlayerName(thePlayer)) then
- setPlayerName(thePlayer, name)
- end
- for index, mysqlitem in next, sSetting["aviableDatas"] do
- local data = result[1][mysqlitem]
- setPlayerData(thePlayer, index, data, nil)
- end
- spawnJoinPlayer(thePlayer)
- -- CAR --
- if not(sSetting["player_cars"][thePlayer]) or not(isElement(sSetting["player_cars"][thePlayer])) then
- if(tonumber(result[1]['Carid']) ~= 0) then
- sSetting["player_cars"][thePlayer] = createVehicle(result[1]['Carid'], result[1]['Carx'], result[1]['Cary'], result[1]['Carz'], result[1]['Carrx'], result[1]['Carry'], result[1]['Carrz'])
- setElementDimension(sSetting["player_cars"][thePlayer], getPlayerData(thePlayer, "id"))
- setVehicleDamageProof(sSetting["player_cars"][thePlayer], true)
- end
- end
- else
- kickPlayer(thePlayer, "Console", "Account nicht vorhanden/MySQL Fehler!\nMelde dich bei einem Admin")
- end
- end
- end
- sFunc["registerAccount"] = function(thePlayer)
- local query = dbQuery(handler, "insert into accounts (Name, Serial, IP) values ('"..getPlayerName(thePlayer).."', '"..getPlayerSerial(thePlayer).."', '"..getPlayerIP(thePlayer).."');")
- local result, numrows = dbPoll(query, dbpTime)
- if(result) then
- sFunc["loginPlayer"](thePlayer)
- else
- error("Can't insert account for player "..getPlayerName(thePlayer))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement