Jump to content

xeon17

Members
  • Posts

    1,903
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by xeon17

  1. Use this: https://wiki.multitheftauto.com/wiki/IsInsideRadarArea
  2. Create a vehicle first , example shinigami_noob = createVehicle ( your stuff ) later do this addEventHandler("onVehicleStartEnter", shinigami_noob, function (player) local playerTeam = getPlayerTeam(player) if (playerTeam) then local r, g, b = getTeamColor(playerTeam) local aR, aG, aB = getRadarAreaColor(GROVE) if (r == aR) and (g == aG) and (b == aB) then outputChatBox("", player, 0, 0, 0, true) else outputChatBox("#F4A460[AVISO]#F08080 Este veiculo pertence a gang Grove Street.", player, 0, 0, 0, true) cancelEvent() end else outputChatBox("#F4A460[AVISO]#F08080 Este veiculo pertence a gang Grove Street.", player, 0, 0, 0, true) cancelEvent() end end)
  3. Ye , he stolen my resources i created this :D :D :D :D
  4. xeon17

    GTA 5 Radar

    Thanks dude the code without errors now and script working awesome !
  5. xeon17

    GTA 5 Radar

    I got errors now , http://imgur.com/vvxx3p0.png
  6. xeon17

    GTA 5 Radar

    Hello guys I want to ask how i can make this gta 5 radar run all time on my server , i mean when the player enter on server the radar need to show. The script is from Bonsai's Multigamemode . local function getCameraRotation () px, py, pz, lx, ly, lz = getCameraMatrix() local rotz = 6.2831853071796 - math.atan2 ( ( lx - px ), ( ly - py ) ) % 6.2831853071796 local rotx = math.atan2 ( lz - pz, getDistanceBetweenPoints2D ( lx, ly, px, py ) ) --Convert to degrees rotx = math.deg(rotx) rotz = math.deg(rotz) return rotz end function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end local screenx, screeny = guiGetScreenSize() local sW, sH = (screenx/1280), (screeny/960) local edgeHorizontal = 25.6*sW local edgeVertical = 3*sW local width = 320*sW local height = 192*sH local startwidth = 25.6*sW local startheight = 720*sH local blipsize = 16 local blipr, blipg, blipb local totalsize = 1600 local theTarget local t local showRadar = true local myRenderTarget1 = dxCreateRenderTarget( width, height, true ) function drawRadar() if getElementData(localPlayer, "Arena") == "Login" or getElementData(localPlayer, "Arena") == "Lobby" or showRadar == false then return end if getPedOccupiedVehicle(localPlayer) ~= false then theTarget = getPedOccupiedVehicle(localPlayer) elseif getCameraTarget(localPlayer) ~= false then theTarget = getCameraTarget(localPlayer) else return end --background dxDrawRectangle ( startwidth, startheight, width, height, tocolor ( 0, 155, 255, 50 ) ) local arena = getElementData(localPlayer, "Arena") dxDrawRectangle ( startwidth, startheight, width, edgeVertical, tocolor ( 0, 0, 0, 255 ) ) dxDrawRectangle ( startwidth, startheight, edgeVertical, height, tocolor ( 0, 0, 0, 255 ) ) dxDrawRectangle ( startwidth, startheight+height, width, edgeHorizontal, tocolor ( 0, 0, 0, 255 ) ) dxDrawRectangle ( startwidth+width-edgeVertical, startheight, edgeVertical, height, tocolor ( 0, 0, 0, 255 ) ) local rotation = getCameraRotation() local xp, yp, zp = getElementPosition(theTarget) widthmap = (totalsize/2)+((totalsize/2)/2998)*xp heightmap = (totalsize/2)-((totalsize/2)/2998)*yp dxSetRenderTarget( myRenderTarget1, true ) dxDrawImage( -widthmap+(width/2), -heightmap+(height/2), totalsize, totalsize, "img/map.png", rotation, ((totalsize/2)/2998)*xp, -((totalsize/2)/2998)*yp, tocolor ( 255, 255, 255, 255 )) dxSetRenderTarget() dxDrawImage ( startwidth+edgeVertical, startheight+edgeVertical, width-edgeVertical*2, height-edgeVertical, myRenderTarget1, 0, 0, 0, tocolor ( 255, 255, 255, 255 ), false ) --players for i, p in pairs(getPlayersInArena(arena)) do if getElementData(p, "state") == "Alive" then if p ~= theTarget and getPedOccupiedVehicle(p) ~= theTarget then local x, y, z = getElementPosition(p) local name = getPlayerName(p) local c1, c2 = string.find(name, '#%x%x%x%x%x%x') if c1 then blipr, blipg, blipb = getColorFromString(string.sub(name, c1, c2)) else blipr = 255 blipg = 255 blipb = 255 end local distance = getDistanceBetweenPoints2D(x, y, xp,yp) local rotation2 = findRotation(x,y,xp,yp) local , yd = getPointFromDistanceRotation(startwidth+(width/2), startheight+(height/2), distance/4, rotation2-rotation) if < startwidth+edgeVertical then = startwidth+edgeVertical elseif > startwidth+width-edgeVertical then = startwidth+width-edgeVertical end if yd < startheight+edgeVertical then yd = startheight+edgeVertical elseif yd > startheight+height then yd = startheight+height end dxDrawRectangle ( -4, yd-4, 8, 8, tocolor ( 0, 0, 0, 255 ) ) dxDrawRectangle (-3, yd-3, 6, 6, tocolor (blipr, blipg, blipb, 255 ) ) end end end --checkpoints for i, p in pairs(getElementsByType("marker")) do if getElementData(p, "type") == "checkpoint" and getElementDimension(p) == getElementDimension(localPlayer) then if getMarkerSize(p) > 0.1 then local x, y, z = getElementPosition(p) blipr, blipg, blipb = getMarkerColor(p) local distance = getDistanceBetweenPoints2D(x, y, xp,yp) local rotation2 = findRotation(x,y,xp,yp) local , yd = getPointFromDistanceRotation(startwidth+(width/2), startheight+(height/2), distance/4, rotation2-rotation) if < startwidth+edgeVertical then = startwidth+edgeVertical elseif > startwidth+width-edgeVertical then = startwidth+width-edgeVertical end if yd < startheight+edgeVertical then yd = startheight+edgeVertical elseif yd > startheight+height then yd = startheight+height end if getElementData(p, "id") == getElementData(localPlayer, "checkpointname") then dxDrawRectangle ( -6, yd-6, 12, 12, tocolor ( 0, 0, 0, 255 ) ) dxDrawRectangle (-5, yd-5, 10, 10, tocolor (blipr, blipg, blipb, 255 ) ) else dxDrawRectangle ( -4, yd-4, 8, 8, tocolor ( 0, 0, 0, 255 ) ) dxDrawRectangle (-3, yd-3, 6, 6, tocolor (blipr, blipg, blipb, 255 ) ) end end end end if theTarget then local health = getElementHealth(theTarget) if getElementType(theTarget) == "player" then health = health*10 end health = math.max(health - 250, 0)/750 local p = -510*(health^2) local r,g = math.max(math.min(p + 255*health + 255, 255), 0), math.max(math.min(p + 765*health, 255), 0) local nitro if getElementType(theTarget) == "vehicle" then nitro = getVehicleNitroLevel(theTarget) end if not nitro then nitro = 0 end --health dxDrawRectangle(startwidth+edgeVertical, startheight+height+edgeVertical, width/2-edgeVertical*2+edgeVertical/2, edgeHorizontal-edgeVertical*2, tocolor(0,0,0,255) ) dxDrawRectangle(startwidth+edgeVertical+2, startheight+height+edgeVertical+2, width/2-edgeVertical*2+edgeVertical/2-4, edgeHorizontal-edgeVertical*2-4, tocolor(r,g,0,0.5*255) ) dxDrawRectangle(startwidth+edgeVertical+2, startheight+height+edgeVertical+2, health*(width/2-edgeVertical*2+edgeVertical/2-4), edgeHorizontal-edgeVertical*2-4, tocolor(r,g,0,255) ) --nitro dxDrawRectangle(startwidth+width/2+edgeVertical/2, startheight+height+edgeVertical, width/2-edgeVertical*2+edgeVertical/2, edgeHorizontal-edgeVertical*2, tocolor(0,0,0,255) ) dxDrawRectangle(startwidth+width/2+edgeVertical/2+2, startheight+height+edgeVertical+2, width/2-edgeVertical*2+edgeVertical/2-4, edgeHorizontal-edgeVertical*2-4, tocolor(0,150,220,0.5*255) ) dxDrawRectangle(startwidth+width/2+edgeVertical/2+2, startheight+height+edgeVertical+2, nitro*(width/2-edgeVertical*2+edgeVertical/2-4), edgeHorizontal-edgeVertical*2-4, tocolor(0,50,255,255) ) end local xr,yr,zr = getElementRotation(theTarget) dxDrawImage ( startwidth+(width/2)-blipsize/2, startheight+(height/2)-blipsize/2, blipsize, blipsize, "img/blip.png", -zr+rotation, 0, 0, tocolor ( 255, 255, 255, 255 ), false ) end addEventHandler("onClientRender", root, drawRadar) function getPlayersInArena(arena) local playerTable = {} for i, p in ipairs(getElementsByType("player")) do if getElementType(p) == "player" and getElementData(p, "Arena") == arena then table.insert(playerTable, p) end end return playerTable end function toggleRadar() if showRadar == true then showRadar = false elseif showRadar == false then showRadar = true end end addCommandHandler("showradar", toggleRadar)
  7. xeon17

    GangWar projekat

    Pa igracima iz EU , ping je oko 130-250 nije toliko visok moze da se igra a VPS je odlican tako da niko nema lag a mogu da igraju poprilicno igraci sa svakog kontinenta bez problema.
  8. Why you just don't check wiki ? https://wiki.multitheftauto.com/wiki/CreateRadarArea https://wiki.multitheftauto.com/wiki/CreateColCuboid
  9. xeon17

    pickup hit

    Use https://wiki.multitheftauto.com/wiki/CreateEffect
  10. xeon17

    pickup hit

    createEffect dosen't work on MTA 1.3
  11. There is nothing wrong in your code, maybe you should try to change the ped position.
  12. xeon17

    One code.

    No dude , it's because of my bad script organization it's not first time i have this problem.
  13. xeon17

    One code.

    I have errors in the code , example end nedded to close a function. etc etc but i don't know to fix it it's because of my bad code organization.
  14. xeon17

    One code.

    I need help with my gang system code , the code have 900 line and i think it can be leaked if i share here. So can someone help me via skype or here in forum ( private message )
  15. xeon17

    Question

    Solved ! Thanks guys
  16. It's first time i work with bindkey and this stuff , i don't understand how it work... function Bind ( source ) if not (isAllownedPlayer(source)) then return end bindKey ( source, adminchat , "down", "chatbox", bind ) end addEventHandler("onPlayerLogin", root, Bind)
  17. local acls = { "ORGANIZADOR", "MODERADOR", "ADMINISTADOR", "COLABORADOR", "Console" } function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) for i, v in pairs ( acls ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ORGANIZADOR" ) )) then outputChatBox ( "#FF0000[Organizador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "MODERADOR" ) )) then outputChatBox ( "#FF0000[Moderador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ADMINISTADOR" ) )) then outputChatBox ( "#FF0000[Administrador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "COLABORADOR" ) )) then outputChatBox ( "#FF0000[Colaborador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "Console" ) )) then outputChatBox ( "#FF0000[Console] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end end end end addCommandHandler ( "ac", adminchat ) function isAllownedPlayer(player) local account = getPlayerAccount(player) if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) for i, v in pairs ( acls ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then return true end end outputChatBox("#FFF000[sERVER]#FFFFFF You aren't an admin.", player, 255,255,255, true) return false end bindKey ( source, u , "down", "chatbox", function );
  18. How i can make my admin chat to work by bindkey ''‚'' ( ‚ ) function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) for i, v in pairs ( acls ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ORGANIZADOR" ) )) then outputChatBox ( "#FF0000[Organizador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "MODERADOR" ) )) then outputChatBox ( "#FF0000[Moderador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ADMINISTADOR" ) )) then outputChatBox ( "#FF0000[Administrador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "COLABORADOR" ) )) then outputChatBox ( "#FF0000[Colaborador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "Console" ) )) then outputChatBox ( "#FF0000[Console] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end end end end addCommandHandler ( "ac", adminchat ) I tried but dosen't work ,help Et-win :DDDDD
  19. xeon17

    Question

    Now the minigun for players work , but the minigun for vehicles dosen't fire.. addCommandHandler ('mini1', function ( ) local xx , yy , zz = getElementPosition ( localPlayer ) local minigunw = createWeapon ( 'minigun', xx, yy, zz +1 ) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) for _, nThat in ipairs ( getElementsByType ('vehicle' )) do local x, y, z = getElementPosition ( nThat ) setWeaponTarget ( minigunw ,nThat, 255 ) end end ) addCommandHandler ('mini2', function ( ) local xx,yy,zz = getElementPosition ( localPlayer ) local minigunw = createWeapon ( 'minigun', xx, yy, zz +1 ) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) for _, nMax in ipairs ( getElementsByType ('player' )) do local nx, ny, nz = getElementPosition ( nMax ) setWeaponTarget ( minigunw ,nMax, 255 ) end end )
  20. xeon17

    Question

    Have you tried to create minigun at player position ? (localPlayer) ?
  21. xeon17

    Question

    ، i have an idea of making 1 mini gun shoot at 2 targts , but i am going out now when iam back , i will do it in other way . Would be awesome !
  22. xeon17

    Question

    Bugged Now the script create two mini guns , one do nothing the other one shot at vehicles. and at every vehicle a minigun created , it should be when i write /mini , on my position a minigun get created and the minigun shot on vehicles with players in and players.
  23. xeon17

    Question

    Nope addCommandHandler ('mini', function ( ) local nx, ny, nz = getElementPosition ( localPlayer ) local minigunw = createWeapon ( 'minigun', nx, ny, nz +1 ) setWeaponClipAmmo ( minigunw,99999) setWeaponState ( minigunw,"firing") setWeaponProperty( minigunw, "fire_rotation", 0, -30, 0 ) for _, nMax in ipairs ( getElementsByType ('player' )) do yz, yy, zz = getElementPosition ( nMax ) setWeaponTarget ( minigunw ,nMax, 255 ) end for _, nThat in ipairs ( getElementsByType ('vehicle' )) do x, y, z = getElementPosition ( nThat ) setWeaponTarget ( minigunw ,nThat, 255 ) end end )
×
×
  • Create New...