Player Chat Function Need Help

Started by Yankee, Aug 30, 2017, 07:35 PM

Previous topic - Next topic

Yankee

Hi,I make this function and it make the server crashed.I'm not good at scripting.Can someone fix it.I want players can't type without spawn.
function onPlayerChat( player, text )
{
if ( !player.IsSpawned ) MessagePlayer( "[#FF0000][ERROR] - [#F7FE2E]You have to be spawned.", player );
else print( player.Name + ": " + text );
return 1;
}

Xenon

try ;p
function onPlayerChat( player, text ) {
if ( !player.IsSpawned ){
MessagePlayer( "[#FF0000][ERROR] - [#F7FE2E]You have to be spawned.", player );
return 0;
}
else print( player.Name + ": " + text );
return 1;
}