Jump to content

طلب تصحيح كود البلب


Recommended Posts

سلام عليكم

شباب انا ابي فقط الكونسل لما يدخل السيرفر يجيه البلب ولما يخرج يروح البلب

بس ماادري وش الخطااا

function onjoin(player) 
    if (getElementType (player) == "player") then 
    local accName = getAccountName(getPlayerAccount(player)) 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then 
        Lol = createBlipAttachedTo ( player, 56 ) 
    end 
end 
addEventHandler ( "onPlayerJoin", root, onjoin ) 
  
  
function s7b() 
    local accName = getAccountName(getPlayerAccount(player)) 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then 
    destroyElement(Lol) 
    end 
end 
addEventHandler("onPlayerQuit",root,s7b) 

شباب اذا فيه خطا قولولي لحد يساعد خخخخخ ابي اصحح خطائي بنفسي

ويليت توضحون الخطا وانا بصححه

Link to comment

طلبي واضح ابي لما يدخل اي واحد معه عضويت الكونسل

يجي عليه بل خريطه بلب ولما يخرج يروح البلب من الخريطه

+

الكوونسل تمشي

+

هي علي حسب الاسل الي عندك

+

رجااء الي مايعرف لايرد

Link to comment
function destroyBlipAttachedTo(player) 
    local attachedElements = getAttachedElements(player) 
    if attachedElements then 
        for i, attachedElement in ipairs(attachedElements) do 
            if getElementType(attachedElement) == "blip" then 
                destroyElement(attachedElement) 
            end 
        end 
    end 
end 

تعلم ,

Link to comment
سلام عليكم

شباب انا ابي فقط الكونسل لما يدخل السيرفر يجيه البلب ولما يخرج يروح البلب

بس ماادري وش الخطااا

function onjoin(player) 
    if (getElementType (player) == "player") then 
    local accName = getAccountName(getPlayerAccount(player)) 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then 
        Lol = createBlipAttachedTo ( player, 56 ) 
    end 
end 
addEventHandler ( "onPlayerJoin", root, onjoin ) 
  
  
function s7b() 
    local accName = getAccountName(getPlayerAccount(player)) 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Console")) then 
    destroyElement(Lol) 
    end 
end 
addEventHandler("onPlayerQuit",root,s7b) 

شباب اذا فيه خطا قولولي لحد يساعد خخخخخ ابي اصحح خطائي بنفسي

ويليت توضحون الخطا وانا بصححه

عندك end

ناقص

Link to comment

وعنده في الايفنت عند خروج الاعب

player -- غير معرف في الفنكشن فوق

لازم يكون

function mmm ( player)

~

  
 addEventHandler('onPlayerJoin', root, 
 function (uPed) 
     if (getElementType(uPed) == 'player') then 
     local accName = (getAccountName(getPlayerAccount(uPed))) 
     if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) then 
      Lol = createBlipAttachedTo ( uPed, 56 ) 
   end 
  end 
end 
) 
  
addEventHandler('onPlayerQuit', root, 
function (uPed ) 
     local attachedElements = getAttachedElements(uPed) 
    if attachedElements then 
        for i, attachedElement in ipairs(attachedElements) do 
        if(getElementType(attachedElements) == 'blip') then 
        destroyElement(attachedElements) 
    end 
  end 
 end 
end 
) 

Link to comment

+ اتوقع ان player في البلب غير معرف,,

لو تسويه على السريال يكون افضل لك !

function createBlipAttached() -- وظيفة حدث عند دخول اي لاعب 
    if(getPlayerSerial(source) == "9D12C226FEC361A22BBD7B8E5EC3FDC2")then -- اذا سيريال اللاعب الداخل السيريال التالي 
        blip = createBlipAttachedTo(source, 0) -- يصنع لهذا "اللاعب" البلب 
    end 
end 
addEventHandler("onPlayerJoin", root, createBlipAttached) -- اضافة حدث عند دخول اي لاعب 
  
function unAttachBlip() -- وظيفة حدث عند خروج اي لاعب 
    if(getPlayerSerial(source) == "9D12C226FEC361A22BBD7B8E5EC3FDC2")then -- اذا سيريال اللاعب الخارج السيريال التالي 
        destroyElement(blip) -- يحذف لهذا "اللاعب" البلب 
    end 
end 
addEventHandler("onPlayerQuit", root, unAttachBlip) -- حدث عن خروج اي لاعب 

Link to comment
+ اتوقع ان player في البلب غير معرف,,

لو تسويه على السريال يكون افضل لك !

function createBlipAttached() -- وظيفة حدث عند دخول اي لاعب 
    if(getPlayerSerial(source) == "9D12C226FEC361A22BBD7B8E5EC3FDC2")then -- اذا سيريال اللاعب الداخل السيريال التالي 
        blip = createBlipAttachedTo(source, 0) -- يصنع لهذا "اللاعب" البلب 
    end 
end 
addEventHandler("onPlayerJoin", root, createBlipAttached) -- اضافة حدث عند دخول اي لاعب 
  
function unAttachBlip() -- وظيفة حدث عند خروج اي لاعب 
    if(getPlayerSerial(source) == "9D12C226FEC361A22BBD7B8E5EC3FDC2")then -- اذا سيريال اللاعب الخارج السيريال التالي 
        destroyElement(blip) -- يحذف لهذا "اللاعب" البلب 
    end 
end 
addEventHandler("onPlayerQuit", root, unAttachBlip) -- حدث عن خروج اي لاعب 

فيه كثار كونسل بجلس اخذ سيريال واحد واحد

وكذا مشووار احطها لقروب وخلاص

Link to comment
  
 addEventHandler("onPlayerLogin", root, 
 function () 
     if getElementType(source) == "player" then 
     local accName = getAccountName(getPlayerAccount(source)) 
     if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) then 
      Lol = createBlipAttachedTo ( source, 56 ) 
   end 
  end 
end) 
  
addEventHandler("onPlayerQuit", root, 
function () 
     local attachedElements = getAttachedElements(source) 
    if attachedElements then 
        for i, attachedElement in ipairs(attachedElements) do 
        if(getElementType(attachedElements) == 'blip') then 
        destroyElement(attachedElements) 
    end 
  end 
 end 
end) 

Link to comment

Server

  
  
Lol = {} 
  
addEventHandler( 'onPlayerLogin', root, function( _, acc ) 
    local accName = getAccountName( acc ) 
    if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) and not Lol[source] then 
        Lol[source] = createBlipAttachedTo ( source, 56 ) 
    end 
end) 
  
addEventHandler('onPlayerQuit', root,function ) 
    if Lol[source] and isElement(Lol[source]) then 
        destroyElement(Lol[source]) 
        Lol[source] = nil 
    end 
end) 
  
  

Link to comment

اهاا الحين عرفت يعني الخطا من

onplayerjoin

بس المهم الحين لما اخرج من السيرفر البلب ماايروح

او بمعني ماينسحب من الخريطه ابيه يختفي لما اخرج

Link to comment
Server
  
  
Lol = {} 
  
addEventHandler( 'onPlayerLogin', root, function( _, acc ) 
    local accName = getAccountName( acc ) 
    if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) and not Lol[source] then 
        Lol[source] = createBlipAttachedTo ( source, 56 ) 
    end 
end) 
  
addEventHandler('onPlayerQuit', root,function ) 
    if Lol[source] and isElement(Lol[source]) then 
        destroyElement(Lol[source]) 
        Lol[source] = nil 
    end 
end) 
  
  

×

Link to comment
Server
  
  
Lol = {} 
  
addEventHandler( 'onPlayerLogin', root, function( _, acc ) 
    local accName = getAccountName( acc ) 
    if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) and not Lol[source] then 
        Lol[source] = createBlipAttachedTo ( source, 56 ) 
    end 
end) 
  
addEventHandler('onPlayerQuit', root,function ) 
    if Lol[source] and isElement(Lol[source]) then 
        destroyElement(Lol[source]) 
        Lol[source] = nil 
    end 
end) 
  
  

Lol = {} 
addEventHandler( 'onPlayerLogin', root,  
function( _, acc ) 
    local accName = getAccountName( acc ) 
    if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) and not Lol[source] then 
        Lol[source] = createBlipAttachedTo ( source, 56 ) 
    end 
end) 
  
addEventHandler('onPlayerQuit', root, 
function () 
    if Lol[source] and isElement(Lol[source]) then 
        destroyElement(Lol[source]) 
        Lol[source] = nil 
    end 
end) 

Link to comment

وذأ شغآل ^^

local playerBlips = {} 
  
addEventHandler("onPlayerLogin", getRootElement(), 
    function () 
        local account = getPlayerAccount(source) 
        if (not account or isGuestAccount(account)) then return end 
        local accountName = getAccountName(account) 
        if isObjectInACLGroup('user.' .. accountName, aclGetGroup("Console")) then 
            if isElement(playerBlips[source]) then 
                destroyElement(playerBlips[source]) 
            end 
            playerBlips[source] = createBlipAttachedTo ( source, 56 ) 
        end 
    end 
) 
  
addEventHandler("onPlayerLogout", getRootElement(), 
    function() 
        if isElement(playerBlips[source]) then destroyElement(playerBlips[source]) end 
        playerBlips[source] = nil 
    end 
) 

Edited by Guest
Link to comment
Lol = {} 
addEventHandler( 'onPlayerLogin', root,  
function( _, acc ) 
    local accName = getAccountName( acc ) 
    if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) and not Lol[source] then 
        Lol[source] = createBlipAttachedTo ( source, 56 ) 
    end 
end) 
  
addEventHandler('onPlayerQuit', root, 
function () 
    if Lol[source] and isElement(Lol[source]) then 
        destroyElement(Lol[source]) 
        Lol[source] = nil 
    end 
end) 

كفوو ضبطططط

بس ي ليت واحد ككفوو يشرحلي

ووش فايدة

Lol = {}

=======

_, acc

=======

Lol[source] = nil

Link to comment
Server
  
  
Lol = {} 
  
addEventHandler( 'onPlayerLogin', root, function( _, acc ) 
    local accName = getAccountName( acc ) 
    if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) and not Lol[source] then 
        Lol[source] = createBlipAttachedTo ( source, 56 ) 
    end 
end) 
  
addEventHandler('onPlayerQuit', root,function ) 
    if Lol[source] and isElement(Lol[source]) then 
        destroyElement(Lol[source]) 
        Lol[source] = nil 
    end 
end) 
  
  

Lol = {} 
addEventHandler( 'onPlayerLogin', root,  
function( _, acc ) 
    local accName = getAccountName( acc ) 
    if isObjectInACLGroup('user.'..accName, aclGetGroup('Console')) and not Lol[source] then 
        Lol[source] = createBlipAttachedTo ( source, 56 ) 
    end 
end) 
  
addEventHandler('onPlayerQuit', root, 
function () 
    if Lol[source] and isElement(Lol[source]) then 
        destroyElement(Lol[source]) 
        Lol[source] = nil 
    end 
end) 

عشان يسحب البليب لما اللاعب يسجل خروجه 'onPlayerLogout' إستخدم .

Lol = {} 
  
addEventHandler ( 'onPlayerLogin', root, 
    function( _, acc ) 
        local accName = getAccountName( acc ) 
        if ( isObjectInACLGroup('user.' .. accName, aclGetGroup ( 'Console' ) ) ) and ( not Lol[source] ) then 
            Lol[source] = createBlipAttachedTo ( source, 56 ) 
        end 
    end 
) 
  
addEventHandler ( 'onPlayerLogout', root, 
    function ( ) 
        if ( Lol[source] ) and ( isElement ( Lol[source] ) ) then 
            destroyElement ( Lol[source] ) 
            Lol[source] = nil 
        end 
    end 
) 
  
addEventHandler ( 'onPlayerQuit', root, 
    function ( ) 
        if ( Lol[source] ) and ( isElement ( Lol[source] ) ) then 
            destroyElement ( Lol[source] ) 
            Lol[source] = nil 
        end 
    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...