22.01.2010, 14:41
This is the code i have
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
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;
}
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