if(GetPlayerState(playerid) == PLAYER_STATE_SPAWNED)
{
if(PlayerTemp[playerid][muted]==0)
{
new sender[MAX_STRING];
if(PlayerTemp[playerid][phone]!=0)
{
if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,iStr);
else myStrcpy(sender,RPName(playerid));
if(text[0]== '(')
{
new mid[MAX_STRING];
strmid(mid,text,1,256,sizeof(mid));
text[0] = toupper(text[0]);
format(stringa,sizeof(stringa),"(Phone) %s says: (( %s ))",RPName(playerid),mid);
}
else
{
text[0] = toupper(text[0]);
format(stringa,sizeof(stringa),"(Phone) %s says: %s",sender,text);
SendClientMessage(PlayerTemp[playerid][onphone],COLOR_YELLOW,stringa);
}
}
else
{
if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,iStr);
else myStrcpy(sender,RPName(playerid));
if(text[0]== '(')
{
new mid[MAX_STRING];
strmid(mid,text,1,256,sizeof(mid));
format(iStr, sizeof(iStr), "(( %s ))", mid);
SetPlayerChatBubble(playerid,iStr,COLOR_WHITE, 50.0 , 5000);
format(stringa,sizeof(stringa),"%s says: (( %s ))",RPName(playerid),mid);
}
else
{
text[0] = toupper(text[0]);
SetPlayerChatBubble(playerid,text,COLOR_WHITE, 50.0 , 5000);
if(!strcmp(PlayerInfo[playerid][accent],"unset"))
{
format(iStr, sizeof(iStr),": ");
}
else
{
format(iStr,sizeof(iStr),": [%s Accent] ",PlayerInfo[playerid][accent]);
}
format(stringa,sizeof(stringa),"%s says%s%s",sender,iStr,text);
}
}
PlayerLoop(i)
{
if(!IsPlayerConnected(i)) continue;
if(!IsPlayerInRangeOfPoint(i, 60.0, px,py,pz)) continue;
if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(playerid) || GetPlayerInterior(i) != GetPlayerInterior(playerid)) continue;
new Float:dis;
dis= GetDistanceBetweenPlayers(playerid,i);
if(dis>45) SendClientMessage(i,COLOR_PLAYER_DARKGREY,stringa);
if(dis<=35 && dis >15) SendClientMessage(i,COLOR_PLAYER_GREY,stringa);
if(dis<=15) SendClientMessage(i,COLOR_PLAYER_WHITE,stringa);
}
strdel(stringa,0,strlen(PlayerName(playerid))+7);
new tmpStr[ 144 ];
if(text[0]== '(')
{
new mid[MAX_STRING];
strmid(mid,text,1,256,sizeof(mid));
format(tmpStr, 164, "7%s[%d]: (( %s ))", RPName(playerid), playerid, mid);
text[0] = toupper(text[0]);
iEcho(tmpStr, IRC_LIVE);
}
else
{
format(tmpStr, 164, "7%s[%d]: %s", RPName(playerid), playerid, text);
text[0] = toupper(text[0]);
iEcho(tmpStr ,IRC_LIVE);
}
if(stringContainsIP(text))
{
new wat[ 80 ];
//GetPlayerName(playerid, wat, 20);
format(wat, sizeof(wat),"IP Advertisments");//format(string, sizeof(string), "[!] \"%s\" named player has been banned from the server! [Reason: IP advertisements]", string);
return BanReas("SERVER",playerid,wat, 1), false;
}
}
else
{
SendClientMessage(playerid,COLOR_RED," You are muted!");
return 0;
}
}
else if(GetPlayerState(playerid) == PLAYER_STATE_WASTED)
{
SendClientError(playerid, "You cannot talk in local chat while dead!");
return 0;
}
It's working if I removed " GetPlayerState(playerid) " functions.
but if I added it, it's still working but the format won't appear. |
stock bool:IsPlayerSpawned(playerid)
{
new pState = GetPlayerState(playerid);
return 0 <= playerid < MAX_PLAYERS && pState != PLAYER_STATE_NONE && pState != PLAYER_STATE_WASTED && pState != PLAYER_STATE_SPECTATING;
}