02.02.2012, 08:41
So, /t is to talk on a phone, but it sends the message correct(1 time) to the reciever. but 4 times to the sender.
pawn Code:
CMD:t(playerid, params[])
{
if(isoncall[playerid] == true)
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /t [Text]");
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[phone]%s: %s", name, params);
foreach(Player, i)
{
if(callnumber[i] == PlayerInfo[playerid][PhoneNumber] && i != playerid) SendClientMessage(i, COLOR_PINK, string);
ProxDetector(10.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
}
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not on a call!");
return 1;
}