11.08.2014, 11:20
How i can make the FBI do /megaphone (( /m ))
i have this code but they cant
i have this code but they cant
pawn Code:
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new type = FactionInfo[PlayerInfo[playerid][pMember]][FactionType];
new tmpcar = GetPlayerVehicleID(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_WHITE, "USAGE: (/m)egaphone [megaphone chat]");
return 1;
}
if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4|| IsASoldier(playerid))
{
if(!IsACopCar(tmpcar) && !IsAFBICar(tmpcar) && !IsAnAmbulance(tmpcar) && !IsANGCar(tmpcar))
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a Government vehicle !");
return 1;
}
else if(IsACop(playerid))
{
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);
}
else if(type == 2)
{
format(string, sizeof(string), "[Agent %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(IsAMedic(playerid))
{
format(string, sizeof(string), "[Doctor %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(IsASoldier(playerid))
{
format(string, sizeof(string), "[Soldier %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not part of a Faction !");
return 1;
}
}
return 1;
}