28.09.2014, 22:51
Alright, I need help with creating a local chat command.
Please use <a_samp>. Thanks alot.
Please use <a_samp>. Thanks alot.
public OnPlayerText(playerid,text[]) { new name[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s: %s", name, text); SendLocalMessage(playerid, COLOR_WHITE, 7,string);// Send the message return 0; // Makes sure the original message isn't send }
CMD:asay(playerid, params[])
{
new message[128], string[128], talker;
if(sscanf(params,"s[128]", message))return SendClientMessage(playerid, GREY, "USAGE: /asay [text]");
GetPlayerName(playerid, talker, sizeof(talker))
format(string, sizeof(string), "(( %s says: %s ))", talker, message);
SendClientMessageToAll(0xffffff, string);
return 1;
}
Here you are
pawn Код:
|
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/say",true,4))
{
if(!cmdtext[4]) return SendClientMessage(playerid,-1,"USAGE:/say [text]");
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name))
format(string, sizeof(string), "(( %s)) says: %s ", name, cmdtext[5]);
return SendClientMessageToAll(0xffffff, string);
}
return 1;
}
error 001: expected token: ";", but found "-identifier-"