Role Play Chat Commands
#2

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 */
}
Reply


Messages In This Thread
Role Play Chat Commands - by Jonesy96 - 28.11.2011, 18:48
Re: Role Play Chat Commands - by SmiT - 28.11.2011, 18:54
Re: Role Play Chat Commands - by Ash. - 28.11.2011, 18:54
Re: Role Play Chat Commands - by Jonesy96 - 28.11.2011, 18:57
Re: Role Play Chat Commands - by Ash. - 28.11.2011, 19:05
Re: Role Play Chat Commands - by Jonesy96 - 28.11.2011, 19:10
Re: Role Play Chat Commands - by BoboRi - 28.11.2011, 21:47
Re: Role Play Chat Commands - by Jonesy96 - 29.11.2011, 14:53
Re: Role Play Chat Commands - by Kostas' - 29.11.2011, 14:56
Re: Role Play Chat Commands - by Jonesy96 - 29.11.2011, 15:03

Forum Jump:


Users browsing this thread: 1 Guest(s)