Jump to content

damien111

Members
  • Posts

    270
  • Joined

  • Last visited

Everything posted by damien111

  1. Ah, Resolved, Thankyou very much! One more question if you have time, how can i anchor something to the middle of the screen, so its not in diffrent places on diffrent resolutions
  2. I tryed that, now i need some help , sorry bout this, but i think i did this wrong ServerSide Snippit addEventHandler("onPlayerLogin", getRootElement ( ), function() triggerClientEvent ( "onLogin", source() ) end ) Clientside Snippit function loginStuff() showCursor( true ) guiSetVisible(GUIEditor.window[1],true) end addEvent( "onLogin", true ) addEventHandler( "onLogin", source(), loginStuff)
  3. I tryed triggerClientEvent, but it would create the GUI for everyone.. also how would i do that with shaders, is there a tutorial on the forums i should look for or what?
  4. I need to ask two questions about scripting. 1. How can i trigger something to a player when he logs in, onPlayerLogin is server side and i dont know how to get the variable ive made to it, and use it to triggera gui just for that player. 2. How do i draw images onto something and put them ingame, do i have to edit the .txd of a object?
  5. I am back from school now, ok so do you want to make it for the already created freeroam script or have a command that does it for example, /rustler creates the rustler if they arent in the non spawning zone, or what?
  6. We do not create scripts for you! Learn how, you could use these createColRectangle isElementWithinColShape ( element theElement, colshape theShape ) createVehicle addCommandHandler and the if, else, elseif statements! you could make a command that spawns a car if they are not in that area with that information.
  7. I need help with figuring out why my War Script wont work, it will only let it be taken over once ( the 1 turf), and i also need help on keeping from more npc's spawning everytime someone enters, i just want it to happen once, when it is being taken over. server local pArea = createRadarArea( -1442.904296875, -971.251953125, 100, 100, 0, 0, 0, 125 ) local pCuboid = createColRectangle( -1442.904296875, -971.251953125, 100, 100 ) BigSmokes = createTeam("Nazis", 255, 0, 255) addEventHandler("onResourceStart",resourceRoot,function() end ) addEventHandler('onColShapeHit', root, function( p ) -- you should have added player param here local pTeam = getPlayerTeam( p ) local iR, iG, iB = getTeamColor( pTeam ) local rR, rG, rB = getRadarAreaColor ( pArea ) if (getPlayerTeam( p )) then if( source == pCuboid ) then if ( iR == rR and iG == rG and iB == rB ) then outputChatBox("Entering Friendly Area!", p, 0, 255, 0) else setElementData( p, "Turfing", true) outputChatBox("You Are Occupying This Land!", p, 255,255,0) setRadarAreaFlashing( pArea, true ) -- source is the col shape, you should use 'p', the player arg local owners = getElementData( pCuboid, "Owner" ) local teamShit = getElementData( pCuboid, "Team" ) if(owners == "Poland")then call(getResourceFromName("slothbot"), "spawnBot", -1428.177734375, -958.3681640625, 200.8858947753, 0, 34, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1430.244140625, -954.5, 200.92562866211, 0, 34, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1425.169921875, -951.3232421875, 201.09375, 0, 34, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1421.9306640625, -966.28125, 200.76762390137, 0, 34, 0, 0, teamShit, 33, "waiting") elseif(owners == "America")then call(getResourceFromName("slothbot"), "spawnBot", -1428.177734375, -958.3681640625, 200.8858947753, 0, 23, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1430.244140625, -954.5, 200.92562866211, 0, 23, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1425.169921875, -951.3232421875, 201.09375, 0, 23, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1421.9306640625, -966.28125, 200.76762390137, 0, 23, 0, 0, teamShit, 33, "waiting") elseif(owners == "Britain")then call(getResourceFromName("slothbot"), "spawnBot", -1428.177734375, -958.3681640625, 200.8858947753, 0, 37, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1430.244140625, -954.5, 200.92562866211, 0, 35, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1425.169921875, -951.3232421875, 201.09375, 0, 37, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1421.9306640625, -966.28125, 200.76762390137, 0, 35, 0, 0, teamShit, 33, "waiting") elseif(owners == "Italy")then call(getResourceFromName("slothbot"), "spawnBot", -1428.177734375, -958.3681640625, 200.8858947753, 0, 33, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1430.244140625, -954.5, 200.92562866211, 0, 33, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1425.169921875, -951.3232421875, 201.09375, 0, 33, 0, 0, teamShit, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1421.9306640625, -966.28125, 200.76762390137, 0, 33, 0, 0, teamShit, 33, "waiting") else call(getResourceFromName("slothbot"), "spawnBot", -1428.177734375, -958.3681640625, 200.8858947753, 0, 311, 0, 0, BigSmokes, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1430.244140625, -954.5, 200.92562866211, 0, 311, 0, 0, BigSmokes, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1425.169921875, -951.3232421875, 201.09375, 0, 311, 0, 0, BigSmokes, 33, "waiting") call(getResourceFromName("slothbot"), "spawnBot", -1421.9306640625, -966.28125, 200.76762390137, 0, 311, 0, 0, BigSmokes, 33, "waiting") end wave1 = setTimer( function() setRadarAreaColor (pArea, iR, iG, iB, 100) outputChatBox( "Congratulations, #FFFF00 you have taken the land!", p, 0, 255, 0, true ) local playersTeam = getElementData ( p, "country" ) setElementData( pCuboid, "Owner", playersTeam ) setRadarAreaFlashing( pArea, false ) setElementData( pCuboid, "Team", pTeam ) if(playersTeam == "Poland")then call(getResourceFromName("slothbot"), "spawnBot", -1404.1083984375, -964.0966796875, 199.4368896484, 0, 34, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1423.859375, -962.6943359375, 200.80470275879, 0, 34, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1421.6552734375, -962.1630859375, 200.76458740234, 0, 34, 0, 0, pTeam, 33, "guarding") elseif(playersTeam == "America")then call(getResourceFromName("slothbot"), "spawnBot", -1404.1083984375, -964.0966796875, 199.4368896484, 0, 23, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1423.859375, -962.6943359375, 200.80470275879, 0, 23, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1421.6552734375, -962.1630859375, 200.76458740234, 0, 23, 0, 0, pTeam, 33, "guarding") elseif(playersTeam == "Britain")then call(getResourceFromName("slothbot"), "spawnBot", -1404.1083984375, -964.0966796875, 199.4368896484, 0, 35, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1423.859375, -962.6943359375, 200.80470275879, 0, 35, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1421.6552734375, -962.1630859375, 200.76458740234, 0, 35, 0, 0, pTeam, 33, "guarding") elseif(playersTeam == "Italy")then call(getResourceFromName("slothbot"), "spawnBot", -1404.1083984375, -964.0966796875, 199.4368896484, 0, 33, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1423.859375, -962.6943359375, 200.80470275879, 0, 33, 0, 0, pTeam, 33, "guarding") call(getResourceFromName("slothbot"), "spawnBot", -1421.6552734375, -962.1630859375, 200.76458740234, 0, 33, 0, 0, pTeam, 33, "guarding") else outputChatBox("Dafuq, you arent in a country..", p) end end, 60000, 1 ) end end end end ) addEventHandler( 'onColShapeLeave', root, function( ) if( source == pCuboid ) then setRadarAreaFlashing( pArea, false ) if isTimer( wave1 ) then setElementData( p, "Turfing", false) killTimer( wave1 ) end end end ) addEventHandler( "onPlayerWasted", getRootElement( ), function() yesorno = getElementData( p, "Turfing") if(yesorno) then setRadarAreaFlashing( pArea, false ) if isTimer( wave1 ) then setElementData( p, "Turfing", false) killTimer( wave1 ) end end end )
  8. I didnt mean for you! It was for him, he seemed to be kinda, non informed
  9. Please reade the replys before replying, this has been solved, and thats not what he wanted
  10. Just in case you didnt understand this, you must trigger a server side event to take his money, or the money part is pointless
  11. Yes, use this resource since you most likely dont know lua : https://community.multitheftauto.com/ind ... ls&id=2852
  12. No, you can not. As far as i am aware.
  13. Ah, you mean like, element data? The class , element data? If so function checkUser( playerargument ) class = getElementData( playerargument, "Class") -- replace playergument with the player agument you used. if ( class == "ClassNameToCheck" ) then -- change "ClassNameToCheck" to the class you want to check end end Untested but thats the general idea.
  14. Well if anyone can help me out a bit with events and functions i could use thatd be great! Im looking as i type this
  15. I was tired when i wrote that, what i am asking is if there is a way to have more than 1 tank, like, is it possible to script tank controls over a car, as ive seen it on SAES:RPG, and if you know how, tell me. As i need multiplle for my WW2 RP/War server..
  16. Is it possible to have two tanks, with working turrets? Like, is there a way to script the SWAT truck to shoot missles instead of water, and replace that with a tank? If so can you help me out with how.
  17. Ok, so i am trying to create a panel for the player that enteres the marker , and let him accept the job, and get the team, etc. It comes up for everyone everytime, and i know this is a noob question, but can someone help me? client GUIEditor = { memo = {}, button = {}, label = {}, window = {}, } windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) guiWindowSetSizable(windowjob9, false) SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) guiSetFont(GUIEditor.label[1], "sa-gothic") SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) guiSetFont(SwatButton, "sa-header") guiSetVisible(windowjob9, false) local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) function Medicjob9(hitElement) if getElementType(hitElement) == "player" then if not guiGetVisible(windowjob9) then guiSetVisible(windowjob9, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker7, Medicjob9) function Medicjobleave9(leaveElement) if getElementType(leaveElement) == "player" then if guiGetVisible(windowjob9) then guiSetVisible(windowjob9, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) function joinTeam9() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob9, false) showCursor(false) end addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false) server SwatTeam = getTeamFromName ( "SWAT" ) function joinSWAT() setPlayerTeam(source,PoliceTeam) setElementModel(source,285) giveWeapon ( source, 31, 500, false ) giveWeapon ( source, 25, 100, false ) giveWeapon ( source, 23, 1, false ) giveWeapon ( source, 24, 100, false ) setElementData( source, "Occupation", "SWAT", true ) outputChatBox("You now have your SWAT Gear! Move Out!.",source,0,255,0) end addEvent("setSWAT", true) addEventHandler("setSWAT",root,joinSWAT)
  18. So i know i didnt think this through, but how can i make my script not bug when more than 1 person is using it? They are suppose to do /startfishing or whatever the command is ( i am constantly changing it ), and it randomly picks a time til they get paid, how much they get paid, but i dont know how to keep that from getting bugged. Server showFishignArea = createRadarArea ( 3122.1650390625, -2894.99829, 10000, 10000, 0, 255, 255, 100 ) fishingArea = createColRectangle ( 3122.1650390625, -2894.99829, 10000, 10000 ) fishingAllowed = nil local fishTimes = { {4000}, {4000}, {4000}, {4000}, {6000}, {8000}, {8000}, {8000}, {8000}, {8000}, {8000}, {8000}, {8000}, {10000}, {10000}, {10000}, {10000}, {10000}, {2000}, {2000}, {2000}, {2000}, {2000}, {2000}, {12000}, {12000}, {12000}, {12000}, {12000}, {12000}, {12000}, } local fishAmount = { {100}, {100}, {100}, {100}, {100}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {110}, {120}, {120}, {120}, {120}, {120}, {120}, {120}, {120}, {120}, {120}, {120}, {130}, {130}, {130}, {130}, {130}, {130}, {130}, {130}, {130}, {130}, {140}, {150}, {160}, {170}, {180}, {190}, {200} } function unpackTimes() return unpack(fishTimes[math.random(#fishTimes)]) end function unpackAmounts() return unpack(fishAmount[math.random(#fishAmount)]) end addCommandHandler ( "startfish", function(player) fishing = true local timer = unpackTimes() if (getElementData(player, "Class") == "Fisherman") then if (fishingAllowed) then setPedAnimation ( player, "SWORD", "sword_IDLE") payTimer = setTimer( payPlayer, timer, 0 ,player) end end end ) addCommandHandler ( "stopfish", function(player) ---Required Arguments player fishing = false setPedAnimation(player,false) if isTimer(payTimer) then killTimer(payTimer) payTimer = nil end end ) function payPlayer(player) local amount = unpackAmounts() givePlayerMoney( player, amount ) resetTimer ( payTimer ) end addEventHandler ( "onColShapeHit", fishingArea, function( thePlayer ) if getElementType ( thePlayer ) == "player" then fishingAllowed = true end end ) addEventHandler ( "onColShapeLeave", fishingArea, function( thePlayer ) if getElementType ( thePlayer ) == "player" then fishingAllowed = false end end ) --Anti-AFK function afkCancler(player) if (fishing) then outputChatBox("You Have Been Automatically Stopped Recieving Fish To Prevent Afking, Please Do The Command Again To Start Again!!", source) setPedAnimation(source,false) if isTimer(payTimer) then killTimer(payTimer) payTimer = nil end end end setTimer( afkCancler, 600000, 0 ) Mibbit.com Pasted on 2013-01-12 21:55:02
  19. Aha! THe problem was i set the data to Class not class, Thanks guys!
  20. no errors :\ and ye, i triple checked.
×
×
  • Create New...