Other teams can use the megaphone
#1

This is the code i have
pawn Код:
if(text[0] == '!')
{
  //if(!IsPlayerCop(playerid) || IsACopCar(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_RED, "You are not a cop and/or not in a cop car");
  if(IsPlayerCop(playerid) || IsACopCar(GetPlayerVehicleID(playerid)))
    {
    new string[128];  GetPlayerName(playerid, string, sizeof(string));
    format(string, sizeof(string), ">>>Megaphone [%s]: >>%s!!!", string, text[1]);
    printf("%s", string);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    if(GetDistanceBetweenPlayers(playerid, i) < 7.0)
    {
    SendClientMessage(i, COLOR_YELLOW, string);
    }
    }
    }
    }
return 0;
}
And if im a cop and i say !Test, It says im not a cop and/or not in a car,
So if i get in the car then say it, It works,
But that was when i was testing with 1 team,
Now i have 2, And i spawn as the 2nd team ( Crooks )
And type the !Test on foot,
And it works, It lets that team do the megaphone., But it shouldnt,
same when there in a car,
How to stop that,

If you need more code, Just ask
Reply


Messages In This Thread
Other teams can use the megaphone - by JoeDaDude - 22.01.2010, 14:41
Re: Other teams can use the megaphone - by KnooL - 22.01.2010, 15:47
Re: Other teams can use the megaphone - by JoeDaDude - 22.01.2010, 15:54
Re: Other teams can use the megaphone - by KnooL - 22.01.2010, 16:01
Re: Other teams can use the megaphone - by JoeDaDude - 22.01.2010, 16:10
Re: Other teams can use the megaphone - by KnooL - 22.01.2010, 16:14
Re: Other teams can use the megaphone - by JoeDaDude - 22.01.2010, 16:25
Re: Other teams can use the megaphone - by KnooL - 22.01.2010, 16:33
Re: Other teams can use the megaphone - by JoeDaDude - 22.01.2010, 16:37
Re: Other teams can use the megaphone - by KnooL - 22.01.2010, 16:45

Forum Jump:


Users browsing this thread: 5 Guest(s)