29.01.2011, 11:19
Of course the server closes.
You missunderstood how to use SSCANF
You used playerid as a paramtere, also used strng to get player's name...
You missunderstood how to use SSCANF
pawn Код:
COMMAND:shout(playerid, params[])
{
if ( sscanf( params, "s", params[ 0 ] ) ) return SendClientMessage(playerid, Yellow, "Usage: /shout <message>");
new string[128],Name[ 20 ];
if ( ( GetTickCount( ) - LastShout[ playerid ] ) < 20 )
{
format(string, 128, "You have to wait %d seconds before shout", ( 20 - ( gGetTickCount( ) -LastShout[ playerid ] ) ) );
SendClientMessage( playerid, Red, string );
return 1;
}
GetPlayerName( playerid, Name, sizeof( Name ) );
format( string, sizeof( string ), "( SHOUT ) %s(ID: %d) %s:", Name, playerid, params[ 0 ]);
SendClientMessageToAll( White, string );
LastShout[ playerid ] = GetTickCount( );
return 1;
}