Jump to content

Sande

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Sande

  1. Theres the ranks maybe working.. --TEAM, RANKNAME, REQUIRED ACTIONS ranks = {Criminal, "Street rat", "0"}, {Criminal, "Mugger", "100"}, {Police, "Trainee", "0"}, {Police, "Officer", "100"} What i should do next, give some functions. I have to code the rank-UP system when player gets 100 criminal actions he will become mugger etc.
  2. Good job, looks very nice
  3. Hello, i take new move to little harder scripting. But now i have problems, i dont have skills to finish my loginpanel, and the code is really messed up. if someone can make working version of this i will be happy. Client 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 function loginPanel() Loginpanel = { tab = {}, tabpanel = {}, edit = {}, button = {}, window = {}, label = {}, checkbox = {} } Loginpanel.window[1] = guiCreateWindow(580, 330, 547, 382, "Suomisisu", false) guiWindowSetSizable(Loginpanel.window[1], false) Loginpanel.tabpanel[1] = guiCreateTabPanel(9, 20, 528, 352, false, Loginpanel.window[1]) Loginpanel.tab[1] = guiCreateTab("Login", Loginpanel.tabpanel[1]) Loginpanel.checkbox[1] = guiCreateCheckBox(151, 244, 109, 15, "Remember me", false, false, Loginpanel.tab[1]) guiSetFont(Loginpanel.checkbox[1], "default-bold-small") Loginpanel.edit[1] = guiCreateEdit(152, 108, 256, 28, "", false, Loginpanel.tab[1]) Loginpanel.edit[2] = guiCreateEdit(151, 184, 257, 28, "", false, Loginpanel.tab[1]) Loginpanel.label[1] = guiCreateLabel(219, 10, 209, 30, "Suomisisu - Login", false, Loginpanel.tab[1]) guiSetFont(Loginpanel.label[1], "default-bold-small") Loginpanel.label[2] = guiCreateLabel(156, 89, 114, 19, "Username:", false, Loginpanel.tab[1]) guiSetFont(Loginpanel.label[2], "default-bold-small") Loginpanel.label[3] = guiCreateLabel(156, 165, 114, 19, "Password:", false, Loginpanel.tab[1]) guiSetFont(Loginpanel.label[3], "default-bold-small") Loginpanel.button[1] = guiCreateButton(151, 281, 257, 36, "Login", false, Loginpanel.tab[1]) Loginpanel.tab[2] = guiCreateTab("Register", Loginpanel.tabpanel[1]) Loginpanel.edit[3] = guiCreateEdit(180, 88, 238, 30, "", false, Loginpanel.tab[2]) Loginpanel.edit[4] = guiCreateEdit(180, 153, 238, 30, "", false, Loginpanel.tab[2]) Loginpanel.edit[5] = guiCreateEdit(180, 220, 238, 28, "", false, Loginpanel.tab[2]) Loginpanel.label[4] = guiCreateLabel(212, 10, 167, 21, "Suomisisu - Registration", false, Loginpanel.tab[2]) guiSetFont(Loginpanel.label[4], "default-bold-small") Loginpanel.label[5] = guiCreateLabel(180, 70, 98, 18, "Username:", false, Loginpanel.tab[2]) guiSetFont(Loginpanel.label[5], "default-bold-small") Loginpanel.label[6] = guiCreateLabel(180, 131, 95, 18, "Password:", false, Loginpanel.tab[2]) guiSetFont(Loginpanel.label[6], "default-bold-small") Loginpanel.label[7] = guiCreateLabel(180, 202, 166, 18, "Repeat Password:", false, Loginpanel.tab[2]) guiSetFont(Loginpanel.label[7], "default-bold-small") Loginpanel.button[2] = guiCreateButton(180, 274, 238, 43, "Register", false, Loginpanel.tab[2]) Loginpanel.label[8] = guiCreateLabel(10, 98, 138, 209, "When you register to suomisisu, sametime you agree our rules. \n\nWhen you have account all your details, like money, houses, jobs, team saving.\n\n We recommend to read the rules before you register an account.\n\n Info tab have good information too.", false, Loginpanel.tab[2]) guiSetFont(Loginpanel.label[8], "default-bold-small") guiLabelSetColor(Loginpanel.label[8], 254, 234, 0) guiLabelSetHorizontalAlign(Loginpanel.label[8], "left", true) Loginpanel.label[9] = guiCreateLabel(12, 70, 137, 15, "Tips:", false, Loginpanel.tab[2]) guiSetFont(Loginpanel.label[9], "default-bold-small") guiLabelSetColor(Loginpanel.label[9], 253, 0, 0) Loginpanel.tab[3] = guiCreateTab("Rules", Loginpanel.tabpanel[1]) Loginpanel.label[10] = guiCreateLabel(4, 7, 514, 329, "Rules of our server in: English\n 1.No hacking, or anything else illegal / harmful to other players and/or server \n2.No spamming \n3.Don't ask for admins, because that way you surely won't get them, be patient and wait for recruiting \n4.Do what the staff says in all situations, especially in case of a bug or other crisis \n5.Don't sabotage e.g do anything harmful to the server \n6.Don't steal other players accounts, or try to find out their password \n7.Don't advertise other servers \n8.Don't continuously kill other players or bother the admins \n9.Don't warp/map kill \n10.Don't spawn kill \n11.You must not bother the admins by for example following them everywhere \n12.You must not kill an admin unless the admin is part of an action that allows it \n13.Using mods and/or trainers is forbidden and will result in a permanent ban \n14.Bug abuse is forbidden! If you find a bug, report it to an admin, and if you abuse a bug and there is evidence about it you will be banned \n15.Vandalism against admins and donators vehicles is forbidden \n16.You must not use the nickname of an admin/moderator or pretend to be one \nIf you broke the rules, admin have a right to ban you in this server. \nBAN-Time defines from the situation / severity of offense. Rules accepted when you press \"Login or register\" button.\nWe keep allrights to change the rules when we want to.", false, Loginpanel.tab[3]) guiSetFont(Loginpanel.label[10], "default-bold-small") guiLabelSetHorizontalAlign(Loginpanel.label[10], "left", true) Loginpanel.tab[4] = guiCreateTab("Info", Loginpanel.tabpanel[1]) Loginpanel.label[11] = guiCreateLabel(5, 4, 513, 313, "Description of the server: Suomisisu is a freeroam CnR and some rpg server with hay, zombie and other nice events. \nMost of the players are from finland.\n \n\nAdmins:\n Sisuviina, \n [Dj]Wolf_fin, \n Finnplaya, \n Sinetti, \n\nSupermoderators: \nNikkop99\n\nWebsite: bgsof.com\nForum: bgsof.com/Forkka\n\nServer owner: Sisuviina\nSkype: sande.retroilija\nBgsof: Sisuviina", false, Loginpanel.tab[4]) guiSetFont(Loginpanel.label[11], "default-bold-small") guiLabelSetHorizontalAlign(Loginpanel.label[11], "left", true) guiSetVisible(Teampanel.Window[1], true) showCursor(true) local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( Loginpanel.edit[1], tostring(username)) guiSetText ( Loginpanel.edit[2], tostring(password)) else guiCheckBoxSetSelected ( checkbox_save, false ) guiSetText ( Loginpanel.edit[1], tostring(username)) guiSetText ( Loginpanel.edit[2], tostring(password)) end end function start_cl_resource() loginPanel() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),start_cl_resource) 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) function resetSaveXML() 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 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, "") end xmlSaveFile(xml_save_log_File) xmlUnloadFile (xml_save_log_File) end addEvent("resetSaveXML", true) addEventHandler("resetSaveXML", getRootElement(), resetSaveXML) function onClickBtnLogin(button,state) showChat(true) showCursor(false) guiSetVisible(Loginpanel.Window[1],false) if(button == "left" and state == "up") then if (source == Loginpanel.Window[1]) then username = guiGetText(Loginpanel.edit[1]) password = guiGetText(Loginpanel.edit[2]) if guiCheckBoxGetSelected ( checkbox_save ) == true then checksave = true else checksave = false end triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,checksave) end end end addEventHandler("onClientGUIClick", Loginpanel.button[1], onClickBtnLogin) function onClickBtnRegister(button,state) showCursor(true) username = guiGetText(Loginpanel.edit[3]) password = guiGetText(Loginpanel.edit[4]) passwordConfirm = guiGetText(Loginpanel.edit[5]) triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password,passwordConfirm) end addEventHandler("onClientGUIClick", Loginpanel.button[2], onClickBtnRegister) function onClickGuest() setTimer ( function ( source ) exports["ac-message"]:outputTopBar("Login: Guest option are disabled, you have login or create a account.", 255,0,0 ) end ,100, 1, source ) end function hideLoginWindow() exports["ac-message"]:outputTopBar("Login: Welcome to suomisisu, and we hope you enjoying your time here.", 255,0,0 ) showCursor(false) showChat(true) guiSetVisible (Loginpanel.window[1], false) removeEventHandler("onClientGUIClick",getRootElement(),onClickBtnLogin) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) function CursorError () outputChatBox("Kurzor elrejtve") showCursor(false) end addCommandHandler("showc", CursorError) Server: function PlayerLogin(username,password,checksave) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn(source, account, password) triggerClientEvent (source,"hideLoginWindow",getRootElement()) if checksave == true then triggerClientEvent(source,"saveLoginToXML",getRootElement(),username,password) else triggerClientEvent(source,"resetSaveXML",getRootElement(),username,password) end else exports["ac-message"]:outputTopBar("Login: Wrong username and/or password.", 255,0,0 ) end else exports["ac-message"]:outputTopBar("Login: Please enter your password.", 255,0,0 ) end else exports["ac-message"]:outputTopBar("Login: Please enter your username.", 255,0,0 ) end end addEvent("onRequestLogin",true) addEventHandler("onRequestLogin",getRootElement(),PlayerLogin) function registerPlayer(username,password,passwordConfirm) if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then outputChatBox ("#00FF00[Login] Rekisteroidyit! [username: #FFFFFF" .. username .. " #00FF00| Password: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) outputChatBox ("#FF0000[Login] Muista yllämainitut tiedot! ",source,255,255,255,true ) else exports["ac-message"]:outputTopBar("Login: Error, please try again with diffrent username and password.", 255,0,0 ) end else exports["ac-message"]:outputTopBar("Login: This username is already taken.", 255,0,0 ) end else exports["ac-message"]:outputTopBar("Login: Password doesn´t match.", 255,0,0 ) end else exports["ac-message"]:outputTopBar("Login: Please confirm your password.", 255,0,0 ) end else exports["ac-message"]:outputTopBar("Login: Please enter your password.", 255,0,0 ) end else exports["ac-message"]:outputTopBar("Login: Please enter your username.", 255,0,0 ) end end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer)
  4. I was thinking this too how to change these. it will be good if someone anwers.
  5. Hello, i want to make rank system for teams. In my server if you do a carjacker mission you will get +1 criminal actions. I want to make system like when you have 100 criminal actions you will get rank up. Only thing what i had now. So pls, give some ideas or post little code where i can start. I am newbie in these things! thaanks local ranks { --TEAM, RANKNAME, REQUIRED ACTIONS {"Criminal", "Rat", "0" {"Criminal, "Mugger", 100" {"Police", "Trial", "0" {"Police, "Officer", "100" }
  6. Sande

    Gui not opening

    Wow, thank you very much for helping with this! Really love you
  7. Sande

    Gui not opening

    Can you help me to create serverside function what changes the player team now i have: Client: function gui ( ) Teampanel = { gridlist = {}, window = {}, button = {} } Teampanel.window[1] = guiCreateWindow(660, 383, 313, 367, "Suomisisu - Jobpanel", false) guiWindowSetSizable(Teampanel.window[1], false) Teampanel.gridlist[1] = guiCreateGridList(9, 23, 295, 232, false, Teampanel.window[1]) guiGridListAddColumn(Teampanel.gridlist[1], "Team", 0.5) guiGridListAddColumn(Teampanel.gridlist[1], "Occupation", 0.5) for i = 1, 9 do guiGridListAddRow(Teampanel.gridlist[1]) end --guiGridListSetItemText(Teampanel.gridlist[1], 0, 1, "Staff", false, false) --guiGridListSetItemText(Teampanel.gridlist[1], 0, 2, "Admin", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 1, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 2, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 1, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 2, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 1, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 2, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 2, "Medic", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 2, "Fireman", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 2, "Trucker", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 2, "Bus driver", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 2, "Taxi driver", false, false) Teampanel.button[1] = guiCreateButton(14, 283, 136, 58, "End shift", false, Teampanel.window[1]) Teampanel.button[2] = guiCreateButton(160, 283, 136, 58, "Take job", false, Teampanel.window[1]) addEventHandler ( "onClientGUIClick", Teampanel.button[2], takeJob, false ) guiSetVisible(Teampanel.window[1], false) end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), gui ) function takeJob ( ) local row, col = guiGridListGetSelectedItem ( Teampanel.gridlist[1] ) -- Get the grid list selected item. if ( row and col and row ~= -1 and col ~= -1 ) then -- If there is a item selected. local team = guiGridListGetItemText ( Teampanel.gridlist[1], row, 1 ) -- Get the text of the first column. outputChatBox ( team ) triggerServerEvent("setTeam", localPlayer, team ) end end function windowcloseopen () if (guiGetVisible (Teampanel.window[1]) == true) then guiSetVisible (Teampanel.window[1], false) guiSetInputEnabled (false) showCursor (false) elseif (guiGetVisible (Teampanel.window[1]) == false) then guiSetVisible (Teampanel.window[1], true) showCursor (true) end end bindKey ("f4", "down", windowcloseopen) Server function setTeam(source) setPlayerTeam(source, team) end addEvent( "setTeam", true ) addEventHandler("setTeam",root,setTeam)
  8. Sande

    Gui not opening

    Yes, now i have new problem. Because i am newbie in guis can someone script a little example how to select a row and when press take job it do some function. I dont know how to do that, i checked from wiki but it was so hard thing so if someone can post a example i will be happy.
  9. Sande

    Gui not opening

    I got working with these but thanks for helping. function gui() Teampanel = { gridlist = {}, window = {}, button = {} } Teampanel.window[1] = guiCreateWindow(660, 383, 313, 367, "Suomisisu - Jobpanel", false) guiWindowSetSizable(Teampanel.window[1], false) Teampanel.gridlist[1] = guiCreateGridList(9, 23, 295, 232, false, Teampanel.window[1]) guiGridListAddColumn(Teampanel.gridlist[1], "Team", 0.5) guiGridListAddColumn(Teampanel.gridlist[1], "Occupation", 0.5) for i = 1, 9 do guiGridListAddRow(Teampanel.gridlist[1]) end guiGridListSetItemText(Teampanel.gridlist[1], 0, 1, "Staff", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 0, 2, "Admin", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 1, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 2, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 1, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 2, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 1, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 2, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 2, "Medic", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 2, "Fireman", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 2, "Trucker", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 2, "Bus driver", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 2, "Taxi driver", false, false) Teampanel.button[1] = guiCreateButton(14, 283, 136, 58, "End shift", false, Teampanel.window[1]) Teampanel.button[2] = guiCreateButton(160, 283, 136, 58, "Take job", false, Teampanel.window[1]) guiSetVisible(Teampanel.window[1], false) end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), gui ) function windowcloseopen () if (guiGetVisible (Teampanel.window[1]) == true) then guiSetVisible (Teampanel.window[1], false) guiSetInputEnabled (false) showCursor (false) elseif (guiGetVisible (Teampanel.window[1]) == false) then guiSetVisible (Teampanel.window[1], true) showCursor (true) end end bindKey ("f4", "down", windowcloseopen)
  10. addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()), Teampanel.window[1] = guiCreateWindow(660, 383, 313, 367, "Suomisisu - Jobpanel", false) guiWindowSetSizable(Teampanel.window[1], false) Teampanel.gridlist[1] = guiCreateGridList(9, 23, 295, 232, false, Teampanel.window[1]) guiGridListAddColumn(Teampanel.gridlist[1], "Team", 0.5) guiGridListAddColumn(Teampanel.gridlist[1], "Occupation", 0.5) for i = 1, 9 do guiGridListAddRow(Teampanel.gridlist[1]) end guiGridListSetItemText(Teampanel.gridlist[1], 0, 1, "Staff", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 0, 2, "Admin", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 1, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 1, 2, "Freeroam", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 1, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 2, 2, "Criminal", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 1, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 3, 2, "Police", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 4, 2, "Medic", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 1, "Emergency", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 5, 2, "Fireman", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 6, 2, "Trucker", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 7, 2, "Bus driver", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 1, "Civilian", false, false) guiGridListSetItemText(Teampanel.gridlist[1], 8, 2, "Taxi driver", false, false) Teampanel.button[1] = guiCreateButton(14, 283, 136, 58, "End shift", false, Teampanel.window[1]) Teampanel.button[2] = guiCreateButton(160, 283, 136, 58, "Take job", false, Teampanel.window[1]) guiSetVisible(GUI.Editor.window[1], false) end ) function windowcloseopen () local IsWindowVisible = guiGetVisible (Teampanel.window[1]) if (IsWindowVisible == true) then guiSetVisible (Teampanel.window[1], false) guiSetInputEnabled (false) showCursor (false) end if (IsWindowVisible == false) then guiSetVisible (Teampanel.window[1], true) showCursor (true) end end bindKey ("f4", "down", windowcloseopen)
  11. Error: client line 2, attempt to index global vipPanel nil value.
  12. Server: function openVIPPanel(source) if getAccountData(getPlayerAccount(source), "vip" ) == 1 then triggerClientEvent ("vipPanelOpen", source) exports["ac-message"]:outputTopBar("VIP: Panel opened!", source,0,255,0) else exports["ac-message"]:outputTopBar("VIP: You are not vip!", source,255,0,0) end end addCommandHandler("vip", openVIPPanel ) Client function gui() vipPanel.window[1] = guiCreateWindow(498, 140, 365, 632, "Suomisu - VIP Panel", false) guiWindowSetSizable(vipPanel.window[1], false) vipPanel.label[1] = guiCreateLabel(10, 24, 100, 52, "Player functions", false, vipPanel.window[1]) guiSetFont(vipPanel.label[1], "default-bold-small") vipPanel.label[2] = guiCreateLabel(10, 322, 102, 49, "Vehicle functions", false, vipPanel.window[1]) guiSetFont(vipPanel.label[2], "default-bold-small") vipPanel.button[1] = guiCreateButton(9, 76, 165, 47, "Godmode", false, vipPanel.window[1]) vipPanel.button[2] = guiCreateButton(9, 133, 165, 47, "Health", false, vipPanel.window[1]) vipPanel.button[3] = guiCreateButton(10, 190, 165, 47, "Random vehicle", false, vipPanel.window[1]) vipPanel.button[4] = guiCreateButton(10, 255, 345, 47, "Random dailyreward", false, vipPanel.window[1]) vipPanel.button[5] = guiCreateButton(191, 76, 165, 47, "Ghostmode", false, vipPanel.window[1]) vipPanel.button[6] = guiCreateButton(191, 133, 165, 47, "Armor", false, vipPanel.window[1]) vipPanel.button[7] = guiCreateButton(191, 190, 165, 47, "Random skin", false, vipPanel.window[1]) vipPanel.button[8] = guiCreateButton(10, 377, 165, 47, "Fix", false, vipPanel.window[1]) vipPanel.button[9] = guiCreateButton(190, 377, 165, 47, "Refill", false, vipPanel.window[1]) vipPanel.button[10] = guiCreateButton(10, 439, 165, 47, "Destroy", false, vipPanel.window[1]) vipPanel.button[11] = guiCreateButton(190, 439, 165, 47, "Random color", false, vipPanel.window[1]) vipPanel.button[12] = guiCreateButton(10, 502, 165, 47, "Water cheat", false, vipPanel.window[1]) vipPanel.button[13] = guiCreateButton(191, 502, 164, 47, "Fly cheat", false, vipPanel.window[1]) vipPanel.button[14] = guiCreateButton(10, 566, 165, 47, "Ghostcar", false, vipPanel.window[1]) vipPanel.button[15] = guiCreateButton(191, 566, 165, 47, "Spawn infernus", false, vipPanel.window[1]) guiSetVisible ( vipPanel.window[1], false ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), gui ) function show () if guiGetVisible(vipPanel.Window[1],true) then guiSetVisible (vipPanel.Window[1], false) showCursor (false) else guiSetVisible (vipPanel.Window[1], true) showCursor (true) end end addEvent ("vipPanelOpen",true) addEventHandler ("vipPanelOpen",root,show)
  13. Still doesnt work, replaced all that ^^
  14. I started to code vip-panel gui for my server. But i have problem, the check are the player vip works but when it execute a clientTriggerEvent command the panel does not open. Serverside: function openVIPPanel(thePlayer) if getAccountData(getPlayerAccount(thePlayer), "vip" ) == 1 then triggerClientEvent (thePlayer, "vipPanelOpen", thePlayer) exports["ac-message"]:outputTopBar("VIP: Panel opened!", thePlayer,0,255,0) else exports["ac-message"]:outputTopBar("VIP: You are not vip!", thePlayer,255,0,0) end end addCommandHandler("vip", openVIPPanel ) Clientside: function gui() vipPanel.window[1] = guiCreateWindow(498, 140, 365, 632, "Suomisu - VIP Panel", false) guiWindowSetSizable(vipPanel.window[1], false) vipPanel.label[1] = guiCreateLabel(10, 24, 100, 52, "Player functions", false, vipPanel.window[1]) guiSetFont(vipPanel.label[1], "default-bold-small") vipPanel.label[2] = guiCreateLabel(10, 322, 102, 49, "Vehicle functions", false, vipPanel.window[1]) guiSetFont(vipPanel.label[2], "default-bold-small") vipPanel.button[1] = guiCreateButton(9, 76, 165, 47, "Godmode", false, vipPanel.window[1]) vipPanel.button[2] = guiCreateButton(9, 133, 165, 47, "Health", false, vipPanel.window[1]) vipPanel.button[3] = guiCreateButton(10, 190, 165, 47, "Random vehicle", false, vipPanel.window[1]) vipPanel.button[4] = guiCreateButton(10, 255, 345, 47, "Random dailyreward", false, vipPanel.window[1]) vipPanel.button[5] = guiCreateButton(191, 76, 165, 47, "Ghostmode", false, vipPanel.window[1]) vipPanel.button[6] = guiCreateButton(191, 133, 165, 47, "Armor", false, vipPanel.window[1]) vipPanel.button[7] = guiCreateButton(191, 190, 165, 47, "Random skin", false, vipPanel.window[1]) vipPanel.button[8] = guiCreateButton(10, 377, 165, 47, "Fix", false, vipPanel.window[1]) vipPanel.button[9] = guiCreateButton(190, 377, 165, 47, "Refill", false, vipPanel.window[1]) vipPanel.button[10] = guiCreateButton(10, 439, 165, 47, "Destroy", false, vipPanel.window[1]) vipPanel.button[11] = guiCreateButton(190, 439, 165, 47, "Random color", false, vipPanel.window[1]) vipPanel.button[12] = guiCreateButton(10, 502, 165, 47, "Water cheat", false, vipPanel.window[1]) vipPanel.button[13] = guiCreateButton(191, 502, 164, 47, "Fly cheat", false, vipPanel.window[1]) vipPanel.button[14] = guiCreateButton(10, 566, 165, 47, "Ghostcar", false, vipPanel.window[1]) vipPanel.button[15] = guiCreateButton(191, 566, 165, 47, "Spawn infernus", false, vipPanel.window[1]) guiSetVisible ( vipPanel.window[1], false ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), gui ) function show () vipPanel = guiGetVisible (vipPanel.Window[1]) if (vipPanel == true) then guiSetVisible (vipPanel.Window[1], false) showCursor (false) end if (vipPanel == false) then guiSetVisible (vipPanel.Window[1], true) showCursor (true) end end addEvent ("vipPanelOpen",true) addEventHandler ("vipPanelOpen",root,show)
  15. Hello, i need help to count crimes. The point is all time when i attach this to somescript like carjacker, it does +1 crime to crime count. help, thanks function add(thePlayer, command) local account = getPlayerAccount(thePlayer) setAccountData(account, "crimes", +1) --HOW I CAN + the amount without errors. end
  16. Sande

    Paid Scripter

    Add me on skype: sande.retroilija I am insrested about some of your scripts.
  17. Help, i need this bot to guard the commander. but its just hunting all time. function Spawnbot1 (thePlayer) if getAccountData ( getPlayerAccount(thePlayer), "viplevel" ) == 1 then local x,y,z = getElementPosition (thePlayer) local rot= 90 local skin=287 local interior=0 local dimension= 0 local team=false local weapon=38 local mode= guard local modesubject= getElementPosition(thePlayer) call (getResourceFromName("slothbot"), "spawnBot", x, y+5, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) exports [ "slothBot" ]:setBotGuard(thePlayer, x, y, z, true) outputChatBox("[sERVER] Guard bot spawned to guard "..getPlayerName(thePlayer)..".", thePlayer, 255,0,0) else outputChatBox("[sERVER] Error when spawning bot.", thePlayer, 255,0,0) end end addCommandHandler("spawn-guard", Spawnbot1)
  18. hey, why you don't check the posts before you post? ... Because my mess code work :DD
  19. ahh, no problem anymore i checked debug and problemn found.
  20. Please, tell me why these blips not goes to map. function createBlips() merkki = createBlip ( -1938.59998, 192.10001, 24.7, 56 ) merkki1 = createBlip ( -1498.80005, 582.70001, 33.6, 56 ) merkki2 = createBlip ( -591.79999, 1186.80005, 26, 56 ) merkki3 = createBlip ( 1478, 2360, 10.4, 56 ) merkki4 = createBlip ( 1625.69995, 2366, 9.8, 56 ) merkki5 = createBlip ( 2148, 2691, 9.8, 56 ) merkki6 = createBlip ( 2153, 2696, 9.8, 56 ) merkki7 = createBlip ( 1633, 2638, 9.8, 56 ) merkki8 = createBlip ( 2555, 2451, 9.8, 56 ) merkki9 = createBlip ( 2549, 2465, 9.8, 56 ) merkki10 = createBlip ( 2782, 1961, 3.6, 56 ) merkki11 = createBlip ( 2778, 1716, 9.8, 56 ) merkki12 = createBlip ( -136, 1281, 19.4, 56 ) merkki13 = createBlip ( 497, 1224, 12.9, 56 ) merkki14 = createBlip ( 745, 1829, 4.3, 56 ) merkki15 = createBlip ( 728, 2333, 18.1, 56 ) merkki16 = createBlip ( 2372, 2688, 9.8, 56 ) merkki17 = createBlip ( 2282, -1282, 23, 56 ) merkki18 = createBlip ( 2282, -921, 25.4, 56 ) merkki19 = createBlip ( 2085, -359, 60.8, 56 ) merkki20 = createBlip ( 2825, -9.1, 29, 56 ) merkki21 = createBlip ( 2763, 415, 7.3, 56 ) merkki22 = createBlip ( 2762, 616, 7.3, 56 ) merkki23 = createBlip ( 2762, 1023, 9.9, 56 ) merkki24 = createBlip ( 2862, 1236, 9.8, 56 ) merkki25 = createBlip ( 2849, 1542, 9.8, 56 ) merkki26 = createBlip ( 2249, -1540, 18.8, 56 ) merkki27 = createBlip ( 2196, -1880, 12.5, 56 ) merkki28 = createBlip ( 1979, -1951, 12.5, 56 ) merkki29 = createBlip ( 1686, -1951, 13.1, 56 ) merkki30 = createBlip ( 1327, -1916, 0.03, 56 ) merkki31 = createBlip ( 778, -1339, -2.6, 56 ) merkki32 = createBlip ( 179.7, -1023, 20.9, 56 ) merkki33 = createBlip ( -348, -1211, 38.6, 56 ) merkki34 = createBlip ( -831, -1295, 78.4, 56 ) merkki35 = createBlip ( -848, -1402, 90.8 56 ) merkki36 = createBlip ( -1320, -1508, 22.7, 56 ) merkki37 = createBlip ( -1977, -567, 28, 57 ) setElementDimension(merkki1, 11000 ) setElementDimension(merkki2, 11000 ) setElementDimension(merkki3, 11000 ) setElementDimension(merkki4, 11000 ) setElementDimension(merkki5, 11000 ) setElementDimension(merkki6, 11000 ) setElementDimension(merkki7, 11000 ) setElementDimension(merkki8, 11000 ) setElementDimension(merkki9, 11000 ) setElementDimension(merkki10, 11000 ) setElementDimension(merkki11, 11000 ) setElementDimension(merkki12, 11000 ) setElementDimension(merkki13, 11000 ) setElementDimension(merkki14, 11000 ) setElementDimension(merkki15, 11000 ) setElementDimension(merkki16, 11000 ) setElementDimension(merkki17, 11000 ) setElementDimension(merkki18, 11000 ) setElementDimension(merkki19, 11000 ) setElementDimension(merkki20, 11000 ) setElementDimension(merkki21, 11000 ) setElementDimension(merkki22, 11000 ) setElementDimension(merkki23, 11000 ) setElementDimension(merkki24, 11000 ) setElementDimension(merkki25, 11000 ) setElementDimension(merkki26, 11000 ) setElementDimension(merkki27, 11000 ) setElementDimension(merkki28, 11000 ) setElementDimension(merkki29, 11000 ) setElementDimension(merkki30, 11000 ) setElementDimension(merkki31, 11000 ) setElementDimension(merkki32, 11000 ) setElementDimension(merkki33, 11000 ) setElementDimension(merkki34, 11000 ) setElementDimension(merkki35, 11000 ) setElementDimension(merkki36, 11000 ) setElementDimension(merkki37, 11000 ) setBlipVisibleDistance(merkki1, 1500 ) setBlipVisibleDistance(merkki2, 1500 ) setBlipVisibleDistance(merkki3, 1500 ) setBlipVisibleDistance(merkki4, 1500 ) setBlipVisibleDistance(merkki5, 1500 ) setBlipVisibleDistance(merkki6, 1500 ) setBlipVisibleDistance(merkki7, 1500 ) setBlipVisibleDistance(merkki8, 1500 ) setBlipVisibleDistance(merkki9, 1500 ) setBlipVisibleDistance(merkki10, 1500 ) setBlipVisibleDistance(merkki11, 1500 ) setBlipVisibleDistance(merkki12, 1500 ) setBlipVisibleDistance(merkki13, 1500 ) setBlipVisibleDistance(merkki14, 1500 ) setBlipVisibleDistance(merkki15, 1500 ) setBlipVisibleDistance(merkki16, 1500 ) setBlipVisibleDistance(merkki17, 1500 ) setBlipVisibleDistance(merkki18, 1500 ) setBlipVisibleDistance(merkki19, 1500 ) setBlipVisibleDistance(merkki20, 1500 ) setBlipVisibleDistance(merkki21, 1500 ) setBlipVisibleDistance(merkki22, 1500 ) setBlipVisibleDistance(merkki23, 1500 ) setBlipVisibleDistance(merkki24, 1500 ) setBlipVisibleDistance(merkki25, 1500 ) setBlipVisibleDistance(merkki26, 1500 ) setBlipVisibleDistance(merkki27, 1500 ) setBlipVisibleDistance(merkki28, 1500 ) setBlipVisibleDistance(merkki29, 1500 ) setBlipVisibleDistance(merkki30, 1500 ) setBlipVisibleDistance(merkki31, 1500 ) setBlipVisibleDistance(merkki32, 1500 ) setBlipVisibleDistance(merkki33, 1500 ) setBlipVisibleDistance(merkki34, 1500 ) setBlipVisibleDistance(merkki35, 1500 ) setBlipVisibleDistance(merkki36, 1500 ) setBlipVisibleDistance(merkki37, 1500 ) end addEventHandler("onResourceStart", resourceRoot, createBlips )
×
×
  • Create New...