onplayer StateChange()

Started by Spice, Aug 08, 2015, 07:39 AM

Previous topic - Next topic

Spice

i want if a player go on pause menu server auto genrate message player is away
i think this Event will be used onplayer StateChange but i dont know how to use it plz help me...

KAKAN

I too don't know it, but I can't understand what u mean
oh no

Thijn

I'm not sure if this is possible to detect.

Spice

or may be this event onplayer awayChange()......?

Diego^

#4
It can be used this way:

function onPlayerAwayChange( player, NewStatus )
{
if ( NewStatus == true ) Message( "[#FFFFFF]* [#FFA500]" + player.Name + " [#FFFFFF]is missing.");
else if ( NewStatus == false ) Message( "[#FFFFFF]* [#FFA500]" + player.Name + " [#FFFFFF]is online.");
}
BRL's Developer.

Thijn

== true is kinda unneeded, and the else if makes no sense. If it aint true, it must be false..

DizzasTeR

Since @Thijn already pointed out those things, here it is.

function onPlayerAwayChange( player, NewStatus )
{
if ( NewStatus ) Message( "[#FFFFFF]* [#FFA500]" + player.Name + " [#FFFFFF]is missing.");
else Message( "[#FFFFFF]* [#FFA500]" + player.Name + " [#FFFFFF]is online.");
}

Diego^

BRL's Developer.