22.01.2010, 12:10
My code:
How would i make that,
So you can only use it, If your a cop, And only if your in a cop car
How would i do that?
Because i tried, But it dosent let me use the command if im in a copcar,
But it does if im not in one,
Because it just showed
!Test
In the chatbox
pawn Code:
if(text[0] == '!')
{
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 you can only use it, If your a cop, And only if your in a cop car
pawn Code:
if(IsACopCar(vehicleid);
Because i tried, But it dosent let me use the command if im in a copcar,
But it does if im not in one,
Because it just showed
!Test
In the chatbox