Jump to content

BriGhtx3

Members
  • Posts

    378
  • Joined

  • Last visited

Everything posted by BriGhtx3

  1. Alright . Why didn't I think about triggerevents -.- Thanks! Ok next question : How can I differ between a car, bike, airplane, helicopter?
  2. local localPlayer = getLocalPlayer() function fuehrerschein() if isPedInVehicle(localPlayer) then local fuehrerscheinda = tostring(getElementData(localPlayer,"Scheine")) if fuehrerscheinda == "0" then outputChatBox("Du hast keinen Führerschein!", thePlayer,255,0,0) removePedFromVehicle ( localPlayer ) end end end addEventHandler( "onClientPlayerVehicleEnter", localPlayer, fuehrerschein ) My Problem : This Code has to be clientside, but the removePedFromVehicle serverside. How do I get this function serverside? The outputChatBox isn't red, like it should be. Thanks
  3. Thanks Solidsnake. It works! Could you please show me my error?
  4. BriGhtx3

    findPlayer

    I am not sure, because i am new, but I think findPlayer is not defined. Or what should the "findPlayer" command do?
  5. You mean : getElementData(source,"PlayedH")..":"..getElementData(source,"PlayedM") If yes, than yes. They are defined both in another file : setElementData(source,"PlayedM",tonumber(row[17])) setElementData(source,"PlayedH",tonumber(row[18])) But not just the "Spielzeit" with the getElementData doesn't work. Even those with plain text
  6. OK. Then I would like to use the original scoreboard : My Questions : How do I color the team names and members How do I add columns My Client code : local root = getRootElement() local player = getLocalPlayer() local gespielt = getElementData(source,"PlayedH")..":"..getElementData(source,"PlayedM") addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() setElementData ( player, "Gesellschaftsstellung", "Bauer" ) setElementData ( player, "Spielzeit", gespielt ) setElementData ( player, "Nummer", "000" ) end ) function refreshZeit() setElementData( player(), "Spielzeit", gespielt ) end setTimer( refreshZeit, 60000, 0 ) In this Code the columns are shown but not the value -.-
  7. @Bin is server-side @karlis defined them Error : attempt to call global getLocalPlayer (a nil value) And Warnings because he doesn't finde the resource. It isn't even a resource in my mode. It is in my normal gamemode folder (extracted)
  8. I think I found one error : The Scoreboard isn't a resource! I haven't put it in the resource folder. I extracted it and put it in my gamemode and in my meta.xml
  9. No they weren't, and it doesn't work (now it shows errors too) : addEventHandler ( "onClientResourceStart", getResourceRootElement(getResourceFromName("scoreboard")), function() exports.scoreboard:scoreboardAddColumn ( "Gesellschaftsstatus" ) exports.scoreboard:scoreboardAddColumn ( "Spielzeit" ) setElementData ( getLocalPlayer ( ), "Gesellschaftsstatus", "Bauer" ) setElementData( getLocalPlayer ( ), "Spielzeit", ""..getElementData(source,"PlayedH")..":"..getElementData(source,"PlayedM") ) end ) function refreshZeit() local Zeit = ""..getElementData(source,"PlayedH")..":"..getElementData(source,"PlayedM") setElementData( getLocalPlayer(), "Spielzeit", Zeit ) end setTimer( refreshZeit, 60000, 0 )
  10. addEventHandler ( "onClientResourceStart", getRootElement(), function (resource) if resource == getThisResource() then exports.scoreboard:scoreboardAddColumn ( "Gesellschaftsstatus" ) exports.scoreboard:scoreboardAddColumn ( "Spielzeit" ) setElementData ( getLocalPlayer ( ), "Gesellschaftsstatus", "Bauer" ) setElementData( getLocalPlayer ( ), "Spielzeit", ""..PlayedH..":"..PlayedM ) end end ) function refreshZeit() local Zeit = ""..PlayedH..":"..PlayedM setElementData( getLocalPlayer(), "Spielzeit", Zeit ) end setTimer( refreshZeit, 60000, 0 ) That's my code. My Problem : It doesn't show the columns. Where is my error?
  11. Yeah! Thanks! it was obviously -.- I use the isAdmin because i work with a database and without acl.
  12. local AdminCommand = {} AdminCommand["changeSkin"]=3 function changeSkin ( thePlayer, command, player, skinid ) if isAdmin( thePlayer, AdminCommand[string.lower(command)] ) then if player and tonumber(skinid) then local playerid = getPlayerFromName( player ) if playerid then setElementModel ( thePlayer, skinid ) else outputChatBox("Der angegebene Spieler existiert nicht!",thePlayer) end else outputChatBox("BENUTZUNG: /setskin [spieler] [skin-ID]",thePlayer) end else outputChatBox( "Du hast nicht das Recht dazu!", thePlayer ) end end addCommandHandler("setskin", changeSkin) It doesn't even show me an error or the "BENUTZUNG". Greetz ~
  13. PROBLEM SOLVED! I had to remove Housekey because it has a nil value in the database!
  14. local result = mysql_query(sqlcon, "INSERT INTO user_data SET Username='"..mysql_escape_string(sqlcon, username).."', Password='"..md5(password).."', EMail='"..mysql_escape_string(sqlcon,email).."', Fraktion='0', Skin='15', Rank='0', Spawn='0', Job='0', Materials='0', Drugs='0', LicA='0', LicB='0', LicC='0', Money='150', Bank='1500', Adminlevel='0', PlayedM='0', PlayedH='0', Wanted='0', Jailtime='0', Slot1='Frei', Slot2='Frei', Slot3='Frei', Slot4='Frei', Slot5='Frei', Slot6='Frei', Slot7='Frei', Slot8='Frei', Slot9='Frei', Slot10='Frei', Housekey='255';") mysql_free_result(result) result = mysql_query(sqlcon,"SELECT * FROM user_data WHERE Username='"..mysql_escape_string( sqlcon, username ).."';") if mysql_num_rows( result ) == 1 then row = mysql_fetch_row(result) else outputChatBox( "Der Account konnte nicht erfolgreich erstellt werden, bitte kontaktiere einen Admin", source ) end mysql_free_result(result) This is my Code, but it doesn't works because there is a error : bad argument #1 to 'mysql_free_result' (Luabook.MysqlResult expected, got nil)
  15. Hey I have another question : When I click F11 the Map shows. On the Map I want to have a yellow dot or the Police symbol. How can I create this marker? I am currently working on a real life script, and I have now all the Jobs and the Factions, but the people do not know where the Police Department is, because there are no markers This time I don't have code, because I have no idea how to create them Thanks
  16. Alright everything works, but In the Rules Window, when I click another Tab, I have to go with the mouse over a position of the button, to click it.
  17. Hey, now i am asking that again ~,~ When I click F2, the GUI shows, when I click on Schliessen it hides. But when I click on Jobs, close that and then on Schliessen or click F2 it doesn't hide! Same with Regeln, when I click on it and then Schliessen, Regeln closes, but when I click in the Regeln GUI, on another TAB it doesn't close any more and the main GUI too. function hide() guiSetVisible(GUIEditor_Window[2], false) end function hideRules() guiSetVisible(GUIEditor_Window[3], false) end function hideGUI() guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Window[1] = guiCreateWindow(0,-2,800,48,"STATUS",false) guiWindowSetSizable(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[1],false) GUIEditor_TabPanel[1] = guiCreateTabPanel(78,-750,5,600,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) GUIEditor_TabPanel[2] = guiCreateTabPanel(38,12,5,5,false,GUIEditor_Window[1]) GUIEditor_Tab[2] = guiCreateTab("Tab",GUIEditor_TabPanel[2]) GUIEditor_Button[1] = guiCreateButton(64,24,97,15,"JOBS",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(226,22,288,17,"BEDUERFNISSE",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[2],"clear-normal") GUIEditor_Button[3] = guiCreateButton(559,22,75,16,"REGELN",false,GUIEditor_Window[1]) Beenden = guiCreateButton(660,22,75,16,"Schliessen",false,GUIEditor_Window[1]) addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], showJobs ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[3], showRules ) addEventHandler ( "onClientGUIClick", Beenden, hideGUI) end) bindKey("F2","down", function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) function showJobs() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[2] = guiCreateWindow(223,129,435,402,"JOBS",false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_TabPanel[1] = guiCreateTabPanel(18,26,330,367,false,GUIEditor_Window[2]) GUIEditor_Tab[1] = guiCreateTab("Anwalt",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(6,6,314,184,"Der Anwalt ist ein wichtiger \nPunkt im Leben. Ohne in hat \nman vor Gericht keine Chance. \nMan sollte sich lieber einen \nanschaffen.",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiSetFont(GUIEditor_Label[1],"sa-header") GUIEditor_Button[1] = guiCreateButton(19,206,292,63,"ANNEHMEN",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Drogendealer",GUIEditor_TabPanel[1]) GUIEditor_Label[2] = guiCreateLabel(5,8,306,140,"Das ist der Drogendealer. \nEr baut sie entweder selbst an \noder kauft sich welche um sie \nspaeter zu verticken.",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[2],0,255,0) guiSetFont(GUIEditor_Label[2],"sa-header") GUIEditor_Button[2] = guiCreateButton(16,172,293,71,"ANNEHMEN",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Mechaniker",GUIEditor_TabPanel[1]) GUIEditor_Label[3] = guiCreateLabel(6,10,303,183,"Bei diesem Beruf kann man, \nAutos reparieren als auch tunen. \nMan kann den Preis festlegen \nwie man will.",false,GUIEditor_Tab[3]) guiLabelSetColor(GUIEditor_Label[3],0,255,0) guiSetFont(GUIEditor_Label[3],"sa-header") GUIEditor_Button[3] = guiCreateButton(26,206,267,62,"ANNEHMEN",false,GUIEditor_Tab[3]) GUIEditor_Tab[4] = guiCreateTab("Taxifahrer",GUIEditor_TabPanel[1]) GUIEditor_Button[4] = guiCreateButton(355,58,71,323,"SCHLIESSEN",false,GUIEditor_Window[2]) addEventHandler ( "onClientGUIClick", GUIEditor_Button[4], hide) end function showRules() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Progress = {} GUIEditor_Window[3] = guiCreateWindow(16,56,768,405,"HILFE & REGELN",false) GUIEditor_TabPanel[4] = guiCreateTabPanel(13,25,746,371,false,GUIEditor_Window[3]) GUIEditor_Tab[1] = guiCreateTab("Allgemein",GUIEditor_TabPanel[4]) GUIEditor_Label[1] = guiCreateLabel(17,6,715,333,"",false,GUIEditor_Tab[1]) guiSetAlpha(GUIEditor_Label[1],1) GUIEditor_Tab[2] = guiCreateTab("Berufe",GUIEditor_TabPanel[4]) GUIEditor_Label[2] = guiCreateLabel(8,5,730,336,"Berufe sind sehr wichtig, da das Geld nicht einfach angeflogen kommt. \nMan sollte sich immer etwas aussuchen was einem Spass macht! \nEs gibt die Berufe : \n-Mechaniker\n-Anwalt\n-Taxifahrer\n-Drogendealer\nJeder Beruf hat einen gewissen Schwierigkeitsgrad! Empfohlen fuer den \nAnfang waeren : Mechaniker, Drogendealer",false,GUIEditor_Tab[2]) guiSetFont(GUIEditor_Label[2],"sa-header") GUIEditor_Tab[3] = guiCreateTab("Fraktionen",GUIEditor_TabPanel[4]) GUIEditor_Tab[4] = guiCreateTab("Polizei",GUIEditor_TabPanel[4]) GUIEditor_Tab[5] = guiCreateTab("Geld",GUIEditor_TabPanel[4]) GUIEditor_Tab[6] = guiCreateTab("Tipps",GUIEditor_TabPanel[4]) GUIEditor_Tab[7] = guiCreateTab("Commands",GUIEditor_TabPanel[4]) GUIEditor_Tab[8] = guiCreateTab("Spielsystem",GUIEditor_TabPanel[4]) GUIEditor_Tab[9] = guiCreateTab("REGELN",GUIEditor_TabPanel[4]) GUIEditor_Button[5] = guiCreateButton(609,26,162,24,"FENSTER SCHLIESSEN",false,GUIEditor_Window[3]) GUIEditor_Label[3] = guiCreateLabel(694,561,97,21,"HUNGER",false) guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Progress[1] = guiCreateProgressBar(683,579,116,21,false) guiProgressBarSetProgress(GUIEditor_Progress[1],100) addEventHandler ( "onClientGUIClick", GUIEditor_Button[5], hideRules) end
  18. oO... Now it works for me too. Alright thanks for your help
  19. Yes... But there aren't any errors shown up.
  20. function visible() local misc = guiGetVisible(GUIEditor_Window[1]) guiShowCursor(not misc) guiSetVisible(GUIEditor_Window[1], not misc) end addCommandHandler ( "vis", visible ) Like this? Sry i am new to lua @Solidsnake Doesn't work
  21. Hey Guys, I have a new question : When i write /self in the chatbox, my GUI createSELF should be shown and the Cursor too. And when i write it again it should hide and the Cursor too. This is my code for the gui : addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function() GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Window[1] = guiCreateWindow(0,-2,800,48,"STATUS",false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_TabPanel[1] = guiCreateTabPanel(78,-750,5,600,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) GUIEditor_TabPanel[2] = guiCreateTabPanel(38,12,5,5,false,GUIEditor_Window[1]) GUIEditor_Tab[2] = guiCreateTab("Tab",GUIEditor_TabPanel[2]) GUIEditor_Button[1] = guiCreateButton(64,24,97,15,"JOBS",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(226,22,288,17,"BEDUERFNISSE",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[2],"clear-normal") GUIEditor_Button[3] = guiCreateButton(559,22,75,16,"REGELN",false,GUIEditor_Window[1]) end) addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], showJobs ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], showBed ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[3], showRel ) Thanks Greetz~
  22. doesn't work. Ok i tested it without guiSetVisible(StatusW,false), but i don't see it anyway. I think this is because of the Login Panel I have. The Login Panel makes a blackscreen... I tested it with some outputchat Text, and the text shows, but the window is still not visible.
×
×
  • Create New...