SendPlayerMessage

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

Sends a message faking another players message

Syntax

  1. 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.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "fakemessage" )
  5. {
  6. local pPlayer2 = FindPlayer( "Bob" );
  7. if ( pPlayer2 ) SendPlayerMessage( pPlayer2, pPlayer, "BOOBIES!" );
  8. }
  9. return 1;
  10. }
  11.  

Notes

The function FindPlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox