20.10.2013, 11:40
try this
pawn Код:
public OnPlayerText(playerid, text[])
{
IRC_GroupSayEx(gGroupID, IRC_AECHO_CHANNEL, "7[chat] 3%s (%d): %s", pNick(playerid), playerid, text);
new str[128];
if(PlayerStat[playerid][Logged] == 0)
{
SendClientMessage(playerid, GREY, "Tienes que estar logeado.");
return 0;
}
if(Server[CurrentGMX] >= 1)
{
SendClientMessage(playerid, GREY, "Espera a que el servidor se haya reinciado por completo.");
return 0;
}
if(PlayerStat[playerid][FullyRegistered] == 0)
{
SendClientMessage(playerid, GREY, "Tienes que aсadir informaciуn de tu personaje.");
return 0;
}
if(PlayerStat[playerid][Spawned] == 0)
{
SendClientMessage(playerid, GREY, "Tienes que estar dentro del servidor para hablar.");
return 0;
}
if(PlayerStat[playerid][Muted] == 1)
{
format(str, sizeof(str), "No puedes hablar, estбs muteado, tienes que esperar %d segundos.", PlayerStat[playerid][MuteTime]);
SendClientMessage(playerid, GREY, str);
return 0;
}
else
{
format(str, sizeof(str), "%s dice: %s", GetICName(playerid), text);
SendNearByMessage(playerid, WHITE, str, 5);
ICLog(str);
if(GetPlayerAnimationIndex(playerid)) // if player in vehicle this will be return 0
{
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(!strcmp(animlib, "PED", true) && !strcmp(animname, "IDLE_STANCE", true))
{
new Length = strlen(text);
new TalkTime = Length*100;
ApplyAnimation(playerid,"PED","IDLE_chat", 4.1, 0, 0, 0, 1, 1);
KillTimer(Server[StopTalkingAnimation]);
Server[StopTalkingAnimation] = SetTimerEx("StopTalkingAnim", TalkTime, 0, "d", playerid);
}
}
}
return 0;
}