27.07.2014, 19:29
Hi,
I have a problem.
I need that to chat write player name with his color name
I work but not work.
I have a problem.
I need that to chat write player name with his color name
I work but not work.
Код:
public OnPlayerText(playerid, text[])
{
new str[150];
strcat(str, text);
printf("str:{x} %s{FFFFFF}",GetPlayerColor(playerid),str);
for(new i; i < strlen(str); i++){
if(str[i] == '@'){
new findID[55];
new pos = strfind(str[i]," ");
if(pos == -1){
if(str[i] >= strlen(str)-4){
pos = -2;
}
}
if(pos == -1) continue;
if(pos == -2){
strmid(findID,str,i+1,strlen(str));
strdel(str, i,strlen(str));
}else{
strmid(findID,str,i+1,i+strfind(str[i]," "));
strdel(str, i,i+strfind(str[i]," "));
}
//strins(text, Nicks[strval(findID)], i,200);
new id = strval(findID);
if(IsPlayerConnected(id)){
new name[30];
GetPlayerName(id,name,30);
strins(str, name, i,30);
}
}
}
SendPlayerMessageToAll(playerid, str);
}


