10.05.2010, 14:29
pawn Код:
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
new tmpcar = GetVehicleModel(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/m)egaphone [megaphone chat]");
return 1;
}
if (gTeam[playerid] != 2)
{
SendClientMessage(playerid, COLOR_GRAD2, " you are not part of a team");
return 1;
}
if(!IsACopCar(tmpcar))
{
SendClientMessage(playerid, COLOR_GRAD2, " you are not in a police vehicle");
return 1;
}
else
{
format(string, sizeof(string), "[Officer %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
printf("%s", string);
return 1;
}
}
pawn Код:
public IsACopCar(carid)
{
if((carid >= 35) && (carid <= 60))
{
return 1;
}
return 0;
}
I need to know why the carid is 35 - 60, while the vehicle ID's for the police cars are 596-599 & 601.
The command also tells me that "I'm not in a police vehicle". While I am.
It's PenSF so yeah.. It might not be 0.3 compatible. Could anyone tell me if this has any incompatibility?