Hallo Brotfische,
Ich habe eine Problem mit dem public "OnPlayerText", undzwar wenn ich z.B Hallo schreibe kommt das ganze im Chat zweimal anstatt einmal.
Ich schreibe Hallo:
German_ScripterHD: Hallo
German_ScripterHD: Hallo
aber es sollte so sein:
German_ScripterHD: Hallo
Codes:
public OnPlayerText(playerid, text[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new string[150];
if(supduty[playerid]==1)
{
format(string,sizeof(string), "{C800FF}%s: {FFFFFF}%s",getPlayerName(playerid), text);
}
else
{
format(string,sizeof(string), "%s: %s",getPlayerName(playerid), text);
}
new chat_color;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
if(!IsPlayerInRangeOfPoint(i, CHAT_RADIUS, x, y, z))continue;
if(GetPlayerVirtualWorld(i)!=GetPlayerVirtualWorld(playerid)) continue;
new Float:distance = GetPlayerDistanceFromPoint(i, x, y, z);
if(distance < CHAT_RADIUS / CHAT_FADES)
{
chat_color = COLOR_CHAT;
}
else if(distance < CHAT_RADIUS / CHAT_FADES * 2)
{
chat_color = COLOR_FADE1;
}
else if(distance < CHAT_RADIUS / CHAT_FADES * 3)
{
chat_color = COLOR_FADE2;
}
else if(distance < CHAT_RADIUS / CHAT_FADES * 4)
{
chat_color = COLOR_FADE3;
}
else if(distance <= CHAT_RADIUS / CHAT_FADES * 5)
{
chat_color = COLOR_FADE4;
}
SendClientMessage(i, chat_color, string);
}
SetPlayerChatBubble(playerid,text,C_Weiß, 100.0, 10000);
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
new Length = strlen(text);
new aTime = Length*400;
ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1,1,0,aTime);
return 1;
}
return 0;
}
Ich hoffe es kann mir jemand helfen