Fury Posted August 25, 2012 Posted August 25, 2012 client: local vehModel = nil local screen_x, screen_y = guiGetScreenSize() local font = "bankgothic" local scale = screen_x / 1000 local message = "" local messWidth = 1 local messHeight = 1 addEventHandler("onClientVehicleCollision", root, function(collider) if collider then if getElementType(collider)=="vehicle" and getElementHealth(source)>250 and isElementInWater(source)==false then triggerServerEvent("vehicleCollision", source, collider) end end end ) addEvent("showDeathMess", true) addEventHandler("showDeathMess", getRootElement(), function(theKiller) if(source ~= getLocalPlayer())then return end addEventHandler("onClientRender", getRootElement(), kill) message = "Killed by: "..theKiller messWidth = dxGetTextWidth(message, scale, font) messHeight = dxGetFontHeight(scale, font) setTimer(function() removeEventHandler("onClientRender", getRootElement(), kill) end, 5000, 1) end) function kill() dxDrawText(message, screen_x/2 - messWidth/2, screen_y/2 - messHeight/2, screen_x, screen_y, tocolor(255, 0, 0, 150), scale, font) end server: function collider ( collider ) outputChatBox ( "Killer: " .. collider, source ) local acc = getPlayerAccount( collider ) local kills = getAccountData( acc,"kills" ) or 0 setAccountData( acc,"kills", kills+1) triggerClientEvent("showDeathMess", source, collider) end addEvent( "vehicleCollision", true ) addEventHandler( "vehicleCollision", getRootElement(), collider ) function wasted() local acc = getPlayerAccount( source ) local deaths = getAccountData( acc,"deaths" ) or 0 setAccountData( acc,"deaths", deaths+1) end addEventHandler( "onPlayerWasted", getRootElement(), wasted ) what i am doing wrong? Destruction Derby
CheiN Posted August 25, 2012 Posted August 25, 2012 getAcc data is when player exit setAcc data is when player login My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Fury Posted August 25, 2012 Author Posted August 25, 2012 getAcc data is when player exit setAcc data is when player login well i havent problem on account things for now. i cant define the "killer" Destruction Derby
Castillo Posted August 25, 2012 Posted August 25, 2012 @Vendetta: What is the problem exactly? does it output any debugscript error? @SunLight: What you just said makes no sense. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
CheiN Posted August 25, 2012 Posted August 25, 2012 read onPlayerWasted on wiki here u can see how to define it My scripts: toptimes on scoreboard (server21) Screen on login(scren) Score on scoreboard (score)
Fury Posted August 25, 2012 Author Posted August 25, 2012 @Vendetta: What is the problem exactly? does it output any debugscript error? when i hit some car its output: read onPlayerWasted on wiki here u can see how to define it i wanna define the "killer" not the "killed" Destruction Derby
Castillo Posted August 25, 2012 Posted August 25, 2012 That's because is a element, you should use: tostring ( ): outputChatBox ( "Killer: ".. tostring ( collider ), source ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Fury Posted August 25, 2012 Author Posted August 25, 2012 That's because is a element, you should use: tostring ( ): outputChatBox ( "Killer: ".. tostring ( collider ), source ) its dont output chat anything. also dont show the killer on screen Destruction Derby
Anderl Posted August 25, 2012 Posted August 25, 2012 That's because is a element, you should use: tostring ( ): outputChatBox ( "Killer: ".. tostring ( collider ), source ) Output an element in Chat Box? If it's a player element you should use getPlayerName, not tostring. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Castillo Posted August 25, 2012 Posted August 25, 2012 I don't know, that's what he had, so I though he was checking if it's sending a "killer" at all. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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