Jump to content

littel Help in Here Please :D


^Dev-PoinT^

Recommended Posts

Hi all i made This is it Correct or Not and fix it To Know My errors :D

function onKill(ammo, killer, weapon, bodypart) 
    if (killer and killer ~= source) then 
    local x,y,z = getElementPosition(source) 
    createExpliosion (x,y,z, 10) --- TankGreande 
    outputChatBox("You Have Been Explode by..getPlayerName..(killer)"),getRootElement(),255,255,0, true) 
end 
addEventHandler ("onPlayerWasted",getRootElement(), onKill) 

:mrgreen:

Link to comment

Changes

- createExpliosion => createExplosion

- by..getPlayerName..(killer)") => by " .. getPlayerName(killer)

- fixed some of your typos and little things (couldn't leave them like that heh)

function onKill(ammo, killer, weapon, bodypart) 
    if (killer and killer ~= source) then 
        local x, y, z = getElementPosition(source) 
        createExplosion (x, y, z, 10) 
        outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) 
    end 
end 
addEventHandler("onPlayerWasted", getRootElement(), onKill) 

I like that you are copying my code base (my latest thread), good way of learning yeah... :redhotevil:

Link to comment

Like This ?

function onKill(ammo, killer, weapon, bodypart) 
    if (killer and killer ~= source) then 
    if getElementType ( killer ) == "Player" 
        local x, y, z = getElementPosition(source) 
        createExplosion (x, y, z, 10) 
        outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) 
    end 
end 
addEventHandler("onPlayerWasted", getRootElement(), onKill) 

?

Link to comment

You got it. but don't use capitals. Here you go, 2 lines less code:

function onKill(ammo, killer, weapon, bodypart) 
    if killer and killer ~= source and getElementType ( killer ) == "player" then 
        local x, y, z = getElementPosition(source) 
        createExplosion (x, y, z, 10) 
        outputChatBox("You have been exploded by " .. getPlayerName(killer), getRootElement(), 255, 255, 0, true) 
    end 
end 
addEventHandler("onPlayerWasted", getRootElement(), onKill) 

You are learning...

Link to comment
Nooob ! Your Code is about Money My Code is about Explosion !

and1- getElementPostion is it in Your Code Nah

2- createExplosion is it in Your Code Nah

Then yes i made it :D

Function name and eventHandler is the same name, including the if (killer and killer ~= source)..

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