Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. xXMADEXx

    Blips

    How can i make this blip, only visible to the player who spawned it? vehicle = createVehicle (carID, 1045.5615234375, -898.580078125, 42.75, 0, 0, 90) createBlipAttachedTo(vehicle, 41, 2, 0, 255, 0)
  2. Hey guys, im trying to make my edit only allow numbers 0-9, but not really any luck. The text to show that you're only allowed to use 0-9 will work, but it won't cancel the event. addEventHandler("onClientGUIChanged",root, function () if source == rog_modshop_colors_edit_red then local t = tonumber(guiGetText(rog_modshop_colors_edit_red)) if (t=="1") then else outputChatBox("Modshop: You are only allowed to use 3 characters, of 0-9",255,0,0) cancelEvent() end end end )
  3. When i downloaded the community leagalsystem, nothing happends when i hit the player with a night stick. -- Arrest server kingCOP = createElement( "Pgroup", "cops" ) kingCIV = createElement( "Pgroup", "civs" ) kingNONE = createElement( "Pgroup", "none" ) function legalstartup(startedresource) if startedresource == getThisResource() then WantedWatch = setTimer (wantedlevelmonitor, 1000, 0) local allplayers = getElementsByType ( "player" ) local detectmethod = get("legalsystem.Copmethod") for playerKey,thePlayer in ipairs(allplayers) do if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(thePlayer) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(thePlayer) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( thePlayer, kingCOP ) else setElementParent ( thePlayer, kingCIV ) end end end end end addEventHandler( "onResourceStart", getRootElement(), legalstartup) function copSpawnCheck() local detectmethod = get("legalsystem.Copmethod") if detectmethod == "team" then local copteam = get("legalsystem.Copteam") local thisTeam = getPlayerTeam(source) if thisTeam ~= false then if thisTeam == getTeamFromName(copteam) then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end elseif detectmethod == "skin" then local thisSkin = getPedSkin(source) setElementData(getRootElement(),"Copskins",get("legalsystem.Copskins")) local copskins = getElementData(getRootElement(),"Copskins") if type(copskins) == "table" and #copskins > 0 then for k,skinID in ipairs(copskins) do copskins[skinID] = true end end local isacop = 0 for ElementKey, ElementValue in ipairs ( copskins ) do if thisSkin == ElementValue then isacop = 1 end end if isacop == 1 then setElementParent ( source, kingCOP ) else setElementParent ( source, kingCIV ) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), copSpawnCheck ) --ARREST PLAYERS BY SMACKING WITH A NIGHTSTICK function rodneykingcheck ( attacker, weapon, bodypart, loss ) if (attacker) and (weapon == 3) then if getElementParent(attacker) == kingCOP then local thecop = attacker local theprisoner = source local wlevel = getPlayerWantedLevel( source ) if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest") and (wlevel > 0) then if (getElementData ( attacker, "currentarrests" ) ~= "single" ) and (getElementData ( attacker, "currentarrests" ) ~= "double" ) then setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) elseif (getElementData ( attacker, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( source, true ) toggleAllControls ( source, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end addEventHandler ( "onPlayerDamage", getRootElement(), rodneykingcheck ) --ARREST PLAYERS BY HOLDING THEM AT GUNPOINT IF THEY HAVE LOW HP function sightscheck ( element ) if isElement(element) then if ( getElementType ( element ) == "player" ) then if ( getControlState ( source, "aim_weapon" ) ) then local currentgun = getPlayerWeapon ( source ) local wlevel = getPlayerWantedLevel( element ) if (currentgun > 19) and (currentgun < 39) and (wlevel > 0) then if getElementParent(source) == kingCOP then local thecop = source local theprisoner = element local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getElementHealth ( element ) < 15 ) and ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 3 ) then if (getElementData ( theprisoner, "currentstatus" ) ~= "underarrest" ) then if (getElementData ( thecop, "currentarrests" ) ~= "single" ) and (getElementData ( thecop, "currentarrests" ) ~= "double" ) then triggerClientEvent(thecop,"copdirections",thecop) setElementData ( thecop, "currentarrests", "single" ) elseif (getElementData ( thecop, "currentarrests" ) == "single" ) then setElementData ( thecop, "currentarrests", "double" ) end setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) -- local arresttoolong = setTimer ( freetheguy, 180000, 1, theprisoner ) end end end end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), sightscheck ) --ARREST PLAYERS BY PULLING THEM OUT OF A VEHICLE function yankhimout(player, seat, jacker) if isElement(jacker) then if getElementParent(jacker) == kingCOP then local wlevel = getPlayerWantedLevel( player ) if wlevel > 0 then if (getElementData ( jacker, "currentarrests" ) ~= "single" ) and (getElementData ( jacker, "currentarrests" ) ~= "double" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "single" ) triggerClientEvent(thecop,"copdirections",thecop) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) elseif (getElementData ( jacker, "currentarrests" ) == "single" ) then local thecop = jacker local theprisoner = player setElementData ( theprisoner, "currentstatus", "underarrest" ) setElementData ( theprisoner, "captor", thecop ) setElementData ( thecop, "currentarrests", "double" ) showCursor ( theprisoner, true ) toggleAllControls ( theprisoner, false, true, false ) walktheprisoner ( thecop, theprisoner ) setElementData ( theprisoner, "arrestTimeout", setTimer ( freetheguy, 180000, 1, theprisoner )) end end end end end addEventHandler ( "onVehicleExit", getRootElement(), yankhimout ) --FORCES A PRISONER TO FOLLOW THE COP function walktheprisoner(thecop, theprisoner) if (getElementData ( theprisoner, "currentstatus" ) == "underarrest") and (getPedOccupiedVehicle ( theprisoner ) == false ) then local copx, copy, copz = getElementPosition ( thecop ) local prisonerx, prisonery, prisonerz = getElementPosition ( theprisoner ) copangle = ( 360 - math.deg ( math.atan2 ( ( copx - prisonerx ), ( copy - prisonery ) ) ) ) % 360 setPedRotation ( theprisoner, copangle ) setCameraTarget ( theprisoner, theprisoner ) local dist = getDistanceBetweenPoints2D ( copx, copy, prisonerx, prisonery ) if ( dist > 16 ) then freetheguy ( theprisoner ) --FREES PRISONER IF HE GETS FAR AWAY elseif ( dist > 12 ) then setControlState ( theprisoner, "sprint", true ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 6 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist > 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", true ) setControlState ( theprisoner, "forwards", true ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) elseif ( dist < 1.5 ) then setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) local zombify = setTimer ( walktheprisoner, 500, 1, thecop, theprisoner ) end end end --FREES A PLAYER (RESETS THEIR CONTROLS AND STATUS) function freetheguy (theprisoner) local thecaptor = (getElementData ( theprisoner, "captor" )) setElementData ( theprisoner, "currentstatus", "none" ) setElementData ( theprisoner, "captor", "none" ) showCursor ( theprisoner, false ) setControlState ( theprisoner, "sprint", false ) setControlState ( theprisoner, "walk", false ) setControlState ( theprisoner, "forwards", false ) toggleAllControls (theprisoner, true) local prisonercheck = setTimer ( checkforprisoners, 1500, 1, thecaptor ) TimoutTimer = (getElementData ( theprisoner, "arrestTimeout" )) if isTimer(TimoutTimer) then killTimer(TimoutTimer) setElementData ( theprisoner, "arrestTimeout", nil) TimeoutTimer = nil end end function checkforprisoners(thecop) if isElement(thecop) then local prisoners = 0 local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do if (getElementData ( thePlayer, "captor" ) == thecop ) then prisoners = prisoners+1 end end if prisoners == 0 then setElementData ( thecop, "currentarrests", "none" ) triggerClientEvent( thecop,"clearcopdirections",thecop) elseif prisoners == 1 then setElementData ( thecop, "currentarrests", "single" ) elseif prisoners == 2 then setElementData ( thecop, "currentarrests", "double" ) end
  4. I tried this, but it didn't work. setTimer( function () setPedGravity ( source, 50 ) outputChatBox("The crack time has ended.",source,255,255,0) if isTimer(timer) then killTimer(timer) end end ,5000,0)
  5. I don't know how to destroy the timer so "The crack time has ended" spams. function crack(player) if (not isPedInVehicle(player)) then outputChatBox("you're jump height has been set to double.",player,0,255,0) setTimer( function () setPedGravity ( source, 50 ) outputChatBox("The crack time has ended.",source,255,255,0) end ,5000,0) else outputChatBox("You cannot use crack in a vehicle.",player,255,0,0) end end addCommandHandler("crack",crack)
  6. Hey guys, i got the notification bar from GUI-editor (thank you, Remp.) But, when i tried to use it, no luck. Any probs seen below, please comment. gColours = { primary = {255, 69, 59, 255}, secondary = {255, 118, 46, 255}, tertiary = {232, 42, 104, 255}, defaultLabel = {255, 255, 255}, grey = {120, 120, 120}, } ContextBar = { height = 28, speed = 20, step = 2, life = 8000, update = 0, textColour = {unpack(gColours.primary)}, lineColour = {0, 0, 0}, entries = {} } function ContextBar.add(text) if not gEnabled then return end local y = gScreen.y - ContextBar.height if #ContextBar.entries > 0 then if ContextBar.entries[#ContextBar.entries].text == text then return end y = ContextBar.entries[#ContextBar.entries].y - ContextBar.height end local pixelsPerSecond = (1000 / ContextBar.speed) * ContextBar.step local alphaStep = (gScreen.y - y - ContextBar.height) / pixelsPerSecond ContextBar.entries[#ContextBar.entries + 1] = { text = text, creation = getTickCount(), y = y, landed = false, alphaStep = alphaStep == 0 and 0.05 or (1 / ((alphaStep * 1000) / ContextBar.speed)), alpha = alphaStep == 0 and 1 or 0, } end addEventHandler("onClientRender", root, function() for _,bar in ipairs(ContextBar.entries) do dxDrawRectangle(0, bar.y, gScreen.x, ContextBar.height, tocolor(0, 0, 0, math.lerp(0, 170, bar.alpha)), true) dxDrawText(bar.text, 0, bar.y, gScreen.x, bar.y + ContextBar.height, tocolor(ContextBar.textColour[1], ContextBar.textColour[2], ContextBar.textColour[3], math.lerp(0, 255, bar.alpha)), 1, "default-bold", "center", "center", true, true, true) dxDrawLine(0, bar.y, gScreen.x, bar.y, tocolor(ContextBar.lineColour[1], ContextBar.lineColour[2], ContextBar.lineColour[3], math.lerp(0, 255, bar.alpha)), 1, true) end local tick = getTickCount() if tick > (ContextBar.update + ContextBar.speed) then ContextBar.update = tick if #ContextBar.entries > 1 then for i = #ContextBar.entries, 1, -1 do if ContextBar.entries[i].y > gScreen.y then table.remove(ContextBar.entries, i) else ContextBar.entries[i].alpha = math.min(1, ContextBar.entries[i].alpha + ContextBar.entries[i].alphaStep) ContextBar.entries[i].y = ContextBar.entries[i].y + ContextBar.step if i ~= 1 and #ContextBar.entries == 2 and ContextBar.entries[i].y > (gScreen.y - ContextBar.height) then ContextBar.entries[i].y = gScreen.y - ContextBar.height end end end elseif #ContextBar.entries == 1 then if not ContextBar.entries[1].landed then ContextBar.entries[1].landed = true ContextBar.entries[1].creation = tick end if tick > (ContextBar.entries[1].creation + ContextBar.life) then ContextBar.entries[1].alpha = ContextBar.entries[1].alpha - ContextBar.entries[1].alphaStep if ContextBar.entries[1].alpha <= 0 then ContextBar.entries[1] = nil end end end end end ) function add() ContextBar.add("Basic Testing.") end addCommandHandler("test",add)
  7. In this video tutorial, you will learn how to make a /car [id] command for video.
  8. Next video's guys, i will add more details and effort.
  9. Well, how can i make it?
  10. K, i got this fixed, but i'm not sure what function to use to make the source follow the attacker. function arrest ( attacker, weapon, bodypart, loss ) local job = getTeamName(getPlayerTeam(attacker)) local wanted = getPlayerWantedLevel(source) if (source) and (getElementType(source) == "player") and (weapon == 3) then if (job=="Swat") or (job=="Military") or (job=="Police") or (job=="FBI") then if wanted > 0 then showCursor(source, true) end end end end addEventHandler("onPlayerDamage",root,arrest)
  11. Thanks, but what is the function to make the source follow the attacker?
  12. I have made this script: function arrest(weapon, _, _, _, _, _, hitElement) local job = getElementData(source,"Job") if (hitElement) and (getElementType(hitElement) == "player") and (weapon == 3) then if (job=="Swat") or (job=="Military") or (job=="Police") or (job=="FBI") then showCursor(hitElement, true) end end end addEventHandler("onPlayerDamage",root,arrest) but it won't work, and nothing will show in debugscript...
  13. How can i make it, so that when a player gets hit that they follow the police officer when they get hit? Or, like how can i make it so that they have no control over they player, and the player follows the other player.
  14. I tried this, but error on line 5, and im not sure what it is. setTimer( function (player) local wanted = getPlayerWantedLevel(player) local x,y,z = getElementPosition(player) if (wanted <= 0) then destroyElement(obj) elseif (wanted >= 0) then obj = createObject(1247,x,y,z) attachElements(obj,player,0,0,1.5) end end,1000,1)
  15. Hey all, i made this simple code, but i am not sure what event handler to put in to make the wanted star create. function lvl(player) local wanted = getPlayerWantedLevel(player) local x,y,z = getElementPosition(player) if wanted >= 0 then obj = createObject(2147,x,y,z) attachElements(obj,player,0,0,1.2) elseif wanted <= 0 then destroyElement(obj) end end addEventHandler("?????",lvl)
  16. Hey, I'm making a VIP GUI panel, but i cannot get triggerServerEvent to work (go figure) any help? --client triggerServerEvent("rog:vip:gui:player:health",localplayer) --server addEvent("rog:vip:gui:player:health",true) addEventHandler("rog:vip:gui:player:health",root, function () setElementHealth(source,100) end )
  17. radios = { {"Hot 108 Jamz","http://scfire-dtc-aa01.stream.aol.com:80/stream/1038"} } The url is the second part, "http://scfire-dtc-aa01.stream.aol.com:80/stream/1038"
  18. Make it so that when, you click an option in the GUI that it will start to play the link.
  19. Hey guys, im making a GUI radio system, and i cannot get this script to work. I tried to edit the script, from another script i have, but cannot get it, any advice? radios = { {"Hot 108 Jamz","http://scfire-dtc-aa01.stream.aol.com:80/stream/1038"} } function use2() local row, col = guiGridListGetSelectedItem(rog_ucp_radio_grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(rog_ucp_radio_grid, row, 1)) if model ~= "" then playSound(row, col) end end end addEventHandler("onClientGUIClick", rog_ucp_radio_button_stream, use2, false)
×
×
  • Create New...