Jump to content

Problem in my script.


YopMan

Recommended Posts

Posted

Hi all,

I've got a problem in my script.

This script does not work:

if ( isPlayerWasted () then 
triggerEvent("msgBoxInfo", getRootElement(), "my text") 
end 

Thanks.

Posted

What. This is a total mess.

function onDeath() 
outputChatBox("your dead, cool story bro") 
end 
addEventHandler("onPlayerWasted", getRootElement(), onDeath) 

That is a simple way to do it.

Posted
function onDeath() 
outputChatBox("your dead, cool story bro", source, 255, 0, 0) -- You forgot about the player element. 
end 
addEventHandler("onPlayerWasted", getRootElement(), onDeath) 

Posted

I don't wan't to put it in the chatbox. (Sorry I'm french)

Here is my full code:

MsgBoxWindow = {} 
MsgBoxText = {} 
  
MsgBoxWindow = guiCreateWindow(0.3984,0.3841,0.2061,0.1901,"Info",true) 
guiSetAlpha(MsgBoxWindow,0.
MsgBoxText = guiCreateLabel(0.1991,0.2808,0.5498,0.4726,"",true,MsgBoxWindow) 
guiSetVisible(MsgBoxWindow, false) 
showCursor(false) 
  
function newmsgbox(co) 
guiSetVisible(MsgBoxWindow, true) 
guiSetText(MsgBoxText, tostring(co)) 
showCursor(false) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.70000000000000) end, 300, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.60000000000000) end, 700, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.50000000000000) end, 1000, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.40000000000000) end, 1300, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.30000000000000) end, 1500, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.20000000000000) end, 1800, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.10000000000000) end, 2000, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.00000000000000) end, 2300, 1) 
setTimer(function() guiSetVisible(MsgBoxWindow, false) end, 2300, 1) 
end 
  
addEvent("msgBoxInfo", true) 
addEventHandler("msgBoxInfo", getRootElement(), newmsgbox) 
  
if ( isPlayerWasted () then 
    triggerEvent("msgBoxInfo", getRootElement(), "my text") 
end 
  

the type is client.

Posted
MsgBoxWindow = {} 
MsgBoxText = {} 
  
MsgBoxWindow = guiCreateWindow(0.3984,0.3841,0.2061,0.1901,"Info",true) 
guiSetAlpha(MsgBoxWindow, 0.80) 
MsgBoxText = guiCreateLabel(0.1991,0.2808,0.5498,0.4726,"",true,MsgBoxWindow) 
guiSetVisible(MsgBoxWindow, false) 
showCursor(false) 
  
function newmsgbox(co) 
guiSetVisible(MsgBoxWindow, true) 
guiSetText(MsgBoxText, tostring(co)) 
showCursor(false) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.70000000000000) end, 300, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.60000000000000) end, 700, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.50000000000000) end, 1000, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.40000000000000) end, 1300, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.30000000000000) end, 1500, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.20000000000000) end, 1800, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.10000000000000) end, 2000, 1) 
setTimer(function() guiSetAlpha(MsgBoxWindow,0.00000000000000) end, 2300, 1) 
setTimer(function() guiSetVisible(MsgBoxWindow, false) end, 2300, 1) 
end 
addEvent("msgBoxInfo", true) 
addEventHandler("msgBoxInfo", getRootElement(), newmsgbox) 
  
addEventHandler("onClientPlayerWasted",localPlayer, 
    function () 
        triggerEvent("msgBoxInfo", localPlayer, "my text") 
    end 
) 

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