Jump to content

Sande

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Sande

  1. Hi again I made an unworkable script, and not enough brains anymore .. Could someone is kind to fix this? server GM = 0 function freeroamGM ( thePlayer, matchingDimension ) local playerTeam = getPlayerTeam if ( playerTeam == Freeroam ) then if GM == 0 then setVehicleDamageProof(getPedOccupiedVehicle(player),true) outputChatBox ("GodMode Päällä!", thePlayer, 255, 0, 0) toggleControl ( thePlayer, "fire", false ) setElementData ( thePlayer, "invincible", true ) toggleControl ( thePlayer, "next_weapon", false ) toggleControl ( thePlayer, "previous_weapon", false ) setPlayerWeaponSlot ( thePlayer, 0 ) toggleControl ( thePlayer, "aim_weapon", false ) toggleControl ( thePlayer, "vehicle_fire", false ) toggleControl ( thePlayer, "vehicle_secondary_fire", false ) GM = 1 else toggleControl ( thePlayer, "fire", true ) outputChatBox ("GodMode Pois Päältä!", thePlayer, 255, 0, 0) setVehicleDamageProof(getPedOccupiedVehicle(player),false) toggleControl ( thePlayer, "next_weapon", true ) serElementData ( thePlayer,"incincible", false ) toggleControl ( thePlayer, "previous_weapon", true ) toggleControl ( thePlayer, "aim_weapon", true ) toggleControl ( thePlayer, "vehicle_fire", true ) toggleControl ( thePlayer, "vehicle_secondary_fire", true ) GM = 0 end else outputChatBox ("TEAM:in täytyy olla Freeroam!", thePlayer, 255, 0, 0) end function toggleGM ( source ) local playerTeam = getPlayerTeam if ( playerTeam == freeroam ) then if GM == 0 then outputChatBox ("GM kytkeytyy päälle 10s päästä!", source, 255, 0, 0) setTimer ( freeroamGM, 10000, 1 ) else outputChatBox ("GM kytkeytyy pois 10s päästä!", source, 255, 0, 0) setTimer ( freeroamGM, 10000, 1 ) end else setTimer ( freeroamGM , 50, 1 ) end end end addCommandHandler ( "GM", toggleGM ) --[[addCommandHandler ( "FGM", toggleGM ) addCommandHandler ( "FreeroamGM", toggleGM )--]] client: addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end)
  2. WORKING! Thank you so much )
  3. Working, but message not shows when you got unemployed.
  4. Thats good, but when i die nothing happens if im Army, Police and 6 stars.
  5. The point in this script is if police get six wanted they going to unemployed. But how to make like that? All codes posted on what have not been such.
  6. No errors, but not working. Need some event but what event?
  7. Something is wrong online 6 near ) then (
  8. Hey, i started to make unemploy script, but i am so shit and i dont know why this not working.. can someone do this finish? function unemploy ( thePlayer ) local wlevel = getPlayerWantedLevel( thePlayer ) if wlevel > 6 then --[[ 6 stars --]] theTeam = getPlayerTeam ( thePlayer ) if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then setPlayerTeam(thePlayer,getTeamFromName("Unemployed")) then outputChatBox ("Menetit työsi, koska olet korruptoitunut!, 255, 0, 0, thePlayer ) end --[[ Event ?!?, idk what do next --]]
  9. No errors, its just not give more stars than 2. if i kill 3 times still 2 stars
  10. I am thinking how i can add 1 star pr = 2kill to this system. Now when i kill i get only 1 star, but then kill again and nothing. ** COPS cant get wanted stars if he didn´t start the "fight".** Thaanks. --KILL REWARD PER STAR kreward = 250 --WANTED LEVEL IF A PLAYER IS MURDERED BY A NON-COP, OR IF AN INNOCENT PERSON IS MURDERED BY A COP function aplayerdied( ammo, attacker, weapon, bodypart ) local glevel = getPlayerWantedLevel ( source ) if glevel > 0 then destroyBlipsAttachedTo(source) end if ( attacker ) then local wlevel = getPlayerWantedLevel( source ) if wlevel > 0 then theTeam = getPlayerTeam ( attacker ) if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then setPlayerWantedLevel( source, 0 ) local thisreward = wlevel*kreward givePlayerMoney ( attacker, thisreward ) return end end if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 2 then setPlayerWantedLevel( attacker, wlevel+1 ) if wlevel == 1 then local wblip = createBlipAttachedTo( source, 56 ) end elseif wlevel == 6 then end elseif ( getElementType( attacker ) == "vehicle" ) then thekiller = getVehicleController( attacker ) if ( thekiller ) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 2 then setPlayerWantedLevel( thekiller, wlevel+1 ) if wlevel == 1 then local wblip = createBlipAttachedTo( source, 56 ) end end end end end --[[setPlayerWantedLevel( source, 0 )--]] end addEventHandler ( "onPlayerWasted", getRootElement(), aplayerdied ) --FUNCTION TO CLEAR BLIPS function destroyBlipsAttachedTo(player) if not isElement(player) then return false end local attached = getAttachedElements ( player ) for k,element in ipairs(attached) do if isElement ( element ) and getElementType ( element ) == "blip" then destroyElement ( element ) end end end --WANTED LEVEL IF A POLICE OFFICER IS ATTACKED function assaultinganofficer ( attacker, weapon, bodypart, loss ) theTeam = getPlayerTeam ( source ) if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then if ( attacker ) then if ( getElementType( attacker ) == "player" ) then theTeam = getPlayerTeam ( attacker ) if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then return end elseif ( getElementType( attacker ) == "vehicle" ) then thedriver = getVehicleController( attacker ) if ( thedriver ) then theTeam = getPlayerTeam ( thedriver ) if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then return end end end if (getElementData ( source, "justdamaged" ) ~= "yes") and (source ~= attacker) then setElementData ( source, "justdamaged", "yes" ) local damagereset = setTimer ( resethurt, 20000, 1, source ) if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 1 then setPlayerWantedLevel( attacker, wlevel+1 ) if wlevel == 1 then local wblip = createBlipAttachedTo( source, 56 ) end end elseif ( getElementType( attacker ) == "vehicle" ) then local thekiller = getVehicleController( attacker ) if (thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 1 then setPlayerWantedLevel( thekiller, wlevel+1 ) if wlevel == 1 then local wblip = createBlipAttachedTo( source, 56 ) end end end end end end end end addEventHandler ( "onPlayerDamage", getRootElement(), assaultinganofficer ) function resethurt(source) if (source) then setElementData ( source, "justdamaged", nil ) end end --WANTED LEVEL IF SOMEONE OTHER THAN A COP JACKS SOMEONE function carjackcheck(theVehicle, seat, jacker) if (jacker) then theTeam = getPlayerTeam ( jacker ) if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then return end local wlevel = getPlayerWantedLevel( jacker ) if wlevel < 2 then setPlayerWantedLevel( jacker, wlevel+1 ) if wlevel == 1 then local wblip = createBlipAttachedTo( jacker, 56 ) end end end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), carjackcheck ) --WANTED LEVEL IF NON-COP TRIES TO USE A COP CAR function copcarcheck(theVehicle, seat, jacked) theTeam = getPlayerTeam ( source ) if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Army" then return else local carid = getVehicleID( theVehicle ) if carid == 598 or carid == 596 or carid == 597 or carid == 427 then local wlevel = getPlayerWantedLevel( source ) if wlevel < 2 then setPlayerWantedLevel( source, wlevel+1 ) end end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), copcarcheck ) --STUFF TO MAKE BRIBE PICKUPS WORK function pickedUpWantedCheck ( player ) if isElement ( source ) and ( getElementType(source) == "pickup" ) then if getPickupType ( source ) == 3 then if (getElementData ( source, "model" ) == "1247" ) then local level = getPlayerWantedLevel(player) if ( level > 0 ) then setPlayerWantedLevel ( player, level-1 ) if ( level == 1 ) then destroyBlipsAttachedTo(player) end end end end end end addEventHandler ( "onPickupHit", getRootElement(), pickedUpWantedCheck )
  11. Hey, I am thinking right now is there someway to place plug.dj to a car radio? If you know how can set plug.dj to radio tell me.
  12. Can someone fix this? getPlayerTeam doens´t working. IDK why. function hit ( pla, dim, hitElement ) if getElementType ( pla ) == "player" then local vehicle = getPedOccupiedVehicle ( pla ) if vehicle or not vehicle then local armyTeam = getTeamFromName ( "Army" ) if ( armyTeam ) then outputChatBox ( "Tervetuloa valtion alueelle, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Valtion Tukikohta***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." on astunut valtion tukikohtaan, Ohjukset on laukaistu!", g_root, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit )
  13. Working, thanks , can you tell how i can make like: Player Sande logged in, and logget out?
  14. Can someone make this code work, im starter and i dont know how make it work. Thaanks. addEventHandler ( "onClientPlayerChangeNick", root, function ( oldNick, newNick ) nickData = "* " .. oldNick .. " is now known as " .. newNick .. "." exports["drawData"]:outputDraw ( nickData, 255, 100, 100, false ) end ) addEventHandler ( "onClientPlayerJoin", root, function ( thePlayer ) onlineData = "* " .. Online Players: .. getElementsByType('player')) .. "." exports["drawData"]:outputDraw ( onlineData, 255, 100, 100, false ) end ) addEventHandler ( "onClientPlayerQuit", root, function ( thePlayer ) onlineData = "* " .. Online Players: .. getElementsByType('player')) .. "." exports["drawData"]:outputDraw ( onlineData, 255, 100, 100, false ) end )
  15. Drug system with Sell, and make functions. and effects when use etc. It will be useful.
  16. Thank you, Solidsnake
  17. Hey, i started to make little digital speedo meter addon to my big speedometer. Im starter in script so i dont know what i need to do now. No errors. Only the KM/h text not opening when are inside car. Thanks if you help addEventHandler("onClientResourceStart", resourceRoot, function() end ) function autonTila ( ) if isPedInVehicle (localPlayer) then sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer) speed = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) dxDrawText("Speed: "..tostring(speed).."KM/h", 1493, 839, 1550, 856, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) end function StopTheRender ( ) removeEventHandler ( "onClientRender", root, autonTila ) end addEventHandler("onClientVehicleExit", root, StopTheRender) addEventHandler("onClientRender", root, function() dxDrawText("Speed: "..tostring(speed).."KM/h", 1493, 839, 1550, 856, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, true, false, false) end )
  18. Can someone fix this?, thanks. function cursori () local player = getPlayerName(getLocalPlayer()) if ( player ) then showcursor ( player, true ) if isCursorShowing ( player ) then outputChatBox ( "#Pelaamisesi on estetty" ) end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), cursori)
  19. Whats the small names for these: SF police car = ? LS police car = ? LV police car = ? like copcarlv <- But not work.
  20. Hey, i started to make Wanted computer, but im new in scripting so i dont know how i can code action for gridlist & button. Please help!, thank you!! GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(608, 340, 407, 330, "Police Computer", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(10, 29, 387, 228, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Player", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "Stars", 0.3) guiGridListAddColumn(GUIEditor.gridlist[1], "Kills", 0.3) GUIEditor.button[1] = guiCreateButton(367, -22, 20, 15, "", false, GUIEditor.gridlist[1]) GUIEditor.button[2] = guiCreateButton(142, 277, 110, 38, "Close", false, GUIEditor.window[1]) end )
  21. This is works, but the message shows everyone, i wanna it for team, if team Police, then this message show only police. function teamPayday( src) local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do if getTeamName(getPlayerTeam(value)) == "Police" then givePlayerMoney ( value, 2000 ) end outputChatBox (" ------Police-bonus------ ", value, src, 255, 255, 255, false) outputChatBox ("|--------------------------|", value, src, 0, 100, 180, false) outputChatBox ("+2000$", value, src, 0, 255, 0, false) outputChatBox ("|--------------------------|", value, src, 0, 100, 180, false) end end function onResourceStart(thisResource) setTimer ( teamPayday, 990000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart )
  22. Hey, i try to make payday for only team. How i can code the message only for the team, can someode code it? if there are something wrong please fix it thaanks Im new in scripting. - Sande ----Sande function teamPayday() local allPlayers = getElementsByType("player") for index,value in ipairs(allPlayers) do if getTeamName(getPlayerTeam(value)) == "Police" then givePlayerMoney ( value, 2000 ) end outputChatBox (" ------Police-bonus------ ", value, 255, 255, 255, false) outputChatBox ("|--------------------------|", value, 0, 100, 180, false) outputChatBox ("+2000$", value, 0, 255, 0, false) outputChatBox ("|--------------------------|", value, 0, 100, 180, false) end end function onResourceStart(thisResource) setTimer ( teamPayday, 990000, 0 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onResourceStart )
×
×
  • Create New...