SendPlayerMessage
From Liberty Unleashed Wiki
Sends a message faking another players message
Syntax
bool SendPlayerMessage( player playerToFake, player playerToSendTo, string message )
Arguments
- playerToFake - The pointer of the player to fake
- playerToSendTo - The pointer of the player to send the fake message to
- message - The message to send
Example
This will send a fake message to the player who typed '/fakemessage', it will be shown as coming from 'Bob' if they are on the server.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "fakemessage" ) { local pPlayer2 = FindPlayer( "Bob" ); if ( pPlayer2 ) SendPlayerMessage( pPlayer2, pPlayer, "BOOBIES!" ); } return 1; }
Notes
The function FindPlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.
Related Functions
- BigMessage
- ClearMessages
- Message
- MessageAllExcept
- MessagePlayer
-
PagerMessage
- SendPlayerMessage
- SmallMessage