Jump to content

= [ طلب فنكشنات ] =


Recommended Posts

ابي فنكشنات مود بشرحلكم ياه الحين
ابي اول ما اللاعب يصير دمه %10 
يسوي انيميشن وما يقدر يتحرك ويجي قدامه ماركر وتكون فيه لوحة
وباقي اللاعبين يشوفون هذا الماركر واول ما يدخلون فيه
تطلعلهم ويقلهم هل تريد معالجة هذا الشخص
واول ما يعالجه يسحب من فلوس الشخص الي عالجه 2500
والي عالجه يسوي انيميشن اول ما يضغط علي الزر واللوحة تنقفل
وهذاك الي انعالج دمه يصير 100 + الماركر الي قدامه يختفي
ياليت تكونو فهمتوني

Edited by KinG_Himoo12
Link to comment
-- Server
Table = { }
"onPlayerWasted"
getElementHealth
setElementData -- Health == 10
setPedAnimation
setElementFrozen
Table[source] = createMarker
addEventHandler -- onMarkerHit


'onMarkerHit'
takePlayerMoney -- 2500
setElementHealth -- 100
destroyElement -- Table[source]


removeEventHandler -- onMarkerHit

'FromClient'
getElementData -- health 
trrigerClientEvent -- root

-- Client

'onClientRender'
dxDrawTextOnElement

 

Link to comment
18 hours ago, iMr.WiFi..! said:

-- Server
Table = { }
"onPlayerWasted"
getElementHealth
setElementData -- Health == 10
setPedAnimation
setElementFrozen
Table[source] = createMarker
addEventHandler -- onMarkerHit


'onMarkerHit'
takePlayerMoney -- 2500
setElementHealth -- 100
destroyElement -- Table[source]


removeEventHandler -- onMarkerHit

'FromClient'
getElementData -- health 
trrigerClientEvent -- root

-- Client

'onClientRender'
dxDrawTextOnElement

 

--Server
Table = {}
addEventHandler("onPlayerWasted",root,
function(source)
if getElementHealth(source, 10 ) then
setElementData ( health, "health", health )
setPedAnimation( source, "CRACK", "crckidle1")
setElementFrozen ( source, true)
local x, y, z = getElementPosition ( source )
Table[source] = createMarker (x, y + 10, z , "cylinder",1.5,0,255,0, 80)
end
end)

 

محاولتي ما اشتغلت

Link to comment
Table = {}
function cr(source)
health = getElementHealth(source)
if health == 10 then
setPedAnimation( source, "CRACK", "crckidle1")
setElementFrozen ( source, true)
local x, y, z = getElementPosition ( source )
Table[source] = createMarker (x, y + 10, z , "cylinder",1.5,0,255,0, 80)
end
end

function onmarkerHit(hitElement,player)
if hitElement == player then
outputChatBox("you gonna help that guy", player, 255, 0, 0)
takePlayerMoney(player,200)
setElementHealth(source,100)
destroyElement(Table[source])
setElementFrozen(source,false)
end
end
addEventHandler( "onMarkerHit", Table[source], onmarkerHit )

 

Link to comment
13 minutes ago, #BrosS said:

Table = {}
function cr(source)
health = getElementHealth(source)
if health == 10 then
setPedAnimation( source, "CRACK", "crckidle1")
setElementFrozen ( source, true)
local x, y, z = getElementPosition ( source )
Table[source] = createMarker (x, y + 10, z , "cylinder",1.5,0,255,0, 80)
end
end

function onmarkerHit(hitElement,player)
if hitElement == player then
outputChatBox("you gonna help that guy", player, 255, 0, 0)
takePlayerMoney(player,200)
setElementHealth(source,100)
destroyElement(Table[source])
setElementFrozen(source,false)
end
end
addEventHandler( "onMarkerHit", Table[source], onmarkerHit )

 

م نفع

Link to comment
3 minutes ago, #BrosS said:

حطه مع حدث onPlayerWasted

نسيت

كذا ؟
 

Table = {}
function cr(source)
health = getElementHealth(source)
if health == 10 then
setPedAnimation( source, "CRACK", "crckidle1")
setElementFrozen ( source, true)
local x, y, z = getElementPosition ( source )
Table[source] = createMarker (x, y + 10, z , "cylinder",1.5,0,255,0, 80)
end
end
addEventHandler( "onPlayerWasted", Table, cr )

function onmarkerHit(hitElement,player)
if hitElement == player then
outputChatBox("you gonna help that guy", player, 255, 0, 0)
takePlayerMoney(player,200)
setElementHealth(source,100)
destroyElement(Table[source])
setElementFrozen(source,false)
end
end
addEventHandler( "onMarkerHit", Table[source], onmarkerHit )

 

Link to comment
local Marker = { }
local Player = { }

addEventHandler ("onPlayerDamage", root, 
    function ()
        local hp = getElementHealth (source)
        if (hp >= 5 and hp <= 10) then
            setElementFrozen (source, true)
            setPedAnimation (source, "CRACK", "crckidle1", _, false, _, _, true)
            local x, y, z = getElementPosition (source)
            if isElement (Marker [source]) then
                destroyElement (Marker [source])
                Player [Marker [source]] = nil
                Marker [source] = nil
            end
            Marker [source] = createMarker (x, y + 3, z - 1, "cylinder", 2, 255, 255, 255)
            Player [Marker [source]] = source
        else
            if isElement (Marker [source]) then
                destroyElement (Marker [source])
                Player [Marker [source]] = nil
                Marker [source] = nil
            end
        end
    end
)

addEventHandler ("onMarkerHit", resourceRoot, 
    function (hit)
        if getElementType (hit) == "player" then
            if not isPedInVehicle (hit) then
                if Player [source] then
                    local plr = Player [source]
                    if getPlayerMoney (hit) >= 2500 then
                        setPedAnimation (plr, false)
                        setElementFrozen (plr, false)
                        setElementHealth (plr, 100)
                        takePlayerMoney (hit, 2500)
                        destroyElement (Marker [plr])
                        Marker [plr] = nil
                        Player [source] = nil
                    else
                        outputChatBox ("Error - you don't have enough money.", hit, 255, 0, 0)
                    end
                end
            end
        end
    end
)

function destroyMarker ()
    if isElement (Marker [source]) then
        destroyElement (Marker [source])
        Player [Marker [source]] = nil
        Marker [source] = nil
    end
end
addEventHandler ("onPlayerWasted", root, destroyMarker)
addEventHandler ("onPlayerQuit", root, destroyMarker)

 

  • Like 2
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...