15.11.2014, 17:58
Can i optimize this code?:
Thx!
pawn Код:
stock SendMessage(playerid, phrase[])
{
new Nom[MAX_PLAYER_NAME];
new str[256], str2[256], phrase2[256];
GetPlayerName(playerid, Nom, sizeof(Nom));
if(strlen(phrase) > 70)
{
strmid(str2, phrase, 70, strlen(phrase));
strmid(phrase2, phrase, 0, 70);
format(str,sizeof(str),"%s dit : %s ..." ,Nom, phrase2);
SendClientMessage(playerid, 0xFFFFFFFF,str);
format(str,sizeof(str),"* ... %s" ,str2);
SendClientMessage(playerid, 0xFFFFFFFF,str);
return 1;
}
format(str,sizeof(str),"%s dit : %s" ,phrase, Nom);
SendClientMessage(playerid, 0xFFFFFFFF,str);
return 1;
}