-- ~ [ADMINDUTY] ~ --addCommandHandler(\"adminduty\",function(player, cmd)if exports.brpExports:isPlayerAdmin(player) then if getElementData(player, \"admin.duty\") == 1 then setPlayerNametagColor(player, 255, 255, 255) setElementData(player, \"admin.duty\", 0) outputServerLog(\"[ADMIN] [CMD/ADMINDUTY]: \" .. getPlayerName(player) .. \" went off duty.\") for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then outputChatBox(getPlayerName(player) .. \" went off duty.\", v, 255, 0, 0, false) exports.notifications:showBox (\"info\",exports.notifications:showBox (\"info\",\"(getPlayerName(player) .. \")\"adminszolgáltaba lépett\") end end else setPlayerNametagColor(player, 255, 255, 0) setElementData(player, \"admin.duty\", 1) outputServerLog(\"[ADMIN] [CMD/ADMINDUTY]: \" .. getPlayerName(player) .. \" came on duty.\") for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then outputChatBox(getPlayerName(player) .. \" came on duty.\", v, 255, 0, 0, false) end end endendend)
addCommandHandler(\"adminduty\",function(player, cmd)if exports.brpExports:isPlayerAdmin(player) then if getElementData(player, \"admin.duty\") == 1 then setPlayerNametagColor(player, 255, 255, 255) setElementData(player, \"admin.duty\", 0) outputServerLog(\"[ADMIN] [CMD/ADMINDUTY]: \" .. getPlayerName(player) .. \" went off duty.\") for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then exports.notifications:showBox(getRootElement(), \"info\", \"\" .. getPlayerName(player) .. \" kilépett a szolgálatból.\") end end else setPlayerNametagColor(player, 255, 255, 0) setElementData(player, \"admin.duty\", 1) outputServerLog(\"[ADMIN] [CMD/ADMINDUTY]: \" .. getPlayerName(player) .. \" came on duty.\") for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then exports.notifications:showBox(getRootElement(), \"info\", \"\" .. getPlayerName(player) .. \" adminszolgálatba lépett!\") end end endendend)
-- ~ [GIVEWEAPON, GIVEWEP, GIVEGUN, MAKEWEAPON, MAKEGUN] ~ --addCommandHandler({\"giveweapon\", \"givewep\", \"givegun\", \"makeweapon\", \"makegun\"},function(player, cmd, name, weapon)if exports.brpExports:isPlayerLeadAdmin(player) then if name and weapon then local target = exports.brpExports:findPlayer(name, player) if target then if tonumber(weapon) then local weaponName = getWeaponNameFromID(weapon) giveWeapon(target, weapon, 1, true) for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then outputChatBox(\"[Wep]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" a weapon (\" .. weaponName .. \").\", v, 255, 0, 0, false) end end outputServerLog(\"[ADMIN] [CMD/GIVEWEAPON]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" a weapon (\" .. weaponName .. \")\") else local weaponID = getWeaponIDFromName(weapon) local weaponIDName = getWeaponNameFromID(weaponID) giveWeapon(target, weaponID, 1, true) for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then outputChatBox(\"[Wep]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" a weapon (\" .. weaponIDName .. \").\", v, 255, 0, 0, false) end end outputServerLog(\"[ADMIN] [CMD/GIVEWEAPON]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" a weapon (\" .. weaponIDName .. \")\") end else outputChatBox(\"No players or multiple were found.\", player, 255, 0, 0, false) end else outputChatBox(\"Syntax: /\" .. cmd .. \" <player> <weapon>\", player, 220, 220, 0, false) endendend)-- ~ [GIVEWEAPONAMMO, GIVEAMMO, GIVEWEPAMMO, MAKEAMMO, GIVEGUNAMMO] ~ --addCommandHandler({\"giveweaponammo\", \"giveammo\", \"givewepammo\", \"makeammo\", \"givegunammo\"},function(player, cmd, name, ammo, weapon)if exports.brpExports:isPlayerLeadAdmin(player) then if name and ammo and weapon then if tonumber(ammo) then local target = exports.brpExports:findPlayer(name, player) if target then if tonumber(weapon) then local weaponName = getWeaponNameFromID(weapon) giveWeapon(target, weapon, ammo, true) for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then outputChatBox(\"[WepAmmo]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" bullets (\" .. ammo .. \") to a weapon (\" .. weaponName .. \").\", v, 255, 0, 0, false) end end outputServerLog(\"[ADMIN] [CMD/GIVEWEAPONAMMO]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" bullets (\" .. ammo .. \") to a weapon (\" .. weaponName .. \").\") else local weaponID = getWeaponIDFromName(weapon) local weaponIDName = getWeaponNameFromID(weaponID) giveWeapon(target, weaponID, ammo, true) for i,v in ipairs(getElementsByType(\"player\")) do if exports.brpExports:isPlayerAdmin(v) then outputChatBox(\"[WepAmmo]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" bullets (\" .. ammo .. \") to a weapon (\" .. weaponIDName .. \").\", v, 255, 0, 0, false) end end outputServerLog(\"[ADMIN] [CMD/GIVEWEAPONAMMO]: \" .. getPlayerName(player) .. \" gave \" .. getPlayerName(target) .. \" bullets (\" .. ammo .. \") to a weapon (\" .. weaponIDName .. \").\") end else outputChatBox(\"No players or multiple were found.\", player, 255, 0, 0, false) end else outputChatBox(\"Syntax: /\" .. cmd .. \" <player> <ammo> <weapon>\", player, 220, 220, 0, false) end else outputChatBox(\"Syntax: /\" .. cmd .. \" <player> <ammo> <weapon>\", player, 220, 220, 0, false) endendend)
function saveAccount(player)local account = getPlayerAccount(player)if isGuestAccount(account) then return endlocal money = getPlayerMoney(player)local bank = getElementData(player, \"account.bank\")local faction = getElementData(player, \"factions.player\")local fname = getElementData(player, \"factions.fplayer\")local factionleader = getElementData(player, \"factions.leader\")local health = getElementHealth(player)local armor = getPedArmor(player)local x, y, z = getElementPosition(player)local interior = getElementInterior(player)local dimension = getElementDimension(player)local model = getElementModel(player)local rx, ry, rz = getElementRotation(player)setAccountData(account, \"basicrp.money\", tonumber(money))setAccountData(account, \"basicrp.bank\", tonumber(bank))setAccountData(account, \"basicrp.factionleader\", tonumber(factionleader))setAccountData(account, \"basicrp.faction\", tonumber(faction))setAccountData(account, \"basicrp.fname\", tostring(fname))setAccountData(account, \"basicrp.health\", tonumber(health))setAccountData(account, \"basicrp.armor\", tonumber(armor))setAccountData(account, \"basicrp.model\", tonumber(model))setAccountData(account, \"basicrp.interior\", tonumber(interior))setAccountData(account, \"basicrp.dimension\", tonumber(dimension))setAccountData(account, \"basicrp.posx\", tonumber(x))setAccountData(account, \"basicrp.posy\", tonumber(y))setAccountData(account, \"basicrp.posz\", tonumber(z))setAccountData(account, \"basicrp.rotx\", tonumber(rx))setAccountData(account, \"basicrp.roty\", tonumber(ry))setAccountData(account, \"basicrp.rotz\", tonumber(rz))end
function saveAccount(player)local account = getPlayerAccount(player)if isGuestAccount(account) then return endlocal money = getPlayerMoney(player)local bank = getElementData(player, \"account.bank\")local faction = getElementData(player, \"factions.player\")local fname = getElementData(player, \"factions.fplayer\")local factionleader = getElementData(player, \"factions.leader\")local health = getElementHealth(player)local armor = getPedArmor(player)local x, y, z = getElementPosition(player)local interior = getElementInterior(player)local dimension = getElementDimension(player)local model = getElementModel(player)local rx, ry, rz = getElementRotation(player) local weapons = getElementData(player, \"weapons\") local ammo = getElementData(player, \"ammo\")setAccountData(account, \"basicrp.money\", tonumber(money))setAccountData(account, \"basicrp.bank\", tonumber(bank))setAccountData(account, \"basicrp.factionleader\", tonumber(factionleader))setAccountData(account, \"basicrp.faction\", tonumber(faction))setAccountData(account, \"basicrp.fname\", tostring(fname))setAccountData(account, \"basicrp.health\", tonumber(health))setAccountData(account, \"basicrp.armor\", tonumber(armor))setAccountData(account, \"basicrp.model\", tonumber(model))setAccountData(account, \"basicrp.interior\", tonumber(interior))setAccountData(account, \"basicrp.dimension\", tonumber(dimension))setAccountData(account, \"basicrp.posx\", tonumber(x))setAccountData(account, \"basicrp.posy\", tonumber(y))setAccountData(account, \"basicrp.posz\", tonumber(z))setAccountData(account, \"basicrp.rotx\", tonumber(rx))setAccountData(account, \"basicrp.roty\", tonumber(ry))setAccountData(account, \"basicrp.rotz\", tonumber(rz)) setAccountData(account, \"basicrp.weapons\", tonumber(weapons)) setAccountData(account, \"basicrp.ammo\", tonumber(ammo))end