GrubaS Posted June 13, 2015 Posted June 13, 2015 Hello guys, I want make script in dxDrawRectangle example: "Ananas has killed Apple" local x,y = guiGetScreenSize() -- Get players resolution. local name = getPlayerName ( localPlayer ) -- Get players name. function drawStuff(name) killerss = getPlayerName(getElementData(getPlayerFromPartialName(name),"lasthit")) alivePlayers = 0 for i ,v in ipairs (getElementsByType("player")) do if getElementData(v,"state") == "alive" then alivePlayers = alivePlayers + 1 end end if alivePlayers == 1 then setElementData(getPlayerFromPartialName(name),"lasthit",nil) end dxDrawRectangle ( x/85.8, y/1.6, x/10.02, y/25, tocolor ( 0, 0, 0, 150 ) ) -- Create our black transparent MOTD background Rectangle. dxDrawText ( name.." has killed "..killers, x/85.5, y/1.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) -- Create Welcome title. end addEventHandler("onClientVehicleCollision",root, function(hitElement) if source == getPedOccupiedVehicle(localPlayer) then if hitElement and getElementType(hitElement) == 'vehicle' then local driver = getVehicleController(source) local hDriver = getVehicleController(hitElement) if hDriver and driver then setElementData(driver,"lasthit",hDriver) if isTimer(timer) then killTimer(timer) end timer = setTimer(setElementData,5000,1,driver,"lasthit",nil) end end end end )
Miika Posted June 13, 2015 Posted June 13, 2015 You need server and client side. They didn't work at once.
GrubaS Posted June 17, 2015 Author Posted June 17, 2015 it's my, but i thought dont need server side.
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