Jump to content

طلب كود ماركر سيرات


baba

Recommended Posts

addEventHandler("onMarkerHit", MARKER, 
function ( player ) 
       if ( getElementType(player) == "player" ) then 
             if ( getPlayerTeam(player) == getTeamFromName("اسم التيم") ) and not isPedInVehicle(player) then 
                    x, y, z = getElementPosition(player) 
                    vehicle = createVehicle(602, x, y, z) 
                    if vehicle then 
                          warpPedIntoVehicle(player,vehicle) 
                    end 
             end 
       end 
      return destroyElement(vehicle) 
end  ) 

./EDIT

انا مافهمتك بـ هذي الكلمه ( قروب معين ) ءء

وضح لاهنت يعني تبيه اذا كان في التيم ( و ) القروب

ولا اذا كان في التيم ( او ) القروب

Edited by Guest
Link to comment
  
  
---- [[ SOURCE CODE ( isPlayerInTeam ) ]] ---- 
  
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 
  
  
addEventHandler("onMarkerHit", MARKER, 
function ( player ) 
       if ( getElementType(player) == "player" ) then 
             if ( isPlayerInTeam(player) ) then 
                    x, y, z = getElementPosition(player) 
                    vehicle = createVehicle(602, x, y, z) 
                    if vehicle then 
                          warpPedIntoVehicle(player,vehicle) 
                    end 
             else  
                    outputChatBox("You don't have a team") 
             end 
       end 
      return destroyElement(vehicle) 
end  ) 

اذا اللاعب في تيم يعطيه سياره

----------- لكن القروب وش قصته ؟ ------------

اصلا الكود ماراح يعطي سيارة الا للاعب الي معه تيم

+ ياليت توضح اكثر من كذا لأنه ام تي اي فيها شي اسمه تيم لكن شيء اسمه ( قروب ) مافيه

الا اذا كنت تستخدم سكربت القروبات حق العقرب او اي سكربت ثاني

Link to comment
  
  
---- [[ SOURCE CODE ( isPlayerInTeam ) ]] ---- 
  
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 
  
  
addEventHandler("onMarkerHit", MARKER, 
function ( player ) 
       if ( getElementType(player) == "player" ) then 
             if ( isPlayerInTeam(player) ) then 
                    x, y, z = getElementPosition(player) 
                    vehicle = createVehicle(602, x, y, z) 
                    if vehicle then 
                          warpPedIntoVehicle(player,vehicle) 
                    end 
             else  
                    outputChatBox("You don't have a team") 
             end 
       end 
      return destroyElement(vehicle) 
end  ) 

اذا اللاعب في تيم يعطيه سياره

----------- لكن القروب وش قصته ؟ ------------

اصلا الكود ماراح يعطي سيارة الا للاعب الي معه تيم

+ ياليت توضح اكثر من كذا لأنه ام تي اي فيها شي اسمه تيم لكن شيء اسمه ( قروب ) مافيه

الا اذا كنت تستخدم سكربت القروبات حق العقرب او اي سكربت ثاني

غلط

+

يقصد في الجروب داتا

Group

Link to comment
  • Moderators

TeamName = 'testTeam'  -- اسم التيم 
GroupName = 'testGroup' -- اسم القروب  
  
CarsTable = {} 
  
addEventHandler("onMarkerHit", marker, 
function ( player ) 
    if ( getElementType(player) == "player" ) then 
        if ( CarsTable[player] ) then destroyElement(CarsTable[ player])  end 
        local theTeam = getPlayerTeam ( player ) 
        local theGroup = getElementData ( player )  
        if ( theTeam and theTeam == getTeamFromName(TeamName) and theGroup and theGroup == GroupName ) then 
            local x, y, z = getElementPosition(player) 
            CarsTable[ player] = createVehicle(602, x, y, z) 
            if CarsTable[ player] then 
                warpPedIntoVehicle(player,CarsTable[ player]) 
            end 
        end 
    end 
end) 
Link to comment
انا جديد ويريت توضح الكود

(x, y, z)

هنا تحط الاحداثيات لو تبي احداثيات

اكتب فيي اف 8

gp

وبعدين

انقلك الاحداثيات

هو راح يعطيك

مثلا اعطاك

(434 232 323)

انت خليها

(434, 232 ,323)

Link to comment

التعديل بسطر 1 انكـ تحط الارقمنات الاحداثيات واللون والخ ..

وبالسطر الثالث تحط الايدهات .. مداك تضيف تحط فاصلة بعد اخر وحدة وتكتب الايدي

وبالسطر الثالث بدال قروب نيم اسم القروب وبدال تيم نيم اسم التيم .

local marker = createMarker ( .... ) 
local vehicle = {   } 
local vehicles = { id, id, id } 
local info = { "GroupName", "TeamName" } 
  
addEventHandler ( "onMarkerHit", resourceRoot, function( element ) 
    if ( source == marker ) then 
      if ( getElementType( element ) == "player" ) then 
       if ( getPlayerTeam ( element ) and getPlayerTeam ( element ) == getTeamFromName ( info [ 2 ] ) or getElementData ( element, "Group" ) == info [ 1 ] ) then 
         if ( isElement( vehicle[ element ] ) ) then destroyElement ( vehicle[ element ] ) vehicle[ element ] = nil end 
          local iD = tonumber( vehicles[math.random(#vehicles)] ) 
          vehicle[ element ] = createVehicle( iD, x, y, z ) 
          if ( vehicle[ element ] ) then 
            warpPedIntoVehicle( element, vehicle[ element ] ) 
         end 
       end 
     end 
   end 
end ) 
  
addEventHandler( "onPlayerQuit", root, function( ) 
  if ( vehicle[ source ] ) then 
    if ( isElement ( vehicle[ source ] ) ) then        
       destroyElement( vehicle[ source ] )  
   end 
   vehicle[ source ] = nil 
  end 
end ) 
  
addEventHandler( "onVehicleExplode", resourceRoot, function(  ) 
     setTimer( destroyElement, 2000, 1, source ) 
end ) 
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...