Max+ Posted February 26, 2013 Posted February 26, 2013 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 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
codeluaeveryday Posted February 26, 2013 Posted February 26, 2013 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. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
Max+ Posted February 26, 2013 Author Posted February 26, 2013 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
codeluaeveryday Posted February 27, 2013 Posted February 27, 2013 Yes Max, it should be, good job! Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
codeluaeveryday Posted February 27, 2013 Posted February 27, 2013 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. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
codeluaeveryday Posted February 27, 2013 Posted February 27, 2013 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) Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
tosfera Posted February 27, 2013 Posted February 27, 2013 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? If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
tosfera Posted February 27, 2013 Posted February 27, 2013 Oh !Dam i didn't look there lol iam going to try . haha sure, I'll wait for your reply. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
tosfera Posted February 27, 2013 Posted February 27, 2013 wich line, cause it looks good to me. ( the first one ) If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
tosfera Posted February 27, 2013 Posted February 27, 2013 haha well, wich line does the error say; its normally like; filename:error - error. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
tosfera Posted February 27, 2013 Posted February 27, 2013 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", } If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Max+ Posted February 27, 2013 Author Posted February 27, 2013 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
iPrestege Posted February 27, 2013 Posted February 27, 2013 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?
tosfera Posted February 27, 2013 Posted February 27, 2013 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. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now