Opis problema: Kad napisem nesto na /m ispise samo [Policajac Nacelnik😮< John_Conor]
Dio skripte:
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristite: (/m)egaphone [megaphone chat]");
return 1;
}
new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
for(new b = 0; b < sizeof brojevi; b++)
{
new tekst = strlen(result);
for(new i = 0; i
if(result == brojevi)
result = '*' ;
}
}
if(gTeam == 2 || IsACop(playerid) || IsAnFbiCar(playerid))
{
if(!IsACopCar(tmpcar) || !IsAnFbiCar(tmpcar))
{
if(PlayerInfo == 1||PlayerInfo == 1)
{
new currank;
if(PlayerInfo == 1) { currank = "Kadet"; }
else if(PlayerInfo == 2) { currank = "Police Officer"; }
else if(PlayerInfo == 3) { currank = "Corporal"; }
else if(PlayerInfo == 4) { currank = "Sergeant"; }
else if(PlayerInfo == 5) { currank = "Lieutenant"; }
else if(PlayerInfo == 6) { currank = "Nacelnik"; }
else { currank = "Cadet"; }
format(string, sizeof(string), "[Polcajac %s😮< %s]", currank, sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo == 2||PlayerInfo == 2)
{
format(string, sizeof(string), "[Agent %s😮< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
printf("%s", string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Niste u policijskom vozilu!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Niste policajac!");
return 1;
}
}
return 1;
}
