14.12.2014, 11:27
(
Последний раз редактировалось hesambia; 14.12.2014 в 11:59.
)
PHP код:
public OnPlayerText(playerid, text[]) {
new txt[128];
if (strlen(text) > 2 && text[0] == '!' && text[1] == '!') {
if (PlayerInfo[playerid][pAdmin] < 1) {
SendChatMessage(playerid, -1, Error("Admin Permissions Needed!"));
return 0;
}
strdel(text,0,2);
format(txt,sizeof(txt),"[ADMIN] %s (Rate: %d): %s",GetPlayerNameEx(playerid),PlayerInfo[playerid][pAdmin],text);
SendAdminMessage(COLOR_LIME,txt);
return 0;
}
if (IsPlayerTalkingWithCellphone(playerid)) {
format(txt,sizeof(txt),"[MOBILE] %s : %s",GetPlayerNameEx(playerid),text);
SendLocalMessage(TALK_RANGE,playerid,txt,COLOR_CHAT_ONE,COLOR_CHAT_TWO,COLOR_CHAT_THREE,COLOR_CHAT_FOUR,COLOR_CHAT_FIVE);
SendChatMessage(GetPlayerCaller(playerid),COLOR_CHAT_ONE,txt);
return 0;
}
if (strlen(text) > 2 && text[0] == '(' && text[1] == '(' && text[strlen(text) - 1] == ')' && text[strlen(text) - 2] == ')') {
strdel(text,0,2);
strdel(text,strlen(text) - 2,strlen(text) - 1);
format(txt,sizeof(txt),"%s : (( %s ))",GetPlayerNameEx(playerid),text);
}
else {
format(txt,sizeof(txt),"%s Says: %s",GetPlayerNameEx(playerid),text);
}
SendLocalMessage(TALK_RANGE,playerid,txt,COLOR_CHAT_ONE,COLOR_CHAT_TWO,COLOR_CHAT_THREE,COLOR_CHAT_FOUR,COLOR_CHAT_FIVE);
SetPlayerChatBubble(playerid,text,COLOR_White,50.0,CHAT_BUBBLE_TIME);
return 0;
}
(Sorry for english)
[EDIT] Note: i have a macro similar to this: #define SendChatMessage SendClientMessage