Sasu Posted February 20, 2013 Share Posted February 20, 2013 Hello! I need help with my script. Server-side: function suicidar() setTimer( function(sourcePlayer) killPed(sourcePlayer) end , 10000, 1 ) end addEvent( "onPlayerSuicidio", true ) addEventHandler( "onPlayerSuicidio", getRootElement(), suicidar ) Client-side: addEventHandler("onClientResourceStart", resourceRoot, function() end ) addCommandHandler( "kill", function() addEventHandler("onClientRender", getLocalPlayer(), function() dxDrawRectangle(413, 571, 517, 30, tocolor(0, 0, 0, 145), true) dxDrawText("Espera 10 segundos y moriras.", 416, 571, 859, 593, tocolor(255, 0, 0, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) triggerServerEvent ( "onPlayerSuicidio", getLocalPlayer() ) end ) end ) I have any error on debugscript 3. I need that when a player type /kill command, appear dxDrawText and dissapear in 10 seconds. Thank you very much. Link to comment
Vision Posted February 20, 2013 Share Posted February 20, 2013 Try this Client function text ( ) dxDrawRectangle(413, 571, 517, 30, tocolor(0, 0, 0, 145), true) dxDrawText("Espera 10 segundos y moriras.", 416, 571, 859, 593, tocolor(255, 0, 0, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) end addCommandHandler( "kill", function ( ) addEventHandler ( "onClientRender", root, text ) triggerServerEvent ( "onPlayerSuicidio", localPlayer ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, text ) end, 10000, 1 ) end ) Server function suicidar ( ) setTimer ( killPed, 10000, 1, source ) end addEvent( "onPlayerSuicidio", true ) addEventHandler( "onPlayerSuicidio", root, suicidar ) Link to comment
Sasu Posted February 20, 2013 Author Share Posted February 20, 2013 Try thisClient function text ( ) dxDrawRectangle(413, 571, 517, 30, tocolor(0, 0, 0, 145), true) dxDrawText("Espera 10 segundos y moriras.", 416, 571, 859, 593, tocolor(255, 0, 0, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) end addCommandHandler( "kill", function ( ) addEventHandler ( "onClientRender", root, text ) triggerServerEvent ( "onPlayerSuicidio", localPlayer ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, text ) end, 10000, 1 ) end ) Server function suicidar ( ) setTimer ( killPed, 10000, 1, source ) end addEvent( "onPlayerSuicidio", true ) addEventHandler( "onPlayerSuicidio", root, suicidar ) Thank you very very much Castro. Link to comment
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