Jump to content
  • SA:MP
    SA:MP
    Only Launcher

    Owner

    GreenStone Community

[TUTORIAL] Comanda [/pm]


Recommended Posts


    CMD:pm( playerid, params[ ] )

    {

    new gMessage[ 128 ], Message[ 128 ];

    new pNames[MAX_PLAYER_NAME], iName[ MAX_PLAYER_NAME ];

    if( sscanf( params, "us[128]", params[ 0 ], params[ 1 ] ) ) return SendClientMessage( playerid, ADMINFS_MESSAGE_COLOR, "Usage: /pm (id) (message)" );

    if( !IsPlayerConnected( params[ 0 ] ) ) return SendClientMessage( playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID" );

    if( playerid == params[ 0 ] ) return SendClientMessage( playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself" );

    GetPlayerName( params[ 0 ], iName, MAX_PLAYER_NAME );

    GetPlayerName( playerid, pNames, MAX_PLAYER_NAME );

    format( Message, 128,">> %s(%d): %s", iName, params[ 0 ], gMessage );

    SendClientMessage( playerid, PM_OUTGOING_COLOR, Message );

    format( Message, 128,"** %s(%d): %s", pNames, playerid, gMessage );

    SendClientMessage( params[ 0 ], PM_INCOMING_COLOR, Message );

    PlayerPlaySound( params[ 0 ], 1085, 0.0, 0.0, 0.0 );

    return 1;

}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...