02.07.2011, 17:57
Hello.
This really pisses me off. I need help. it's not that important what this If checks(I think) because it doen't enter in any of this two clausses.
It sends me Chat "NAME[orange]:text[white]" only, but why? It should enter one of this two clausses and send normal sentences. Please help me.
This really pisses me off. I need help. it's not that important what this If checks(I think) because it doen't enter in any of this two clausses.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(gCalled[gCalled[playerid]]!= -1 && gCalled[playerid]!=-1)
{
new string[MAX_STRING];
format(string,sizeof(string),"Cellphone: %s",text);
SendClientMessage(gCalled[playerid],COLOUR_YELLOW,string);
format(string,sizeof(string),"%s says: %s",gPLAYER_NAME[playerid],text);
GetPlayerPos(playerid, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]);
GetPlayerVirtualWorld(playerid);
GetPlayerInterior(playerid);
for(new i=0;i<gPlayers;i++)
{
if(IsPlayerInRangeOfPoint(i, 5.0, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]) && (GetPlayerInterior(playerid) == GetPlayerInterior(i)) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
SendClientMessage(i,COLOUR_WHITE, string);
}
else if(IsPlayerInRangeOfPoint(i, 10.0, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]) && (GetPlayerInterior(playerid) == GetPlayerInterior(i)) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
SendClientMessage(i,COLOUR_FADE4,string);
}
else if(IsPlayerInRangeOfPoint(i, 20.0, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]) && (GetPlayerInterior(playerid) == GetPlayerInterior(i)) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
SendClientMessage(i,COLOUR_FADE5,string);
}
}
}
else
{
new string[MAX_STRING];
format(string,sizeof(string),"%s says: %s",gPLAYER_NAME[playerid],text);
GetPlayerPos(playerid, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]);
GetPlayerVirtualWorld(playerid);
GetPlayerInterior(playerid);
for(new i=0;i<gPlayers;i++)
{
if(IsPlayerInRangeOfPoint(i, 5.0, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]) && (GetPlayerInterior(playerid) == GetPlayerInterior(i)) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
SendClientMessage(i,COLOUR_WHITE, string);
}
else if(IsPlayerInRangeOfPoint(i, 10.0, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]) && (GetPlayerInterior(playerid) == GetPlayerInterior(i)) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
SendClientMessage(i,COLOUR_FADE4,string);
}
else if(IsPlayerInRangeOfPoint(i, 20.0, PLAYER_XPOS[playerid], PLAYER_YPOS[playerid], PLAYER_ZPOS[playerid]) && (GetPlayerInterior(playerid) == GetPlayerInterior(i)) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
SendClientMessage(i,COLOUR_FADE5,string);
}
}
}
return 0;
}