/pm system how? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /pm system how? (
/showthread.php?tid=445345)
/pm system how? -
NewLifeRoleplay - 20.06.2013
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;
}
Re: /pm system how? -
JJB562 - 20.06.2013
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;
}