Jump to content

طلب كود


3ssol

Recommended Posts

سلام عليكم

شباب انا مسوي ماركر بس ابي ااذا لمست الماركر

ومامعاك اي سلاح يقول مامعك سلاح

واذا معاك سلاح يقول معك سلاح

طبعا ابيه يتحقق من كل اسلحتي المهم يكون معاي اي سلاح موب عصي سلاح

:)

Link to comment

سسوي جدول شف ذا مثال ,

local weapons = {[30] = true,[31] = true} 
addEventHandler('onClientResourceStart',resourceRoot,function() 
        if weapons[getPedWeapon(localPlayer)] then  
            outputChatBox('لديك اسلحه')  
    else  
            outputChatBox('ليس لديك اسلحه') 
        end 
    end 
) 

Link to comment
-- # Server Side ! 
local marker = createMarker ( ... ); 
  
addEventHandler ( "onMarkerHit", marker, 
    function ( plr ) 
        if getElementType ( plr ) == "player" then 
            if not getPedWeapon ( plr ) then  
            outputChatBox ( "* ليس لديك أي سلاح", plr, 255, 255, 255, true ); 
            else 
                for i, v in ipairs ( getPedWeapons ( plr ) ) do 
                outputChatBox ( "* لديك من الأسلحة " .. getWeaponNameFromID ( v ), plr, 255, 255, 255, true ); 
                end 
            end 
        end 
    end 
); 
  
getPedWeapons = function ( ped ) 
    local playerWeapons = {  }; 
        if ped and isElement ( ped ) and getElementType ( ped ) == "ped" or getElementType ( ped ) == "player" then 
            for i = 0, 12 do 
            if i == 1 then i = 0 end 
                local wep = getPedWeapon ( ped, i ); 
                if wep and wep > 0 then 
                    table.insert ( playerWeapons, wep ); 
                end 
            end 
        else 
        return false 
        end 
        return playerWeapons 
    end 

Link to comment
-- # Server Side ! 
local marker = createMarker ( ... ); 
  
addEventHandler ( "onMarkerHit", marker, 
    function ( plr ) 
        if getElementType ( plr ) == "player" and not isPedInVehicle ( plr ) then 
            if not getPedWeapon ( plr ) then  
            outputChatBox ( "* ليس لديك أي سلاح", plr, 255, 255, 255, true ); 
            else 
                for i, v in ipairs ( getPedWeapons ( plr ) ) do 
                outputChatBox ( "* لديك من الأسلحة " .. getWeaponNameFromID ( v ), plr, 255, 255, 255, true ); 
                end 
            setElementPosition ( plr, x, y, z ); 
            end 
        end 
    end 
); 
  
getPedWeapons = function ( ped ) 
    local playerWeapons = {  }; 
        if ped and isElement ( ped ) and getElementType ( ped ) == "ped" or getElementType ( ped ) == "player" then 
            for i = 0, 12 do 
            if i == 1 then i = 0 end 
                local wep = getPedWeapon ( ped, i ); 
                if wep and wep > 0 then 
                    table.insert ( playerWeapons, wep ); 
                end 
            end 
        else 
        return false 
        end 
        return playerWeapons 
    end 

Link to comment

جرب,

-- Server Side # 
local Weapons = {[1]=true,[2]=true,[3]=true,[4]=true,[5]=true,[6]=true,[7]=true,[8]=true,[9]=true,[10]=true,[11]=true,[12]=true,[14]=true,[15]=true,[42]=true,[43]=true,[44]=true,[45]=true} 
local marker = createMarker(...) 
  
addEventHandler('onMarkerHit', marker,function ( plr ) 
        if getElementType ( plr ) == "player" then 
            if getPedWeapon(plr) == 0 or Weapons[getPedWeapon(plr)] then outputChatBox(' ليس لديك اسلحه',plr,255,50,1,true) 
    else 
                if getPedWeapon(plr) > 0 then outputChatBox('لديك اسلحه *',plr,50,50,255,true) 
                    setElementPosition(plr,x,y,z) 
                end 
            end 
        end 
    end 
) 
Edited by Guest
Link to comment

ي ذا بست كودك شغال بس فيه خطا

اذا ضغطت زر

e

يغير السلاح والمس الماركر يقول مامعك سلاح

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

فهمت ؟

Link to comment

جرب هذآ و شوف :

-- # Server Side .. 
  
  
local marker = createMarker ( x,y,z,'cylinder',2,255,255,255,255 ) 
local TableWeapons = {  
    [0] = true, 
    [1] = true, 
 -- To Add Weapon [iD] = true, 
} 
  
addEventHandler ( 'onMarkerHit',marker, 
    function (   player     ) 
        if getElementType ( player ) == 'player' and not isPedInVehicle  ( player ) then 
            local PlayerWeapon = getPedWeapon ( player ) 
        if ( TableWeapons [ PlayerWeapon ] ) then 
                return  
                    outputChatBox ( 'عذراً ليس لديك آي سلاح' ) 
            else 
                    outputChatBox ( 'حسناً لديك آسلحة' ) 
                    setPedArmor ( player,100 ) 
        end 
    end 
end ) 

لازم ماتكون بسيارهـ للمعلومية + ضيف الايدي اللي تبية موضح فوق كيفية الاضافة ..

Link to comment

كفيت ووفيت ي الذيب ضبط 96% 100

بس فيه خطأ بسيط

لو نقول انا ابيه مايدخل سلاح العصي حقت الشرطي

يعني لو لمست الماركر ومعاك فقط عصي الشرطي مايدخلك بس اذا لمست الماركر وماسك بيدك عصي الشرطي

بس معك اسلحه ثانيه يدخلك , انت كودك لو معك اسلحه ومعك عصي الشرطي وماسكها بيدي ولمست الماركر مايدخلني

وانا الي ابيه المهم يتحقق ان معك اسلحه ثاانيه غير الي انا احط الايدي حقهم بل جدول فهمت ؟

Link to comment
كفيت ووفيت ي الذيب ضبط 96% 100

بس فيه خطأ بسيط

لو نقول انا ابيه مايدخل سلاح العصي حقت الشرطي

يعني لو لمست الماركر ومعاك فقط عصي الشرطي مايدخلك بس اذا لمست الماركر وماسك بيدك عصي الشرطي

بس معك اسلحه ثانيه يدخلك , انت كودك لو معك اسلحه ومعك عصي الشرطي وماسكها بيدي ولمست الماركر مايدخلني

وانا الي ابيه المهم يتحقق ان معك اسلحه ثاانيه غير الي انا احط الايدي حقهم بل جدول فهمت ؟

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...