Jump to content

Code wanted


Recommended Posts

Hello guys :D << نبي نقلبها انجليزي اليوم ض1

I want code for police team , when police hit player his wanted lvl = 0

The police get slap for 20 for all time he hit him

And make DXtext up the player : Don't harm unwanted player

------

بالعربي

شباب ابغى كود لـ فريق الششرطة

إن لما الشرطي يضرب لآعب نجومه صصفر الشرطي ينقص دمه 20 بالمية على كل ضربه يضربها للآعب

و يآريت اذا بالإمكان يجي كلآم فوق الاعب مثلآ

Don't harm unwanted player

وبكون شششآكر وممنون

آسف عالطلب

ولكن منكم نسستفيد ونفيد

Link to comment

يصير زي كذا ؟

اصلحولي الأخطاء اذا ممكن :oops:

function teamName ( Police ) 
    local playerTeam = getPlayerTeam ( source ) 
    if ( playerTeam ) Police then 
     
    function wanted () 
local wantedLvl = getPlayerWantedLevel ( ) 
   if wantedLvl == 0 then 
    
   function showLocalHealth() 
    local playerHealth = getElementHealth ( getLocalPlayer() ) 
    if playerHealth then 
     
    function hpSlap ( sourcePlayer, command, targetPlayerName ) 
    if not hasObjectPermissionTo(sourcePlayer, "command.slap", false) then 
        return false 
    end 
    local targetPlayer = getPlayerFromName ( targetPlayerName ) 
    if targetPlayer then 
        setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - 20 ) 
end 
  
    addCommandHandler ( onPlayerDamage, "wanted", "showhealth", "hpslap", hpSlap ) 

Link to comment
طيب يانوب ليش تبي تعطي الشرطي سلاب كذا بيكون خبال المود ليش ماتخليه اذا الاعب ماهو مطلوب والشرطي يطلق عليه مايصير له شي احسن ^^

يا قلبي الشيء الي قلته انت

" اذا الاعب ماهو مطلوب والشرطي يطلق عليه مايصير له شيء "

هذا متوفر

لآ تحكم وتتسرع علي :oops:

Link to comment

تفضل

server :

function POlice_Slap ( attacker, weapon, bodypart, loss ) 
    local playerTeam = getPlayerTeam ( attacker ) 
    local PlayerTeamName = getTeamName ( playerTeam ) 
    local wantedLvl = getPlayerWantedLevel (source) 
    if  PlayerTeamName == "Police"  and wantedLvl == 0 then 
    setElementHealth ( attacker, getElementHealth(attacker) - 20 ) 
    end 
end 
addEventHandler ( "onPlayerDamage", getRootElement (), POlice_Slap ) 

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