Jump to content

destroy image on clients screen


TmM_DEVIL

Recommended Posts

how do i go about destroying this image when another user is selected from server side script

client

function pic() 
  
        local screenWidth, screenHeight = guiGetScreenSize() 
        local lama = guiCreateStaticImage(screenWidth/2 - -290, screenHeight - 80, 220, 100, 'lama.png', false, nil) 
    end 
  
addEvent("onGreeting", true) 
addEventHandler("onGreeting", getRootElement(), pic) 

server

function lamaHunt ( player, command, killer ) 
    if ( command and lama ) then 
        --local blip = getElementData ( source, "lamablip" ) 
        if ( blip ) then 
            destroyElement ( blip ) 
            blip = nil 
        end 
        setPlayerWantedLevel ( lama, 0 ) 
    end 
     
    lama = killer or getRandomPlayer() 
    if ( lama ) then 
        blip = createBlipAttachedTo ( lama, 23 ) 
                triggerClientEvent ( "onGreeting", getRootElement(), "" ) 
        --setElementData ( lama, "lamablip", blip ) 
        setTimer ( setPlayerWantedLevel, delay, 1, lama, 6 ) 
        setTimer ( outputChatBox, delay, 1, "You're the lama, run!", lama ) 
        for i, v in ipairs ( getElementsByType ( "player" ) ) do 
            if ( v ~= lama ) then 
                setTimer ( outputChatBox, delay, 1, getClientName ( lama ) .. " is the lama!", v ) 
            end 
        end 
    end 
end 

Link to comment

:mrgreen: > ey up Devil :redhotevil: Well this is a fitting first post, helping out a fellow clan member , and I have a vested intrest in getting this script up too, that being said I am prolly the most nubzeh $l<2!P702 ever but I hate to see you with your cap in hand and nobody... biting ? so i chuck in my tuppence, lol wtf am i saying, it is 4am though. anyway this is what I came up with

client

function pic() 
  
        local screenWidth, screenHeight = guiGetScreenSize() 
        local kahk = guiCreateStaticImage(screenWidth/2 - -290, screenHeight - 80, 220, 100, 'lama.png', false, nil) 
end 
  
  
function bummer 
        destroyElement ( kahk ) 
        triggerServerEvent ( lama ) 
end 
  
  
addEvent ("greeting", true ) 
addEvent ("lamaWasted") 
  
addEventHandler ("onGreeting", getRootElement(), pic ) 
addEventHandler ("onLamaWasted",getRootElement(), bummer ) 

server

function lamaHunt ( player, command, killer ) 
    if ( command and lama ) then 
        --local blip = getElementData ( source, "lamablip" ) 
        if ( blip ) then 
            destroyElement ( blip ) 
            blip = nil 
        end 
        setPlayerWantedLevel ( lama, 0 ) 
    end 
     
    lama = killer or getRandomPlayer() 
    if ( lama ) then 
        blip = createBlipAttachedTo ( lama, 23 ) 
                triggerClientEvent ( "greeting", getRootElement(), "" ) 
        --setElementData ( lama, "lamablip", blip ) 
        setTimer ( setPlayerWantedLevel, delay, 1, lama, 6 ) 
        setTimer ( outputChatBox, delay, 1, "You're the lama, run!", lama ) 
        for i, v in ipairs ( getElementsByType ( "player" ) ) do 
            if ( v ~= lama ) then 
                setTimer ( outputChatBox, delay, 1, getClientName ( lama ) .. " is the lama!", v ) 
            end 
        end 
    end 
end 
  
  
  
  
addCommandHandler ( "gogogolama", lamaHunt) 

some of what you had didnt make any sence to me at all, but i did notice a few things that i am pretty sure are correct now that were not before, but i'm guessing it still wont work :)

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