Jump to content

orcun99

Members
  • Posts

    197
  • Joined

  • Last visited

Everything posted by orcun99

  1. orcun99

    lua problem

    grouppanel/server.lua line 14: bad argument @ 'getplayeraccount' [expected at argument 1, got boolean] line14: local playerToAdd = getPlayerAccount(thePlayer)
  2. orcun99

    lua problem

    function addThePlayer(thePlayer) if (source==addButton) then triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) endendaddEventHandler("onClientGUIClick", root, addThePlayer) all code: client.lua server.lua
  3. orcun99

    lua problem

    someone help pls? https://prnt.sc/fmqhvb there is sql gruops
  4. orcun99

    lua problem

    I have erorr line 13 Bad argument @ 'getplayeraccount' [Expected element at argument 1, got string 'TEST'] Line 13 : local playerToAdd = getPlayerAccount(client)
  5. I have Erorr line 98: houserob/server.lua line98: attempt to compare nill with number line98: if percentage < 100 then Code:
  6. function triggerToggle ( player,source ) if ( player ) then if isObjectInACLGroup( "user.".. accountName, aclGetGroup( "Admin") ) then --- = line 344 triggerClientEvent ( player, "panelToggle", player ) end end end addCommandHandler("subadmin", triggerToggle, false, true )
  7. this is sagx:rpg script and I buy this script for $15
  8. armorTeams = {["Squads"] = true, ["Admins"] = true, ["Freedom Revolutionary Front"] = true, ["Desert Force"] = true, ["The Punishers"] = true} local isMayhemEnabled = false local spawnFreeGroups = "fd,fdn,nf,nfr,unionsoldier,confedsoldier,sahpmember,sahper,fbcmember,usocmember,eimember" local free1 = split(spawnFreeGroups, ",") local free2 = {} for i,v in ipairs(free1) do free2[v] = true end function initializeSpawns (resourceStarted) if getResourceName(resourceStarted) == "SpawnP" or getResourceName(resourceStarted) == "SpawnP" then startResource(getResourceFromName("SpawnP")) local xml = xmlLoadFile(":SpawnP/spawns.xml") -- open the XML file local cityNodes = xmlNodeGetChildren(xml) -- get all child nodes of the root node (<messages>) local cities = {} -- create a new global variable to store the welcome messages for i,node in ipairs(cityNodes) do local classnodes = xmlNodeGetChildren(node) for i2,node2 in ipairs(classnodes) do local name = xmlNodeGetAttribute(node2, "name") local r = xmlNodeGetAttribute(node2, "r") local g = xmlNodeGetAttribute(node2, "g") local b = xmlNodeGetAttribute(node2, "b") if not getTeamFromName(name) then createTeam( name , r , g , b) end end end xmlUnloadFile(xml) end end addEventHandler("onResourceStart", root, initializeSpawns) function logAllOut() local players = getElementsByType ( "player" ) for k, player in ipairs(players) do account = getPlayerAccount(player) if not isGuestAccount(account) then logOut(player) -- Log them out. end end addEventHandler("onPlayerLogout",getRootElement(),loggedOut) end addEventHandler("onResourceStart", resourceRoot, logAllOut) function playerSpawn (spawnX, spawnY, spawnZ, team, permission, skin, weapons, player, skinName, sR, sG, sB, rot, dim, int) local playerAccount = getPlayerAccount(player) local hasPermission = false if getAccountData(playerAccount, "override") then hasPermission = true else if permission:lower() == "none" then hasPermission = true end local outerPerm = split(permission, ";") or {permission} for i,v in ipairs(outerPerm) do local permArray = split(v, ",") if #permArray == 2 then local permType = permArray[1] local permTo = permArray[2] if permType:lower() == "group" then if exports.SpawnPacl:isPlayerInGroup(player, permTo) then hasPermission = true end if isMayhemEnabled and free2[permTo] then hasPermission = true end elseif permType:lower() == "gang" then local gang = getAccountData(playerAccount, "gang") if gang and gang:lower() == permTo:lower() then hasPermission = true end end end end end if hasPermission then local spawnTeam = getTeamFromName(team) if not rot then rot = 0 end spawnPlayer (player, spawnX , spawnY, spawnZ + 1, rot, skin, 0, 0, spawnTeam) setElementDimension(player, dim or 0) setElementInterior(player, int or 0) fadeCamera (player, true) setCameraInterior (player, int or 0 ) setCameraTarget (player, player) local tR , tG , tB = getTeamColor(spawnTeam) local r = sR or tR local g = sG or tG local b = sB or tB local blip = createBlipAttachedTo(player, 0, 2, r, g, b, 255, 0, 300, getRootElement()) setElementVisibleTo(blip, player, false) setPlayerNametagColor(player, r, g, b) if(weapons) then local weps = split(weapons, ",") for i, node in ipairs(weps) do --outputConsole(node) local wepinfo = split(node, ".") local wepid = wepinfo[1] --outputConsole(wepid) local wepammo = wepinfo[2] --outputConsole(wepammo) giveWeapon ( player, wepid, wepammo ) end end setAccountData(playerAccount, "lastSpawnPerm", permission) setElementData(player, "class", skinName) if getResourceState(getResourceFromName("orcunGhud")) == "running" then showPlayerHudComponent(player, "all", false) showPlayerHudComponent(player, "crosshair", true) end if armorTeams[team] then setPedArmor(player, 100) end triggerClientEvent(player, "onSpawnSuccessful", getRootElement()) else triggerClientEvent(player, "onSpawnError", getRootElement() , "You are not in this Gang/Squad/Company") end end addEvent("onPlayerSpawnButton", true) addEventHandler("onPlayerSpawnButton", getRootElement(), playerSpawn) function playerDespawn() local player = source for i,v in ipairs(getAttachedElements(player)) do if getElementType(v) == "blip" and getElementParent(getElementParent(v)) == resourceRoot then destroyElement(v) end end end addEventHandler("onPlayerWasted", getRootElement(), playerDespawn) addEventHandler("onPlayerQuit", getRootElement(), playerDespawn) function saveProperty(a, b, c, playah) local player = playah or source local playeraccount = getPlayerAccount(player) if not isPedDead(player) then local x, y, z = getElementPosition(player) local rot = getPedRotation(player) setAccountData(playeraccount, "x", x) setAccountData(playeraccount, "y", y) setAccountData(playeraccount, "z", z) setAccountData(playeraccount, "rot", rot) local skin = getElementModel(player) setAccountData(playeraccount, "skin", skin) local team = getTeamName(getPlayerTeam(player)) setAccountData(playeraccount, "team", team) local weaponsarray = {} for i=1, 12 do if(getPedWeapon(player, i) ~= 0 and getPedTotalAmmo(player, i) > 0) then table.insert(weaponsarray, getPedWeapon(player, i) .. "." .. getPedTotalAmmo(player, i)) end end local weaponstring = table.concat(weaponsarray,",") setAccountData(playeraccount, "weapons", weaponstring) setAccountData(playeraccount, "aliveonquit", true) setAccountData(playeraccount, "class", getElementData(player, "class")) local r,g,b = getPlayerNametagColor(player) setAccountData(playeraccount, "r", r) setAccountData(playeraccount, "g", g) setAccountData(playeraccount, "b", b) local dimension = getElementDimension(player) local interior = getElementInterior(player) setAccountData(playeraccount, "interior", interior) setAccountData(playeraccount, "dimension", dimension) else setAccountData(playeraccount, "aliveonquit", false) setAccountData(playeraccount, "x", nil) setAccountData(playeraccount, "y", nil) setAccountData(playeraccount, "z", nil) setAccountData(playeraccount, "permission", nil) setAccountData(playeraccount, "team", nil) setAccountData(playeraccount, "skin", nil) setAccountData(playeraccount, "weapons", nil) setAccountData(playeraccount, "class", nil) setAccountData(playeraccount, "r", nil) setAccountData(playeraccount, "g", nil) setAccountData(playeraccount, "b", nil) setAccountData(playeraccount, "rot", nil) setAccountData(playeraccount, "dimension", nil) setAccountData(playeraccount, "interior", nil) end end addEventHandler("onPlayerQuit", getRootElement(), saveProperty) function wasPlayerAlive() if getAccountData(getPlayerAccount(source), "aliveonquit") then --outputConsole("Seems like playah wus alive!") local playerAccount = getPlayerAccount(source) local x = getAccountData(playerAccount, "x") local y = getAccountData(playerAccount, "y") local z = getAccountData(playerAccount, "z") local rot = getAccountData(playerAccount, "rot") local team = getAccountData(playerAccount, "team") local permission = getAccountData(playerAccount, "lastSpawnPerm") local skin = getAccountData(playerAccount, "skin") local weps = getAccountData(playerAccount, "weapons") local skinName = getAccountData(playerAccount, "class") local r = getAccountData(playerAccount, "r") local g = getAccountData(playerAccount, "g") local b = getAccountData(playerAccount, "b") local dim = getAccountData(playerAccount, "dimension") local int = getAccountData(playerAccount, "interior") playerSpawn(x , y , z, team, permission, skin, weps, source, skinName, r, g, b, rot, dim, int) else showSpawnScreen(source) end end addEvent("wasPlayerAliveEvent", true) addEventHandler("wasPlayerAliveEvent", getRootElement(), wasPlayerAlive) function loggedOut() cancelEvent() outputChatBox("You can't log out!", source, 255, 0 ,0) end function stopdown() local players = getElementsByType("player") for i, player in ipairs(players) do saveProperty(nil, nil, nil, player) killPed(player) logOut(player) end end addEventHandler("onResourceStop", resourceRoot, stopdown) function showSpawnScreen(player) local account = getPlayerAccount(player) local houses = exports.Ohousing:getAccountHouses(account) triggerClientEvent(player, "showSpawn", player, houses) end addEventHandler("onPlayerWasted", root, function() showSpawnScreen(source) end) if permission:lower() == "none" then --line53 hasPermission = true --line54
  9. wdwLoginBackGround = {} wdwLogin_Pannel = {} tabPannel_Main = {} tab_Login = {} tab_Register = {} tab_News = {} --Settings EnableMTAControlsOnLogin = false --Set false to not open the chat when you press "t" on fields, for example. [true/false] function open_log_reg_pannel() if not(isElement(wdwLoginBackGround)) then local sWidth,sHeight = guiGetScreenSize() local Width,Height = 320,360 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) toggleAllControls(EnableMTAControlsOnLogin) wdwLoginBackGround = guiCreateStaticImage( 0, 0, sWidth,sHeight, "bg.png", false ) wdwLogin_Pannel = guiCreateWindow(X,Y,Width,Height,"BD:RPG Giriş Panel",false, wdwLoginBackGround) guiWindowSetSizable(wdwLogin_Pannel,false) guiWindowSetMovable ( wdwLogin_Pannel, false ) tabPannel_Main = guiCreateTabPanel(15, 89, 289, 257,false,wdwLogin_Pannel) tab_Login = guiCreateTab("Login",tabPannel_Main) lbl_Login = guiCreateLabel(35, 82, 42, 15, "Giriş :",false,tab_Login) guiLabelSetVerticalAlign(lbl_Login,"center") guiLabelSetHorizontalAlign(lbl_Login,"right",false) guiSetFont(lbl_Login,"default-bold-small") edit_Login = guiCreateEdit(87, 82, 174, 25,"",false,tab_Login) edit_password = guiCreateEdit(87, 117, 174, 23,"",false,tab_Login) guiEditSetMaxLength ( edit_Login,25) guiEditSetMaxLength ( edit_password,25) guiEditSetMasked ( edit_password, true ) lbl_Password = guiCreateLabel(17, 117, 60, 15,"Şifre :",false,tab_Login) guiLabelSetVerticalAlign(lbl_Password,"center") guiLabelSetHorizontalAlign(lbl_Password,"right",false) guiSetFont(lbl_Password,"default-bold-small") lbl_top_info = guiCreateLabel(30, 10, 231, 15, "Kimseye Kendi Bilgilerini Verme!", false,tab_Login) guiLabelSetVerticalAlign(lbl_top_info,"center") guiLabelSetHorizontalAlign(lbl_top_info,"center",false) guiSetFont(lbl_top_info,"default-bold-small") lbl_about_legth = guiCreateLabel(67, 25, 153, 15, "Hesap ismi ve Şifre", false,tab_Login) guiLabelSetVerticalAlign(lbl_about_legth,"center") guiLabelSetHorizontalAlign(lbl_about_legth,"center",false) guiSetFont(lbl_about_legth,"default-bold-small") checkbox_save = guiCreateCheckBox(180, 150, 81, 20,"Beni Hatırla",false,false,tab_Login) guiSetFont(checkbox_save,"default-small") btn_Login = guiCreateButton(178, 180, 83, 30,"Giriş",false,tab_Login) guiSetFont(btn_Login,"default-bold-small") login_tab_error_msg = guiCreateLabel(10, 50, 269, 22,"Error_login_tab",false,tab_Login) guiLabelSetColor(login_tab_error_msg,255,0,0) guiLabelSetVerticalAlign(login_tab_error_msg,"center") guiLabelSetHorizontalAlign(login_tab_error_msg,"center",false) guiSetFont(login_tab_error_msg,"default-bold-small") tab_Register = guiCreateTab("Register",tabPannel_Main) lbl_account_name = guiCreateLabel(30, 66, 68, 14,"Hesap İsmi :",false,tab_Register) guiLabelSetVerticalAlign(lbl_account_name,"center") guiLabelSetHorizontalAlign(lbl_account_name,"right",false) guiSetFont(lbl_account_name,"default-bold-small") lbl_reg_top_info = guiCreateLabel(10, 10, 269, 15, "Güçlü bir Şifre Kullan!", false, tab_Register) guiLabelSetVerticalAlign(lbl_reg_top_info,"center") guiLabelSetHorizontalAlign(lbl_reg_top_info,"center",false) guiSetFont(lbl_reg_top_info,"default-bold-small") edit_account_name = guiCreateEdit(108, 66, 153, 24,"",false,tab_Register) guiEditSetMaxLength ( edit_account_name,25) lbl__reg_tab_password = guiCreateLabel(37, 100, 61, 15,"Şifre :",false,tab_Register) guiLabelSetVerticalAlign(lbl__reg_tab_password,"center") guiLabelSetHorizontalAlign(lbl__reg_tab_password,"right",false) guiSetFont(lbl__reg_tab_password,"default-bold-small") edit__reg_tab_password = guiCreateEdit(108, 100, 153, 24,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_password,25) edit__reg_tab_Repassword = guiCreateEdit(108, 133, 153, 24,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_Repassword,25) lvl_reg_tab_Repassword = guiCreateLabel(20, 133, 78, 15,"Şifreyi Tekrar Et :",false,tab_Register) guiLabelSetVerticalAlign(lvl_reg_tab_Repassword,"center") guiLabelSetHorizontalAlign(lvl_reg_tab_Repassword,"right",false) guiSetFont(lvl_reg_tab_Repassword,"default-bold-small") btn_reg_tab_register = guiCreateButton(178, 180, 83, 30,"Kaydol",false,tab_Register) guiSetFont(btn_reg_tab_register,"default-bold-small") reg_tab_error_msg = guiCreateLabel(10, 25, 269, 31,"Error_reg_ttab",false,tab_Register) guiLabelSetColor(reg_tab_error_msg,225,0,0) guiLabelSetVerticalAlign(reg_tab_error_msg,"center") guiLabelSetHorizontalAlign(reg_tab_error_msg,"center",false) guiSetFont(reg_tab_error_msg,"default-bold-small") logininfo1 = guiCreateLabel(11, 32, 299, 16, "BD:RPG'ye hoşgeldiniz :)", false, wdwLogin_Pannel) guiSetFont(logininfo1, "default-bold-small") guiLabelSetColor(logininfo1, 30,144,255) guiLabelSetHorizontalAlign(logininfo1, "center", false) guiLabelSetVerticalAlign(logininfo1, "center") logininfo2 = guiCreateLabel(11, 63, 299, 16, "Adminlere sorularını yöneltebilirsiniz", false, wdwLogin_Pannel) guiSetFont(logininfo2, "default-bold-small") guiLabelSetColor(logininfo2, 30,144,255) guiLabelSetHorizontalAlign(logininfo2, "center", false) guiLabelSetVerticalAlign(logininfo2, "center") logininfo3 = guiCreateLabel(11, 48, 299, 15, "F1'e basarak bilgileri öğrenebilirsiniz.", false, wdwLogin_Pannel) guiSetFont(logininfo3, "default-bold-small") guiLabelSetColor(logininfo3, 30,144,255) guiLabelSetHorizontalAlign(logininfo3, "center", false) guiLabelSetVerticalAlign(logininfo3, "center") guiEditSetMasked(edit__reg_tab_password, true) guiEditSetMasked(edit__reg_tab_Repassword, true) guiSetVisible(wdwLogin_Pannel,true) showCursor(true) --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- -- Labels changing when player doing mistake --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- guiSetText(reg_tab_error_msg, "") guiSetText(login_tab_error_msg, "") local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) else guiCheckBoxSetSelected ( checkbox_save, false ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) end --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- -- Events --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- addEventHandler("onClientGUIClick",btn_Login,onClickBtnLogin) addEventHandler("onClientGUIClick",btn_reg_tab_register,onClickBtnRegister) end end --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- -- Opening login panel when the resource starting --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- function start_cl_resource() open_log_reg_pannel() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),start_cl_resource) --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- -- Loading usernames and password from xml file --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- function loadLoginFromXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", "" end xmlUnloadFile ( xml_save_log_File ) end --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- -- Saving login and password to the xml file. Type: 1 --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- function saveLoginToXML(username, password) local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end if (username ~= "") then local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) if not usernameNode then usernameNode = xmlCreateChild(xml_save_log_File, "username") end xmlNodeSetValue (usernameNode, tostring(username)) end if (password ~= "") then local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if not passwordNode then passwordNode = xmlCreateChild(xml_save_log_File, "password") end xmlNodeSetValue (passwordNode, tostring(password)) end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("saveLoginToXML", true) addEventHandler("saveLoginToXML", getRootElement(), saveLoginToXML) --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- -- Saving login and password to the xml. Type: 2 --------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------- function resetSaveXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml")
  10. CODE REMOVED BY Solidsnake14 goes to prison time elapses bug
  11. I do not understand you correct the line addEventHandler ("tasePlayer", root, function(attacker) local nCop = getPlayerName(attacker) local nCrim = getPlayerName(source) local copAmmo = getPedTotalAmmo(attacker, true) if not getInJail(source) then setElementData(source,"taser.taseranimation",true) setElementFrozen(source, true) setPedAnimation(source, "CRACK", "crckidle2", -1, true, true, false, false) toggleControl(source, "Next Weapon", false) toggleControl(source, "Previous Weapon", false) toggleControl(source, "Fire", false) setTimer(function(player) if isElement(player) then setElementFrozen(player, false) setPedAnimation(player) toggleControl(player, "Next Weapon", true) toggleControl(player, "Previous Weapon", true) toggleControl(player, "Fire", true) end end, 3000, 1, source) exports.xxxcommands:sendMessage("You tased " .. nCrim .. " and will have to wait 5 seconds for the taser to re-charge.", 220, 220, 220, attacker) exports.xxxcommands:sendMessage("You have been tased by " .. nCop .. "." , 255, 255, 0, source) takeWeapon(attacker, 23) giveWeapon(attacker, 3, 1, true) if copAmmo ~= 0 then setTimer (giveWeapon, 5000, 1, attacker, 23, copAmmo - 1, false) end end end )
  12. Still Not Working jail server lua 77: local jailTime = crimWanted * 6 Line100: local copAmmo = getPedTotalAmmo(attacker, false) Line114: setTimer (giveWeapon, 5000, 1, attacker, 23, copAmmo - 1, false) http://i.hizliresim.com/89J4N7.png
  13. I will not be getting into the vehicle load my english bad
  14. yes I buy this script Needs to Change Where
  15. CODE REMOVED BY Solidsnake14 still not working
  16. http://i.hizliresim.com/5o12nz.png Help
  17. http://i.hizliresim.com/pm3QON.png Line100: local copAmmo = getPedTotalAmmo(attacker, true) Line114: setTimer (giveWeapon, 5000, 1, attacker, 23, copAmmo - 1, false) pls help me
×
×
  • Create New...