Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- node = xmlLoadFile ("users.xml")
- for i = 0,17 do
- texture, model = getPedClothes(source, i)
- end
- function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)
- if not (isGuestAccount (getPlayerAccount (source))) then
- local accountData = getAccountData (theCurrentAccount, "xpg.money")
- if (accountData) then
- local pMoney = getAccountData (theCurrentAccount, "xpg.money")
- local pSkin = getAccountData (theCurrentAccount, "xpg.skin")
- local pX = getAccountData (theCurrentAccount, "xpg.x")
- local pY = getAccountData (theCurrentAccount, "xpg.y")
- local pZ = getAccountData (theCurrentAccount, "xpg.z")
- local pInt = getAccountData (theCurrentAccount, "xpg.int")
- local pDim = getAccountData (theCurrentAccount, "xpg.dim")
- local pCl = getAccountData (theCurrentAccount, "xpg.cl".tostring(i))
- local pWeaponID = getAccountData (theCurrentAccount, "xpg.weaponID")
- local pWeaponAmmo = getAccountData (theCurrentAccount, "xpg.weaponAmmo")
- spawnPlayer (source, pX, pY, pZ + 1, 0, pSkin, pInt, pDim, pCl)
- setPlayerMoney (source, pMoney)
- setTimer (giveWeapon, 500, 1, source, pWeaponID, pWeaponAmmo, true)
- setCameraTarget (source, source)
- fadeCamera(source, true, 2.0)
- else
- spawnPlayer (source, 2000.55, 1526.25, 14.6171875, 0, 0, 0, 0)
- setPlayerMoney (source, 0)
- setCameraTarget (source, source)
- fadeCamera(source, true, 2.0)
- setPlayerNameTagColor(source, math.random(0,255), math.random(0,255), math.random(0,255))
- end
- end
- end
- addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)
- function onLogout ()
- kickPlayer (source, nil, "Logging out is disallowed.")
- end
- addEventHandler ("onPlayerLogout", getRootElement(), onLogout)
- function onQuit (quitType, reason, responsibleElement)
- if not (isGuestAccount (getPlayerAccount (source))) then
- account = getPlayerAccount (source)
- if (account) then
- local x,y,z = getElementPosition (source)
- setAccountData (account, "xpg.money", tostring (getPlayerMoney (source)))
- setAccountData (account, "xpg.skin", tostring (getPedSkin (source)))
- setAccountData (account, "xpg.x", x)
- setAccountData (account, "xpg.y", y)
- setAccountData (account, "xpg.z", z)
- setAccountData (account, "xpg.int", getElementInterior (source))
- setAccountData (account, "xpg.dim", getElementDimension (source))
- setAccountData (account, "xpg.cl".tostring(i), (texture and model))
- setAccountData (account, "xpg.wantedID", getPlayerWeapon (source))
- setAccountData (account, "xpg.wantedAmmo", getPlayerTotalAmmo (source))
- end
- end
- end
- addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
- function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth)
- if not( isGuestAccount (getPlayerAccount(source)) ) then
- local theWeapon = getPlayerWeapon (source)
- local weaponAmmo = getPlayerTotalAmmo (source)
- fadeCamera (source, false)
- setTimer (spawnPlayer, 1000, 1, source, 1607.35, 1816.54, 10.82, 0, getPedSkin (source), 0, 0, spawnTeam)
- setTimer (setCameraTarget, 1250, 1, source, source)
- setTimer (fadeCamera, 2000, 1, source, true)
- setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true)
- end
- end
- addEventHandler ("onPlayerWasted", getRootElement(), onWasted)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement