/pm system how?
#1

hello how can i put like this /pm hey , then the other person see's your after they received it like this?

/pm 4 hey

[PM] Tommy_Green [ID3]: Hello Sir?

Код:
CMD:pm( playerid, params[ ] )
{

    new
        iTarget,
        szMsg[ 100 ];

    if ( sscanf( params, "rs[100]", iTarget, szMsg ) )
    {
        return SendClientMessage( playerid, 0xFF3333AA, "[USAGE]: /pm ( id) ( message )" );

    }

    if ( iTarget == INVALID_PLAYER_ID )
    {
        return SendClientMessage( playerid, 0xFF3333AA, "[ERROR]: That player is not connected!" );

    }

    new
        szStr[ 128 ];
    new
        pName[ MAX_PLAYER_NAME ],
        tName[ MAX_PLAYER_NAME ];

    GetPlayerName( playerid, pName, MAX_PLAYER_NAME );


    GetPlayerName( iTarget, tName, MAX_PLAYER_NAME );

    format( szStr, sizeof ( szStr ), "[PM send from %s]: %s", pName, szMsg );


    SendClientMessage( iTarget, 0x33FF33AA, szStr );

    format( szStr, sizeof ( szStr ), "[PM send to %s]: %s", tName, szMsg );


    SendClientMessage( playerid, 0x33FF33AA, szStr );


    return true;
}
Reply
#2

This should work how you want it to.

pawn Код:
CMD:pm( playerid, params[ ] )
{
    new iTarget, szMsg[ 100 ];

    if ( sscanf( params, "rs[100]", iTarget, szMsg ) )
    {
        return SendClientMessage( playerid, 0xFF3333AA, "[USAGE]: /pm ( id) ( message )" );
    }

    if ( iTarget == INVALID_PLAYER_ID )
    {
        return SendClientMessage( playerid, 0xFF3333AA, "[ERROR]: That player is not connected!" );
    }

    new szStr[ 128 ];
    new pName[ MAX_PLAYER_NAME ], tName[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
    GetPlayerName( iTarget, tName, MAX_PLAYER_NAME );
    format( szStr, sizeof ( szStr ), "[PM] %s [ID:%i]: %s", pName, playerid, szMsg );
    SendClientMessage( iTarget, 0x33FF33AA, szStr );
    format( szStr, sizeof ( szStr ), "[PM] Sent to %s [ID:%i]: %s", tName, iTarget, szMsg );
    SendClientMessage( playerid, 0x33FF33AA, szStr );
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)