Jump to content

تصحيح اكود


Ahmed Ly

Recommended Posts

السلام عليكم

وين خطا في هدا اكود ؟؟؟؟

كلنت

GUIEditor_Image = {} 
  
function trolled() 
    GUIEditor_Image[1] = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
    sound = playSound("Heartbeat.mp3", false) 
    setSoundVolume(sound, 1) 
    setTimer(closewin, 3000, 1) 
end 
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), trolled) 
  
  
  
 function closewin() 
 guiSetVisible(GUIEditor_Image[1], false) 
end 
  
  
function wasted (killer, weapon, bodypart)  
  if killer ~= source then 
    guiSetVisible(GUIEditor_Image[1], false) 
end 
 end 
addEventHandler("onClientPlayerWasted", getRootElement(), wasted) 

سيرفر

addEventHandler ( "onPlayerWasted", root, function ( _, attacker ) 
    if ( attacker and attacker ~= source and isElement ( attacker ) ) then 
        setElementHealth ( attacker, getElementHealth ( attacker ) + 35 ) 
        triggerClientEvent(attacker,"dienoob",attacker) 
        outputChatBox ( "[--", attacker, 0, 255, 0, true ) 
    end 
end ) 

يقولي خطا في Debug

في سطر هدا

triggerClientEvent(attacker,"dienoob",attacker) 

:?::?::?::?::?:

Link to comment

--server 
addEventHandler ( "onPlayerWasted", root, 
function ( _, attacker ) 
    if ( attacker ~= false and attacker ~= source ) then 
        setElementHealth ( attacker, getElementHealth ( attacker ) + 35 ) 
        triggerClientEvent(source,"dienoob",source) 
        outputChatBox ( "[--", attacker, 0, 255, 0, true ) 
    end 
end  
) 

--client 
  image = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
     
    guiSetVisible (image,false) 
     
function trolled() 
    guiSetVisible (image,true) 
    sound = playSound("Heartbeat.mp3", false) 
    setSoundVolume(sound, 1) 
    setTimer(closewin, 3000, 1) 
end 
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), trolled) 
  
  
  
 function closewin() 
 guiSetVisible(image, false) 
end 
  

Link to comment
--server 
addEventHandler ( "onPlayerWasted", root, 
function ( _, attacker ) 
    if ( attacker ~= false and attacker ~= source ) then 
        setElementHealth ( attacker, getElementHealth ( attacker ) + 35 ) 
        triggerClientEvent(source,"dienoob",source) 
        outputChatBox ( "[--", attacker, 0, 255, 0, true ) 
    end 
end  
) 

--client 
  image = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
     
    guiSetVisible (image,false) 
  
     
function trolled() 
    guiSetVisible (image,true) 
    sound = playSound("Heartbeat.mp3", false) 
    setSoundVolume(sound, 1) 
    setTimer(closewin, 3000, 1) 
end 
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), trolled) 
  
  
  
 function closewin() 
 guiSetVisible(image, false) 
end 
  

انت هيك عملت التريقر للي رح يموت الي هو السورس

وهو يبيه للـ بيقتله

جرب

        triggerClientEvent(attacker,"dienoob") 
  

Link to comment

Ahlan, al code bita3ak kan totally messy.

l hine rani fixito,

--Client side:

GUIEditor_Image = {} 
GUIEditor_Image[1] = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
  
function trolled()  
    local sound = playSound("Heartbeat.mp3", false) 
    if (sound and isElement(sound)) then 
        setSoundVolume(sound, 1.0) 
        guiSetVisible(GUIEditor_Image[1],true) 
        setTimer(closewin, 3000, 1) 
    end  
end 
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), trolled) 
  
function closewin() 
    guiSetVisible(GUIEditor_Image[1], false) 
end 
  

--Server side:

addEventHandler("onPlayerWasted", root, function (_, attacker) 
    if (attacker and attacker ~= source and isElement(attacker)) then 
        setElementHealth(attacker, getElementHealth(attacker) + 35 ) 
        triggerClientEvent(attacker,"dienoob",attacker) 
        outputChatBox("[--", attacker, 0, 255, 0, true) 
    end 
end) 

Tahiyati,

KariM

Link to comment
 -- Server Side  
addEventHandler("onPlayerWasted", root, function (_, attacker) 
    if attacker and attacker ~= source and getElementType ( attacker ) == 'player' then 
        setElementHealth(attacker, getElementHealth(attacker) + 35 ) 
        triggerClientEvent(attacker,"dienoob",attacker) 
        outputChatBox("[", attacker, 0, 255, 0, true) 
    end 
end)  

 -- Client Side 
local img = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
  
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), 
function () 
    if isElement ( sound ) then destroyElement ( sound ) end 
    sound = playSound("Heartbeat.mp3", false) 
    setSoundVolume(sound, 1.0) 
    guiSetVisible(img,true) 
    setTimer(guiSetVisible, 3000, 1, img, false) 
end) 

Link to comment
Ahlan, al code bita3ak kan totally messy.

l hine rani fixito,

--Client side:

GUIEditor_Image = {} 
GUIEditor_Image[1] = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
  
function trolled()  
    local sound = playSound("Heartbeat.mp3", false) 
    if (sound and isElement(sound)) then 
        setSoundVolume(sound, 1.0) 
        guiSetVisible(GUIEditor_Image[1],true) 
        setTimer(closewin, 3000, 1) 
    end  
end 
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), trolled) 
  
function closewin() 
    guiSetVisible(GUIEditor_Image[1], false) 
end 
  

--Server side:

addEventHandler("onPlayerWasted", root, function (_, attacker) 
    if (attacker and attacker ~= source and isElement(attacker)) then 
        setElementHealth(attacker, getElementHealth(attacker) + 35 ) 
        triggerClientEvent(attacker,"dienoob",attacker) 
        outputChatBox("[--", attacker, 0, 255, 0, true) 
    end 
end) 

Tahiyati,

KariM

not work

:?:

Link to comment

Try this,

--Client side:

GUIEditor_Image = {} 
GUIEditor_Image[1] = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
local sound  
  
function trolled() 
    if sound and isElement(sound) then destroyElement(sound) sound = nil end 
    sound = playSound("Heartbeat.mp3", false) 
    setSoundVolume(sound, 1.0) 
    guiSetVisible(GUIEditor_Image[1],true) 
    setTimer(closewin, 3000, 1) 
end 
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), trolled) 
  
function closewin() 
    guiSetVisible(GUIEditor_Image[1], false) 
end 

--Server side:

addEventHandler("onPlayerWasted", root, function (_, attacker) 
    if (attacker and attacker ~= source and isElement(attacker)) then 
        setElementHealth(attacker, getElementHealth(attacker) + 35 ) 
        triggerClientEvent(attacker,"dienoob",attacker) 
        outputChatBox("[--", attacker, 0, 255, 0, true) 
    end 
end) 

Link to comment

addEventHandler("onPlayerWasted", root, function (_, attacker) 
    if ( attacker and attacker ~= source ) then 
        setElementHealth(attacker, getElementHealth(attacker) + 35 ) 
        triggerClientEvent(attacker,"dienoob",attacker) 
        outputChatBox("[--", attacker, 0, 255, 0, true) 
    end 
end) 

img = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
guiSetVisible(img,false) 
  
addEvent("dienoob", true) 
addEventHandler('dienoob',root, 
function () 
    if ( isElement(sound) ) then 
        destroyElement(sound) 
    end 
    sound = playSound("Heartbeat.mp3", false) 
    setSoundVolume(sound, 1.0) 
    guiSetVisible(img,true) 
    setTimer(closewin, 3000, 1) 
end) 
     
  
function closewin() 
    guiSetVisible(img, false) 
end 
Link to comment
Try this,

--Client side:

GUIEditor_Image = {} 
GUIEditor_Image[1] = guiCreateStaticImage(93,439,44,35,"heart.png",false) 
local sound  
  
function trolled() 
    if sound and isElement(sound) then destroyElement(sound) sound = nil end 
    sound = playSound("Heartbeat.mp3", false) 
    setSoundVolume(sound, 1.0) 
    guiSetVisible(GUIEditor_Image[1],true) 
    setTimer(closewin, 3000, 1) 
end 
addEvent("dienoob", true) 
addEventHandler("dienoob", getRootElement(), trolled) 
  
function closewin() 
    guiSetVisible(GUIEditor_Image[1], false) 
end 

--Server side:

addEventHandler("onPlayerWasted", root, function (_, attacker) 
    if (attacker and attacker ~= source and isElement(attacker)) then 
        setElementHealth(attacker, getElementHealth(attacker) + 35 ) 
        triggerClientEvent(attacker,"dienoob",attacker) 
        outputChatBox("[--", attacker, 0, 255, 0, true) 
    end 
end) 

:P:P:P

Thank you !!!

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