Jump to content

Gtagasje

Members
  • Posts

    141
  • Joined

  • Last visited

Everything posted by Gtagasje

  1. I made with some good help a script about a gui, that sets you to a team, with only 1 team, it sets you to police, but with also criminal, the police gui has an error. And the criminal gui sets you to Police.
  2. It now shows a error about the policegui again.. wrong syntax @ line 57.. and it worked without the criminal job gui. If i'm in the criminal marker, it sets you to the cops team. Police client : local dutyMarker = createMarker ( 1229, -1423.6999511719, 13,'cylinder', 2.0, 225, 0, 0, 137 ) CrimGui = guiCreateWindow(227,106,342,376,"MLAW Criminal job",false) Have_Job = guiCreateButton(39,313,111,45,"Have job!",false,CrimGui) Cancel = guiCreateButton(200,312,111,45,"Cancel",false,CrimGui) Doel = guiCreateMemo(63,44,234,242,"Criminal:\nAs Criminal you need to rob houses. You will get 0-1K from this.",false,CrimGui) guiMemoSetReadOnly( Doel,true ) guiSetVisible ( CrimGui, false ) addEventHandler("onClientMarkerHit", dutyMarker, function(hitElement) if hitElement ~= localPlayer then return end if CrimGui ~= nil then guiSetVisible(CrimGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("You aren't ready yet. Re-enter the marker.") end end ) addEventHandler ("onClientGUIClick", Have_Job, function ( ) triggerServerEvent("CrimTeam",localPlayer) showCursor(false) guiSetInputEnabled(false) guiSetVisible(CrimGui, false) showCursor(false) end, false ) addEventHandler ("onClientGUIClick", Cancel, function ( ) guiSetInputEnabled(false) guiSetVisible(CrimGui, false) showCursor(false) end, false ) and server: local Police = createTeam ("Police", 0, 0, 255) function SetPlayerPolice() setPlayerTeam (source, getTeamFromName("Police")) setElementModel (source, 280) end addEvent("PoliceTeam",true) addEventHandler("PoliceTeam", root, SetPlayerPolice) P.S. I don't wanna be that annoying player, but I don't know what to do about this..
  3. Thank you very much again and again Casti!
  4. It now shows = expected near end on line 28 ;s... Do you know what to do about this?
  5. Ah. now I get it, thanks again castillo! :DDD
  6. wait, I though that setPlayerPosition was something, but it wasn't.. so I changed it to setElementPosition but still a nil value
  7. and it sets you to the police team ;s
  8. I wan't a player to get a position at LSPD if they login, and it actually shows in the debugmode that I have a bad syntax at setPlayerPosition. This is my script: function position (source) setElementPosition ( source, 1549.88953, -1685, 13 ) end addEventHandler("onPlayerLogin", root, position)
  9. Hello, I have made a gui for police team job, and I changed all the things which I though had to be changed to criminal. But now it shows this error : Bad Argument @ line 57, guiSetVisible expected gui element, got nil. This is my client script: local dutyMarker = createMarker ( 1229, -1423.6999511719, 13,'cylinder', 2.0, 225, 0, 0, 137 ) function createCrimGui ( hitElement ) CrimGui = guiCreateWindow(227,106,342,376,"MLAW Criminal job",false) Have_Job = guiCreateButton(39,313,111,45,"Have job!",false,CrimGui) Cancel = guiCreateButton(200,312,111,45,"Cancel",false,CrimGui) Doel = guiCreateMemo(63,44,234,242,"Criminal:\nAs Criminal you need to rob houses. You will get 0-1K from this.",false,CrimGui) guiMemoSetReadOnly( Doel,true ) end addEventHandler("onClientMarkerHit", dutyMarker, function(hitElement) if hitElement == localPlayer then createCrimGui ( hitElement ) if (CrimGui ~= nil) then guiSetVisible(CrimGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("You aren't ready yet. Re-enter the marker.") end end end ) function CrimTeam (button,state) if (source == Have_Job) then triggerServerEvent("CrimTeam",localPlayer) guiSetInputEnabled(false) guiSetVisible(CrimGui, false) showCursor(false) elseif (source == Cancel) then guiSetInputEnabled(false) guiSetVisible( CrimGui, false ) showCursor(false) end end addEventHandler ("onClientGUIClick", root, CrimTeam) and server: local Criminal = createTeam ("Criminal", 255, 0, 0) function SetPlayerCrim() setPlayerTeam (source, getTeamFromName("Criminal")) end addEvent("CrimTeam",true) addEventHandler("CrimTeam", root, SetPlayerCrim)
  10. Ah, yes. I think I didn't though and added the function there. Thx
  11. Oh. and setplayerskin I have already replaced with setelementmodel.
  12. Hello again, You guys helped me alot with the job gui, and I'm very thankfull for that, but, now I added it to a another marker also, to test if that would work, it shows a error about the syntax @ line 57 or 58.. This is the script: Client: local dutyMarker = createMarker ( 1547.88953, -1681.53955, 12.5, 'cylinder', 2.0, 0, 0, 225, 132 ) function createCopGui ( hitElement ) PoliceGui = guiCreateWindow(227,106,342,376,"MLAW Police job",false) Have_Job = guiCreateButton(39,313,111,45,"Have job!",false,PoliceGui) Cancel = guiCreateButton(200,312,111,45,"Cancel",false,PoliceGui) Doel = guiCreateMemo(63,44,234,242,"Police Job:\nAs police you will have a hourly payment. Further objectves comming soon!",false,PoliceGui) guiMemoSetReadOnly( Doel,true ) end addEventHandler("onClientMarkerHit", dutyMarker, function(hitElement) if hitElement == localPlayer then createCopGui ( hitElement ) if (PoliceGui ~= nil) then guiSetVisible(PoliceGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("The police doesn't want you. Please re-enter the marker.") end end end ) function PoliceTeam(button,state) if (source == Have_Job) then triggerServerEvent("PoliceTeam",localPlayer) guiSetInputEnabled(false) guiSetVisible(CopGui, false) showCursor(false) elseif (source == Cancel) then guiSetInputEnabled(false) guiSetVisible(PoliceGui, false) showCursor(false) end end addEventHandler ("onClientGUIClick", root, PoliceTeam) Server: local Police = createTeam ("Police", 0, 0, 255) function SetPlayerPolice() setPlayerTeam (source, getTeamFromName("Police")) setPlayerSkin (source, 280) end addEvent("PoliceTeam",true) addEventHandler("PoliceTeam", root, SetPlayerPolice)
  13. Ok, this is my actual script now (It didn't show the error message, thx) but when I press the button Have_Job, it doesn't hide the gui. local dutyMarker = createMarker ( 1556.33, -1608.37, 13, 'cylinder', 2.0, 0, 0, 225, 132 ) function createCopGui ( hitElement ) PoliceGui = guiCreateWindow(227,106,342,376,"MLAW Police job",false) Have_Job = guiCreateButton(39,313,111,45,"Have job!",false,PoliceGui) Cancel = guiCreateButton(200,312,111,45,"Cancel",false,PoliceGui) Doel = guiCreateMemo(63,44,234,242,"Police Job:\nAs police you will have a hourly payment. Further objectves comming soon!",false,PoliceGui) guiMemoSetReadOnly( Doel,true ) end addEventHandler("onClientMarkerHit", dutyMarker, function (hitElement) if hitElement == localPlayer then createCopGui ( hitElement ) if (PoliceGui ~= nil) then guiSetVisible(PoliceGui, true) showCursor(true) guiSetInputEnabled(true) else outputChatBox ("The police doesn't want you. Please re-enter the marker.") end end end ) function PoliceTeam(Have_Job,state) if button == "left" and state == "up" then setPlayerTeam ("Police") triggerServerEvent("PoliceTeam") guiSetInputEnabled(false) guiSetVisible(PoliceGui, false) showCursor(false) end end
  14. This time it's on line 78
  15. Ah, thx, and I posted a server file, in case of needed.. but it keeps showing expected near end
  16. Now it shows expected near 'end'.. but atleast thx for wanting to help
  17. I created a gui for a police job, and I might miss some functions. But that isn't my problem.. It keeps showing in debug unexpected symbol near ) on line 10. This is my script: Client: local dutyMarker = createMarker ( 1556.33, -1608.37, 13, 'cylinder', 2.0, 0, 0, 225, 132 ) function createCopGui ( hitElement, matchingDimension ) PoliceGui = guiCreateWindow(227,106,342,376,"MLAW Police job",false) Have_Job = guiCreateButton(39,313,111,45,"Have job!",false,PoliceGui) Cancel = guiCreateButton(200,312,111,45,"Cancel",false,PoliceGui) Doel = guiCreateMemo(63,44,234,242,"Police Job:\nAs police you will have a hourly payment. Further objectves comming soon!",false,PoliceGui) guiMemoSetReadOnly( Doel,true ) end ) addEventHandler("onMarkerHit", dutyMarker, createCopGui , function () createCopGui ( hitElement ) ouputChatBox ("Please choose if you wanna be police.") if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else outputChatBox ("The police doesn't want you. Please re-enter the marker.") end showCursor(true) guiSetInputEnabled(true) end ) function PoliceTeam(button,state) if button == "left" and state == "up" then setPlayerTeam ("Police") triggerServerEvent("PoliceTeam") -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) end end end and server: function SetPlayerPolice( hitElement ) end addEvent("PoliceTeam",true) addEventHandler("PoliceTeam", root, SetPlayerPolice) I miss things like memo ect. but i'll try to add that later.
  18. I know but, do I need to place server and client side script in the same or seperate lua files? Like for scripting a gui. I have the client, and do I need to place the server in a other .lua now?
  19. Ahh, now I get it Thank you again Castillo !
  20. I might be stupid, but I just have a simple question: Do you have to put server and client files in seperate .lua files or in the same, and in seperate maps or in the same You can call me stupid if you want
  21. I got a script for paycheck on team ect. but it shows the folowing error message in console : "WARNING: Core/copspaycheck.lua:2: Bad argument @ 'getPlayersInTeam'." and: "ERROR: Core/copspaycheck.lua:3: bad argument #1 to 'ipairs' (table expected, got boolean)" I don't know how to fix those things.. This is the script: function allPlayersPayDay() local allPlayers = getPlayersInTeam( "Police" ) for index,value in ipairs(allPlayers) do givePlayerMoney ( value, 5000 ) outputChatBox ( "PayTime! You have been given 5K! Enjoy!", value ) end end function onResourceStart(thisResource) setTimer ( allPlayersPayDay, 1000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart ) Regards, Gtagasje
×
×
  • Create New...