Jump to content

Gtagasje

Members
  • Posts

    141
  • Joined

  • Last visited

Everything posted by Gtagasje

  1. Hi, I wanna create a one of the given markers if you enter a vehicle, and if you are on the team "Criminal". I tried this script [i made it server side]: local criminal = createTeam("Criminal", 255, 0, 0) function createAmarker () if getPlayerTeam(getTeamFromName(criminal)) then theMarkers = { createMarker (0, 0, 20), createMarker (1, 0, 20), createMarker (2, 0, 20), createMarker (3, 0, 20) } markersTable[math.random(#theMarkers)] end end addEventHandler("onVehicleEnter", getRootElement(), createAmarker) but it shows this error: "SCRIPT ERROR: :line 11: '=' expected near end." I don't know how to fix this, I tried a lot of things, but I wasn't able to fix this. Once again in short, I wan't the script to create one of the markers in the script, if the player (on criminal team) enters a vehicle. But it shows that error, which i'm not able to fix. Regards, Gtagasje
  2. Gtagasje

    set team

    Oh, sorry for that, I didnt script a while, and I forgot some things.
  3. Gtagasje

    set team

    hi. I have made this script to set your team to Staff if you are in the admin ACL. But it shows this error: Attempt to concatenate global 'playerName'. (A nill value). Its on line . I dont know how to fix this. I tried, but without succes. But the getACL thing is working in other scripts. What to do.. This is my script (server): local Staff = createTeam ( "Staff", 113, 0, 188 ) function StaffTeam ( source, command ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then setPlayerTeam (source, "Staff") else cancelEvent() end end addCommandHandler("admin", StaffTeam)
  4. Gtagasje

    search light

    I think no, if it was, the good scripters would have post the function..
  5. Because he may not want ppl to steal his script.. lol.
  6. Hi, My friend have a made a arrest script, but it shows the following error: ERROR:line 20: Bad argument @ 'addEventHandler' [ Expected element at argument 2, got nill ]. And this is the script: function arrest(hitElement, weapon) local weap = getWeaponNameFromID(3) local playerTeam = getPlayerTeam(source) if ( playerTeam == "Police" ) then if ( getPlayerWantedLevel(hitElement) == "1" ) or ( getPlayerWantedLevel(hitElement) == "2" ) or ( getPlayerWantedLevel(hitElement) == "3" ) or ( getPlayerWantedLevel(hitElement) == "5" ) or ( getPlayerWantedLevel(hitElement) == "6" ) then if ( weap ) then local arrestMarker = createMarker(1542.39966, -1675.01782, 13.55443, "cylinder", 2.5, 255, 255, 0, source) toggleAllControls( hitElement, false ) ax, ay, az = getElementPosition ( hitElement ) cx, cy, cz = getElementPosition ( source ) d = getDistanceBetweenPoints3D(ax, ay, az, cx, cy, cz) if ( d > 10 ) then setElementPosition( hitElement, cx-5, cy, cz ) end end end end end addEventHandler( "onMarkerHit", arrestMarker, mhit ) addEventHandler( "onPlayerDamage", root, arrest) function mhit(hitElement) if ( getPlayerTeam(source) ~= "Police" ) then if ( getPlayerWantedLevel(hitElement) == "1" ) or ( getPlayerWantedLevel(hitElement) == "2" ) or ( getPlayerWantedLevel(hitElement) == "3" ) or ( getPlayerWantedLevel(hitElement) == "5" ) or ( getPlayerWantedLevel(hitElement) == "6" ) then setElementInterior(hitElement, 6) setElementPosition(hitElement, 264.74969, 77.49036, 1001.03906) else end end end we already have a wanted script on command.
  7. Gtagasje

    Health

    Doesnt this script work Aibo? Since I dont have time to test it actually. .
  8. Hi, How to make it that if you type like "/inv "playername goes here" the typed nick gets the message? And how to make it that it sets his elementdata to "inv-ed" if the player types "/invacc" ? I dont know how to do this, can you help me with the start? Regards, Gtagasje.
  9. Gtagasje

    Health

    Thank you, but how do I need to start it on button hit? Just put bindKey above the eventHandler?
  10. Gtagasje

    Health

    Hi, I wanna make a script that if you are admin, and for example you press "F1", you cant be damaged, but I dont know how to do this. I think with onClientPlayerDamage, but im not sure. Regards, Gtagasje.
  11. Hey, Thanks for helping me man! I can test tomorrow if this would work, no time ATM. .
  12. Hi again, I have tried to make a script to store the account data, but it doesn't work at all. It does save the data, and the money, but not the position. This is my script : function onServerLeave () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "data.money", playermoney ) local playerjob = getElementData ( source, "Job" ) setAccountData ( playeraccount, "data.job", playerjob ) local playerpos = getElementPosition ( source ) setAccountData ( playeraccount, "data.pos", playerpos ) end end function onServerJoin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "data.money" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) local playerjob = getAccountData ( playeraccount, "data.job" ) if ( playerjob ) then setElementData ( source, "Job", playerjob ) local playerpos = getAccountData ( playeraccount, "data.pos" ) if ( playerpos ) then setElementPosition ( source, playerpos ) end end end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onServerLeave ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onServerJoin ) Its server sided. Regards, Gtagasje.
  13. Ok, first off all, before you read this script, there might be alot wrong in it, this is my first script with money. I want the script to check everybody's money, and output it in the Scoreboard ( added the column ). The timer works, but the other things, dont.. I dont know how to fix this. Please help. . local players = "" function getMoney () getPlayerMoney ( players ) setElementData ( players, "Money", getPlayerMoney ( players ) ) end setTimer ( getMoney, 5000, 0 ) addEventHandler("onResourceStart", getRootElement(), getMoney) Regards, Gtagasje.
  14. Nvm, I made it working!
  15. I have done this: setElementData ( source, "Officer", true ) but it doesn't show it in the "rank" line.
  16. It now wants a element at argument 3.. and, I want it to go to the "rank" column, which I added in the dxscoreboard_exports script. Here's the lines: scoreboardColumns = { { ["name"] = "name", ["width"] = 200, ["friendlyName"] = "Name", ["priority"] = 1 }, { ["name"] = "ping", ["width"] = 40, ["friendlyName"] = "Ping", ["priority"] = MAX_PRIRORITY_SLOT }, { ["name"] = "rank", ["width"] = 100, ["friendlyName"] = "rank", ["priority"] = 2 } }
  17. Hi, I have a script that will set you to the police team if you click the gui button, and I tried to set the ElementData to "Officer" but it shows the following error : Bad argument @ setElementData ( line 8 ) [Expected element @ argument 1, got nill.] This is my server sided script : local Police = createTeam ("Police", 0, 0, 255) function SetPlayerPolice() setPlayerTeam (source, getTeamFromName("Police")) setElementModel (source, 280) giveWeapon ( source, 22, 15 ) setElementData ( thePlayer, "Officer", true ) end addEvent("PoliceTeam",true) addEventHandler("PoliceTeam", root, SetPlayerPolice) And if you need it, client side: 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(PoliceGui, false) showCursor(false) outputChatBox ( "Police Commander: Welcome to the police team!" ) outputChatBox ( "Police Ammunation: You have been given 15 pistol ammo for self defence!" ) elseif (source == Cancel) then guiSetInputEnabled(false) guiSetVisible(PoliceGui, false) showCursor(false) end end addEventHandler ("onClientGUIClick", root, PoliceTeam) I have alot of spaces, dont know why.
  18. A simple question, how to add a column to a scoreboard? Like in DXScoreboard you have column's like Ping and Name ect. How to add one?
  19. I don't know . But really thank you for the answer .
  20. Gtagasje

    Vehicle Gui

    Hi, I made a vehicle gui which will give you a vehicle if you press the button. And it works, but now I wan't it to warp you inside also,. This is what I have: Server: function createLS () local LS = createVehicle ( 596, 1557.03284, -1605.92700, 13 ) end addEvent("PoliceLS",true) addEventHandler("PoliceLS", root, createLS) function createLV () local LV = createVehicle ( 598, 1557.03284, -1605.92700, 13 ) end addEvent("PoliceLV",true) addEventHandler("PoliceLV", root, createLV) function createSF () local SF = createVehicle ( 597, 1557.03284, -1605.92700, 13 ) end addEvent("PoliceSF",true) addEventHandler("PoliceSF", root, createSF) function createRan () local Ran = createVehicle ( 599, 1557.03284, -1605.92700, 13 ) and warpPedIntoVehicle ( Ran ) end addEvent("PoliceRan",true) addEventHandler("PoliceRan", root, createRan) I didn't add the client because I know warpPedIntoVehicle is serverside.
×
×
  • Create New...