28.11.2011, 18:54
Using zcmd:
pawn Код:
CMD:ooc( playerid, params[] )
{
if ( isnull ( params ) ) return SendClientMessage( playerid, -1, "Syntax /ooc [text]" );
/* check if command parameters are null */
new
szString[ 128 ],
PlayerName[ MAX_PLAYER_NAME ]
;
/* declare two arrays, first will hold the message second will hold the player name */
GetPlayerName( playerid, PlayerName, MAX_PLAYER_NAME );
/* get the playerid name and store it in the array playername */
format ( szString, sizeof ( szString ), "(( %s: %s ))", PlayerName, params );
/* format the message and store it in the array szString, %s inserts a string
first one will be for the player name and second one for the parameters (player text) */
SendClientMessageToAll( -1, szString );
/* send the message to all players */
return ( 1 ); /* return a true value */
}