Jump to content

relaxx

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by relaxx

  1. Oh tanks thats sloved the problem
  2. for componentName in pairs (getVehicleComponents(v)) do local x,y,z = getVehicleComponentPosition ( v, componentName, "world" ) local wx,wy,wz = getScreenFromWorldPosition ( tonumber(x), tonumber(y), tonumber(z) ) if wx and wy then vehicleComponents[componentName] = {componentName,wx,wy} end end it makes a lot of error: Can someone help me what is the problem, i dont understand this... if i delete the tonumber then it makes that:
  3. local myBlip = {} function showPlayers(source) myBlip = {} for k, v in ipairs(getElementsByType("player")) do if not(v == source and not getElementData(v, "Char->adminduty"))then local r,g,b = getTeamColor(getPlayerTeam(v)) myBlip[v] = createBlipAttachedTo (v, 4,2,r,g,b,160) end end end addEvent( "showAllPlayers", true ) addEventHandler( "showAllPlayers", resourceRoot, showPlayers ) When a player left the sever then his blip is stay on the map can someone help me?
  4. if a player die then the marker is stay on the location where he die
  5. it works but its make a lot of bug function showPlayers(source) local myBlip = {} for k, v in ipairs(getElementsByType("player")) do if not(v == source)then if(getPlayerTeam(v) == getPlayerTeam (source)) then myBlip[v] = createBlipAttachedTo (v, 4 ) elseif(getPlayerTeam(v) ~= getPlayerTeam (source)) then myBlip[v] = createBlipAttachedTo (v, 3 ) end end end end
  6. hi i want make a point based capture system but i dont dont how There is some problem etc this script use just one marker but i want use ~15 and the point arent deleting so pls help me local myMarker = createMarker(-184.63004, 2625.75952, 63.49821, 'cylinder', 2.0, 255, 0, 0, 150) setElementData (myMarker, "owner", "nil") local usa = 0 local ussr = 0 local turkey = 0 local germany = 0 function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then local elementType = getElementType( hitElement ) outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 ) local playerTeam = getPlayerTeam(hitElement) local tname = getTeamName ( playerTeam ) outputChatBox(tname) outputChatBox(usa) outputChatBox(ussr) outputChatBox(turkey) outputChatBox(germany) local r, g, b r, g, b = getTeamColor ( playerTeam ) if(getElementData(myMarker,"owner") ~= tname)then Timer = setTimer ( function ( ) if(getMarkerColor(myMarker) == getTeamColor ( playerTeam ))then outputChatBox("asd") end if(isPlayerInTeam(hitElement, "usa"))then usa = usa+1 end if(isPlayerInTeam(hitElement, "ussr"))then ussr = ussr+1 end if(isPlayerInTeam(hitElement, "turkey"))then turkey = turkey+1 end if(isPlayerInTeam(hitElement, "germany"))then germany = germany+1 end setMarkerColor (myMarker, r, g, b, 255 ) outputChatBox ( 'You captured') end, 2000, 1) end end end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ("#ff0000You have to stay 20 sec in the marker!", getRootElement(), 255, 255, 255, true) if isTimer ( Timer ) then killTimer ( Timer ) end end end addEventHandler( "onMarkerLeave", myMarker, markerLeave ) function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end
×
×
  • Create New...