Jump to content

onPlayerWasted :D


Max+

Recommended Posts

Posted

Hello

i got isuue with this event

i have images for every bodypart

what i want make is

if (bodypart == 9 ) then

drawimage for the victim

else if (bodypart == 7 )

...

etc ?

iam just starting making it

but iam not good in images :D

addEventHandler('onPlayerWasted', root, 
function(attacker, bodypart) 
    if(getElementType(attacker) == 'player') then 
    if (bodypart == 9 ) then 
     

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Max, you cannot make images in serverside, I assume you want the bodypart image to appear when they die.

CLIENT:

bodypartImage = { 
[3] = 'IMAGE.PNG', 
[4] = 'IMAGE.PNG', 
[5] = 'IMAGE.PNG', 
[6] = 'IMAGE.PNG', 
[7] = 'IMAGE.PNG', 
[8] = 'IMAGE.PNG', 
[9] = 'IMAGE.PNG', 
} 
  
addEventHandler('onClientPlayerWasted', getRootElement(), 
function(killer, weapon, bodypart) 
    screenX, screenY = guiGetScreenSize() 
    width = 300 
    height = 300 
    guiCreateStaticImage((screenX/2)-(width/2), (screenY/2)-(height/2), width, height, bodypartImage[bodypart], false) 
end ) 

Very simple just edit the table and replace the images for the different ID's, and replace the width and height variables with the correct size.

Posted

so it well be like this ?

bodypartImage = { 
[3] = 'torso.png', 
[4] = 'ass.png', 
[5] = 'leftarm.png', 
[6] = 'rightarm.png', 
[7] = 'leftleg.png', 
[8] = 'rightleg.png', 
[9] = 'head.png', 
} 
  
addEventHandler('onClientPlayerWasted', getRootElement(), 
function(killer, weapon, bodypart) 
    if(getElementType(attacker) == 'player') then 
    screenX, screenY = guiGetScreenSize() 
    width = 350 
    height = 348 
    guiCreateStaticImage((screenX/2)-(width/2), (screenY/2)-(height/2), width, height, bodypartImage[bodypart], false) 
  end 
end) 

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Csmit195

i didn't test the script yes

iam making a damage script

i have sound like tactis gamemod if hit player play sound for the attacker and victm

how can i make that ?

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

I made the same for my BaseMode server.

Client:

weaponDING = 'ding.mp3' 
  
addEventHandler('onClientPlayerDamage', getRootElement(), 
function(attacker, weapon, bodypart) 
    if attacker == localPlayer then 
        playSound(weaponDING) 
    end 
end ) 

Replace line 1 with your damage sound.

Posted

Is it Possble to make timer

every pic shows for 2-3 sec and go ..

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Yes i know

but its an Table ?

how can i do it with table ?

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
bodypartImage = { 
[3] = 'torso.png', 
[4] = 'ass.png', 
[5] = 'leftarm.png', 
[6] = 'rightarm.png', 
[7] = 'leftleg.png', 
[8] = 'rightleg.png', 
[9] = 'head.png', 
} 
  
addEventHandler('onClientPlayerWasted', getRootElement(), 
function(killer, weapon, bodypart) 
    if(getElementType(attacker) == 'player') then 
    screenX, screenY = guiGetScreenSize() 
    width = 350 
    height = 348 
    image = guiCreateStaticImage((screenX/2)-(width/2), (screenY/2)-(height/2), width, height, bodypartImage[bodypart], false) 
    setTimer(destroyElement, 3000, 1, image) 
  end 
end) 

Posted

Thank's Iam Gonig To Try It ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

sound for both of them lol ?

i need it for attacker only

and images not shown :(

Lua --Client

----The Images Script 
bodypartImage = { 
[3] = 'images/torso.png', 
[4] = 'images/ass.png', 
[5] = 'images/leftarm.png', 
[6] = 'images/rightarm.png', 
[7] = 'images/leftleg.png', 
[8] = 'images/rightleg.png', 
[9] = 'images/head.png', 
} 
  
addEventHandler('onClientPlayerWasted', getRootElement(), 
function(killer, weapon, bodypart) 
    if ( attacker ) and ( attacker ~= source ) then 
    screenX, screenY = guiGetScreenSize() 
    width = 350 
    height = 348 
    guiCreateStaticImage((screenX/1184)-(width/635), (screenY/172)-(height/109), width, height, bodypartImage[bodypart], false) 
    setTimer(destroyElement, 3000, 1, image) 
  end 
end) 
  
---Sound Script  
ding = 'sounds/hit.wav' 
addEventHandler('onClientPlayerDamage', root, 
function(attacker) 
    if ( attacker ) and ( attacker ~= source ) then 
    playSound(ding) 
  end 
end 
) 
  
  
----Rights  
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
    triggerServerEvent('rights', localPlayer) 
end 
) 

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
sound for both of them lol ?

i need it for attacker only

and images not shown :(

Lua --Client

----The Images Script 
bodypartImage = { 
[3] = 'images/torso.png', 
[4] = 'images/ass.png', 
[5] = 'images/leftarm.png', 
[6] = 'images/rightarm.png', 
[7] = 'images/leftleg.png', 
[8] = 'images/rightleg.png', 
[9] = 'images/head.png', 
} 
  
addEventHandler('onClientPlayerWasted', getRootElement(), 
function(killer, weapon, bodypart) 
    if ( attacker ) and ( attacker ~= source ) then 
    screenX, screenY = guiGetScreenSize() 
    width = 350 
    height = 348 
    guiCreateStaticImage((screenX/1184)-(width/635), (screenY/172)-(height/109), width, height, bodypartImage[bodypart], false) 
    setTimer(destroyElement, 3000, 1, image) 
  end 
end) 
  
---Sound Script  
ding = 'sounds/hit.wav' 
addEventHandler('onClientPlayerDamage', root, 
function(attacker) 
    if ( attacker ) and ( attacker ~= source ) then 
    playSound(ding) 
  end 
end 
) 
  
  
----Rights  
addEventHandler('onClientResourceStart', resourceRoot, 
function() 
    triggerServerEvent('rights', localPlayer) 
end 
) 

hmmm,,,

function(killer, weapon, bodypart) 

and

if ( attacker ) and ( attacker ~= source ) then 

Can you see your own mistake now?:P

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted

Oh !

Dam i didn't look there lol

iam going to try .

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

Bad argument @ 'guiCreateStaticImage'[Expetcted string at argument 5 , got nill]

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

what you mean he say guicreateImage Expetcted string at argument 5

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

i'v go to wiki and see

argument 5 is the path of image !

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
i'v go to wiki and see

argument 5 is the path of image !

try this;

bodypartImage = { 
[3] = "torso.png", 
[4] = "ass.png", 
[5] = "leftarm.png", 
[6] = "rightarm.png", 
[7] = "leftleg.png", 
[8] = "rightleg.png", 
[9] = "head.png", 
} 

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted

i need them images / ..

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted
i'v go to wiki and see

argument 5 is the path of image !

try this;

bodypartImage = { 
[3] = "torso.png", 
[4] = "ass.png", 
[5] = "leftarm.png", 
[6] = "rightarm.png", 
[7] = "leftleg.png", 
[8] = "rightleg.png", 
[9] = "head.png", 
} 

LoooooL?

  

Posted
i'v go to wiki and see

argument 5 is the path of image !

try this;

bodypartImage = { 
[3] = "torso.png", 
[4] = "ass.png", 
[5] = "leftarm.png", 
[6] = "rightarm.png", 
[7] = "leftleg.png", 
[8] = "rightleg.png", 
[9] = "head.png", 
} 

LoooooL?

I'm not into this script at all, but single and double qoutes are important in alot of language's. ;)

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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