-
Posts
153 -
Joined
-
Last visited
Everything posted by Lucario
-
A que tipo de columnas te refieres? gridlist de un panel?
-
Prueba asi: Editado: le quite el local, a ver si es lo que dice alexs addEventHandler( "onClientResourceStart", resourceRoot, function() bindKey("fire", "down", theGoggle) local r,g,b,a = getBlipColor(blip) setBlipColor(blip,r,g,b,0) end end ) function theGoggle() local weaponID = getPedWeapon (getLocalPlayer ()) if weaponID == 44 then setTimer (playerGoggles, 50, 0 ) end end function playerGoggles() if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_ON" ) then local r,g,b,a = getBlipColor(blip) setBlipColor(blip,255,g,b,255) end end if isPedDoingTask ( getLocalPlayer (), "TASK_SIMPLE_GOGGLES_OFF" ) then local r,g,b,a = getBlipColor(blip) setBlipColor(blip,r,g,b,0) end end end addEventHandler( "onClientResourceStop", resourceRoot, function() unbindKey("fire", "down", theGoggle) end ) addEventHandler("onClientPlayerWasted", localPlayer, function () local r,g,b,a = getBlipColor(blip) setBlipColor(blip,r,g,b,0) end end ) addEventHandler("onClientPlayerSpawn", localPlayer, function () local r,g,b,a = getBlipColor(blip) setBlipColor(blip,r,g,b,0) end end ) In ipairs significa multitud, eso he leido yo.
-
now it give me bad argument, setelement or getelement data got number, i cant see the line, but i cant arrest anyone and im in the team
-
yes in the other side
-
thank you solid, now it works , can you add me to skype please? multikiller18, i speak spanish
-
Hi, i have the Legalsystem from the community edited and fixed, i keep the rights of the autors, but when im the cop, i cannot arrest anyone, and anyone cannot arrest me, idk what is the error, here is the server side (edited): 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 = getPedWeapon ( 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 > 40 ) then freetheguy ( theprisoner ) end 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 --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
-
Im trying to draw a text upside my head when the godmode is enabled, and when a player hit me or shoot me, and slap him 8 hp
-
anyone??
-
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) addEventHandler( 'onClientRender', root, function () for _, player in ipairs( getElementsByType( 'player')) do if getElementData(player,"invincible") then local x, y, z = getElementPosition( player ); local cx, cy, cz = getCameraMatrix( ); if getDistanceBetweenPoints3D( cx, cy, cz, x, y, z ) <= 15 then local px, py = getScreenFromWorldPosition( x, y, z + 1.3, 0.06 ); if px then dxDrawText( 'Pegame Otra Vez y Te Pateare el Culo', px, py, px, py, tocolor( 255, 255, 255, 255 ), 1, "arial-bold", "center", "center", false, false, false , true ) setElementHealth (player, -8) end end end end end) I changed source to player? now?
-
addEventHandler ( "onClientPlayerDamage",root,function () if (getElementData(getLocalPlayer(),"invincible") == "true") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), function () if (getElementData(getLocalPlayer(),"invincible") == "true") then cancelEvent() end end) addEventHandler( 'onClientRender', root, function () for _, player in ipairs( getElementsByType( 'player')) do if getElementData(source,"invincible") then local x, y, z = getElementPosition( player ); local cx, cy, cz = getCameraMatrix( ); if getDistanceBetweenPoints3D( cx, cy, cz, x, y, z ) <= 15 then local px, py = getScreenFromWorldPosition( x, y, z + 1.3, 0.06 ); if px then dxDrawText( 'Pegame Otra Vez y Te Pateare el Culo', px, py, px, py, tocolor( 255, 255, 255, 255 ), 1, "arial-bold", "center", "center", false, false, false , true ) setElementHealth (player, -8) end end end end end) Now it not give errors, but the message dont shows in the head of the staff and not display when a player shoot me, and i changed getelementhealth to setelementhealth (my error ) but the health not be get
-
I alredy said, i dont know why i put targetPlayer, and what event handler i must use and replace the onClientPlayerDamage?
-
Anyone???
-
D: can you fix it please, i just leorn lua, but pro in other programation, i say after the targetPlayer i mistaked, but i dont know what put there, and on onclientplayerdamage is client side bro
-
Sure, here is the full code of the server side. 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) addEventHandler( 'onClientRender', root, function (targetPlayer) for _, player in ipairs( getElementsByType( 'player')) do local x, y, z = getElementPosition( player ); local cx, cy, cz = getCameraMatrix( ); if getDistanceBetweenPoints3D( cx, cy, cz, x, y, z ) <= 15 then local px, py = getScreenFromWorldPosition( x, y, z + 1.3, 0.06 ); if px then dxDrawText( 'Pegame Otra Vez y Te Pateare el Culo', px, py, px, py, tocolor( 255, 255, 255, 255 ), 1, "arial-bold", "center", "center", false, false, false , true ) getElementHealth (player, -8) addEventHandler("onClientPlayerStealthKill", player, targetPlayer) end end end end) I think i was wrong in the targetPlayer, i use setelementhealth -8 for if the attacker attack me with a weapon or without, he rest -8 of health, and show him the message up of the staff head
-
Hello, i need a help, when i created a new function for the godmode, with dxdrawtext in client side, it give me a error, addeventhandler expected argument and argument 3 got nil, line 27, the code with the problem. addEventHandler( 'onClientRender', root, function (targetPlayer) for _, player in ipairs( getElementsByType( 'player')) do local x, y, z = getElementPosition( player ); local cx, cy, cz = getCameraMatrix( ); if getDistanceBetweenPoints3D( cx, cy, cz, x, y, z ) <= 15 then local px, py = getScreenFromWorldPosition( x, y, z + 1.3, 0.06 ); if px then dxDrawText( 'Dont attack me again, or i will punish you', px, py, px, py, tocolor( 255, 255, 255, 255 ), 1, "arial-bold", "center", "center", false, false, false , true ) getElementHealth (player, -8) addEventHandler("onClientPlayerStealthKill", player, targetPlayer) end end end end)
-
Oh im sorry, here is the code, im realy sorry Server Side: afText = {} myTextItem = {} function warnText ( aWText, player ) if ( myTextItem[player] ) then textDestroyTextItem ( myTextItem[player]) end afText[player] = textCreateDisplay () textDisplayAddObserver( afText[player], player ) myTextItem[player] = textCreateTextItem ( aWText, 0.22, 0.8,0.5 , 255, 0, 0, 255, 3 ) textDisplayAddText ( afText[player], myTextItem[player] ) -- outputChatBox ( textA, player ) setTimer ( textDestroyTextItem, 5000, 1, myTextItem[player], player ) end createBlip ( 1552.4996337891, -1677.3264160156, 15.1953125, 30 ) createBlip ( -1604.5458984375, 712.25848388672, 12.8671875, 30 ) createBlip ( 2340.9245605469, 2456.0463867188, 13.96875, 30 ) function createSAPDTeam () SAPDteam = createTeam ("Policia", 100, 149, 237) end addEventHandler ("onResourceStart", resourceRoot, createSAPDTeam) function joinSAPD(id) setPlayerTeam(source,SAPDteam) setPlayerNametagColor ( source, 100, 149, 237 ) setElementModel(source, id) giveWeapon ( source, 3 ) playeraccount = getPlayerAccount( source ) setAccountData( playeraccount, "team", "police", true ) warnText("Ahora Eres un Policia.",source,0,255,0) end addEvent("getJob", true) addEventHandler("getJob",root,joinSAPD) function removeSAPD() setPlayerTeam(source, Civil) takeWeapon(source, 3) playeraccount = getPlayerAccount(source) if not getAccountData(playeraccount, "standardskin") then setElementModel(source, 0) else setElementModel(source,getAccountData(playeraccount,"standardskin")) end warnText("Ahora Eres un Civil.",source,255,0,0) end addEvent("removeSAPD", true) addEventHandler("removeSAPD",root,removeSAPD) function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Ejercito" then setElementPosition (source, 3306.1, 1195.7, 945, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) warnText( "Has Sido Encarcelado Por "..theCop.. ".", source ) warnText( "Has Encarcelado a "..theName, attacker ) local playeraccount = getPlayerAccount ( attacker ) oldArrest = getAccountData(playeraccount, "arrest") if oldArrest then newArrest = setAccountData(playeraccount, "arrest", tonumber(oldArrest) + 1 ) else newArrest = setAccountData(playeraccount, "arrest", 1 ) end setPlayerWantedLevel (source, 0) if theWL > 1 then setTimer ( setElementPosition, 20000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 3000 * theWL ) elseif theWL > 2 then setTimer ( setElementPosition, 40000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 6000 * theWL ) elseif theWL > 3 then setTimer ( setElementPosition, 60000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 9000 * theWL ) elseif theWL > 4 then setTimer ( setElementPosition, 80000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 12000 * theWL ) elseif theWL > 5 then setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 15000 * theWL ) elseif theWL > 6 then setTimer ( setElementPosition, 120000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 18000 * theWL ) end end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) function consoleCreateMarker ( source ) local playerAccount = getPlayerAccount(source) local arrest = getAccountData(playeraccount, "arrest") if not arrest then outputChatBox("No Tienes Ningun Arresto",source) else outputChatBox("Arrestos: "..arrest,source) end end addCommandHandler ( "arrestos", consoleCreateMarker ) function freezeWeapon (attacker, attackerweapon, bodypart, loss) if attacker and attacker ~= source and theTeam2 and getElementType(attacker) == "player" then theTeam2 = getPlayerTeam ( attacker ) theWL2 = getPlayerWantedLevel ( source ) theSkin2 = getElementModel ( attacker ) if (attackerweapon == 23) and (loss > 1) and (theWL2 > 0) then if getTeamName( theTeam2 ) == "Policia" or getTeamName( theTeam2 ) == "SWAT" or getTeamName( theTeam2 ) == "FBI" or getTeamName( theTeam2 ) == "Ejercito" then fadeCamera ( source, true, 2.0, 191, 191, 191 ) setTimer ( setElementFrozen, 3000, 1, source, false) end end end end addEventHandler ("onPlayerDamage", getRootElement(), freezeWeapon) Client Side: local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local markerp = createMarker( 1552.4996337891, -1677.3264160156, 15.1953125, 'Cylinder', 1.5, 0, 0, 255, 150 ); local marker1p = createMarker( -1604.5458984375, 712.25848388672, 12.8671875, 'Cylinder', 1.5, 0, 0, 255, 150 ); local marker2p = createMarker( 2340.9245605469, 2456.0463867188, 13.96875, 'Cylinder', 1.5, 0, 0, 255, 150 ); addEventHandler ( 'onClientRender', root, function ( ) -- local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( markerp ); local x2, y2, z2 = getElementPosition ( marker1p ); local x3, y3, z3 = getElementPosition ( marker2p ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance_2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); local distance_3 = getDistanceBetweenPoints3D( x, y, z, x3, y3, z3 ); -- -- Marker #1 if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "Trabajo de Policia", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end -- Marker #2 elseif distance_2 <= gMaxDistance then local x2_, y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ); if x2_ and y2_ then -- local scale = 1 / ( gScale * ( distance_2 / gMaxDistance ) ); local alpha = ( ( distance_2 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "Trabajo de Policia", x2_, y2_, x2_, y2_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end -- Marker #3 elseif distance_3 <= gMaxDistance then local x3_, y3_ = getScreenFromWorldPosition( x3, y3, z3 + 0.95, 0.06 ); if x3_ and y3_ then -- local scale = 1 / ( gScale * ( distance_3 / gMaxDistance ) ); local alpha = ( ( distance_3 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); -- dxDrawText( "Trabajo de Policia", x3_, y3_, x3_, y3_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end ); function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end Wnd = guiCreateWindow ( 0.2, 0.2, 0.50, 0.60, "Trabajo de Policia Version Full", true ) guiSetAlpha( Wnd, 1 ) button = guiCreateButton ( 0.5, 0.8, 0.45, 0.15, "Cerrar", true, Wnd ) button1 = guiCreateButton ( 0.01, 0.8, 0.45, 0.15, "Escoger Trabajo", true, Wnd ) label = guiCreateLabel ( 0.05, 0.1, 0.9, 0.2, "Los Policias Pueden Arrestar Criminales \nPegandoles 3 Veces con la Porra.", true, Wnd ) showCursor(false) guiSetVisible( Wnd, false ) guiWindowSetSizable( Wnd, false ) guiWindowSetMovable( Wnd, false ) skins = { {"Policia 1", 280}, {"Policia 2", 281}, {"Ranger 1", 283}, {"Ranger 2", 288}, {"Vigilante de Trafico", 284}, } skinG = guiCreateGridList(0.01, 0.3, 0.99, 0.5, true, Wnd) guiGridListAddColumn(skinG, "Skins", 0.85) for i,skins in ipairs(skins) do row = guiGridListAddRow(skinG) -- guiGridListSetItemText(skinG, row, 1, tostring(skins[1]), false, false) guiGridListSetItemData(skinG, row, 1, tostring(skins[2])) end function SAPDjob(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(Wnd) then guiSetVisible(Wnd, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", markerp, SAPDjob) addEventHandler("onClientMarkerHit", marker1p, SAPDjob) addEventHandler("onClientMarkerHit", marker2p, SAPDjob) function takeJob() local row, col = guiGridListGetSelectedItem(skinG) if (row and col and row ~= -1 and col ~= -1) then local models = tonumber(guiGridListGetItemData(skinG, row, 1)) if model ~= "" then triggerServerEvent("getJob", localPlayer, models) guiSetVisible(Wnd,false) showCursor(false) end end end addEventHandler("onClientGUIClick", button1, takeJob, false) function close() if (source == button) then guiSetVisible(Wnd,false) showCursor(false) end end addEventHandler("onClientGUIClick", button, close)
-
I alredy have this in my full script, i dont give it because the people stole from me, look, i want if a crim with stars got shooted by police he will freeze for 3 sec, and fadecamera grey, when the 3 seconds pass, he will be unfrozen, and i want to, if a player got 1 level star he will jailed for 40 seconds, if 2 for 60 sec, etc, and the cop who jail the crim, earn more money every star, can you understand me now? Edit: the shooted weapon is silenced pistol
-
A cop shooting with silenced pistol can freeze he, if the player have stars, if not, cancel event freeze player and cancel event fade camera. Yes i understand, but tell me in a what star i must begin with if, 2/3/0, what? this i cant understand
-
function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) then if getTeamName( theTeam ) == "Policia" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "Ejercito" then setElementPosition (source, 3306.1, 1195.7, 945, true) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) warnText( "Has Sido Encarcelado Por "..theCop.. ".", source ) warnText( "Has Encarcelado a "..theName, attacker ) local playeraccount = getPlayerAccount ( attacker ) oldArrest = getAccountData(playeraccount, "arrest") if oldArrest then newArrest = setAccountData(playeraccount, "arrest", tonumber(oldArrest) + 1 ) else newArrest = setAccountData(playeraccount, "arrest", 1 ) end setPlayerWantedLevel (source, 0) if theWL > 1 then setTimer ( setElementPosition, 20000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 3000 * theWL ) elseif theWL > 2 then setTimer ( setElementPosition, 40000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 6000 * theWL ) elseif theWL > 3 then setTimer ( setElementPosition, 60000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 9000 * theWL ) elseif theWL > 4 then setTimer ( setElementPosition, 80000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 12000 * theWL ) elseif theWL > 5 then setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 15000 * theWL ) elseif theWL > 6 then setTimer ( setElementPosition, 120000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 18000 * theWL ) end end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) Now? And can anyone say or fix the error of the pistol freeze: function freezeWeapon (attacker, attackerweapon, bodypart, loss) if attacker and attacker ~= source and theTeam2 and getElementType(attacker) == "player" then theTeam2 = getPlayerTeam ( attacker ) theWL2 = getPlayerWantedLevel ( source ) theSkin2 = getElementModel ( attacker ) if (attackerweapon == 23) and (loss > 1) and (theWL2 > 0) then if getTeamName( theTeam2 ) == "Policia" or getTeamName( theTeam2 ) == "SWAT" or getTeamName( theTeam2 ) == "FBI" or getTeamName( theTeam2 ) == "Ejercito" then fadeCamera ( source, true, 2.0, 191, 191, 191 ) setTimer ( setElementFrozen, 3000, 1, source, false) end end end end addEventHandler ("onPlayerDamage", getRootElement(), freezeWeapon)
-
I must begin form theWL = 0 and use else?
-
for set the jail timer, then the prisoner will be free
-
Edit: now you deleted it
-
Of course friend, i want to make work the cop job, when a cop hit other crim, the crim will be jailed you know, next i will put the handcuffed, but now the problem is when a cop hit a crim without stars, the crim is jailed, and the cop doesnt receive money, and i was maked too a special pistol, the silenced pistol, when a cop shoot a crim with stars with the pistol, the player will froze for 3 sec with a fadecamera, depend if a cop hit a crim with 3 stars, he receive more money than 1 star, and the crim go to the jail for more time pd: you maked double post
-
this dont work please fix it