23.12.2009, 23:57
Quote:
|
Originally Posted by fps_doug
/ me and /whisper commands by me
![]() Код:
#define COLOR_INFO 0x80FF0099//green #define COLOR_WHISPER 0xFFFF00AA//yellow Код:
if(!strcmp(cmdtext, "/me", true, 3))
{
if(!cmdtext[3])return SendClientMessage(playerid, COLOR_INFO, "[INFO] USAGE: /me [action]");
new str[128];
format(str, sizeof(str), "* %s",cmdtext[4]);
SetPlayerChatBubble(playerid, str, COLOR_WHITE, 150.0, 10000);
SendClientMessage(playerid, COLOR_INFO, "[INFO] Message Displaying for 10 seconds.");
return 1;
}
Код:
if(!strcmp(cmdtext, "/whisper", true, 8))
{
if(!cmdtext[8])return SendClientMessage(playerid, COLOR_WHISPER, "[WHISPER] USAGE: /whisper [text]");
new playername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"[WHISPER] %s: %s",playername,cmdtext[9]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetDistanceBetweenPlayers(playerid,i) < 15)
{
SendClientMessage(i,COLOR_WHISPER,string);
}
}
}
return 1;
}
|
Код:
if(!strcmp ..
For example:
pawn Код:
if(!strcmp(cmdtext, "/me", true, 3)) // if string entered does not match "/me" do not continue
{ // continue with processing if it isn't "/me"


