/f(action)r(adio) [text] /fr @ copy that.
[RADIO] Rank Player_Name: Badge copy that.
CMD:fr(playerid, params[]) { new text[128]; if(PlayerData[playerid][pFaction] == -1) return SendErrorMessage(playerid, "You must in faction member to use this command"); if (GetFactionType(playerid) == FACTION_GANG) return SendErrorMessage(playerid, "Family doesn't have faction radio."); if(sscanf(params,"s[128]",text)) return SendSyntaxMessage(playerid, "/f(action)r(adio) [text]"); if(strval(text) > 128) return SendErrorMessage(playerid,"Text too long."); if(strfind(text, "@", true, text[0])) { SendFactionMessage(PlayerData[playerid][pFaction], FactionData[PlayerData[playerid][pFaction]][factionColor], "[RADIO] %s %s: %s.%03d %s", Faction_GetRank(playerid),ReturnName2(playerid, 0), GetInitials(Faction_GetRank(playerid)), PlayerData[playerid][pBadge], text[1]); } else SendFactionMessage(PlayerData[playerid][pFaction], FactionData[PlayerData[playerid][pFaction]][factionColor], "[RADIO] %s %s: %s", Faction_GetRank(playerid),ReturnName2(playerid, 0), text); return 1; }
CMD:fr(playerid, params[])
{
new text[128];
if(PlayerData[playerid][pFaction] == -1) return SendErrorMessage(playerid, "You must in faction member to use this command");
if (GetFactionType(playerid) == FACTION_GANG) return SendErrorMessage(playerid, "Family doesn't have faction radio.");
if(sscanf(params,"s[128]",text)) return SendSyntaxMessage(playerid, "/f(action)r(adio) [text]");
if(strval(text) > 128) return SendErrorMessage(playerid,"Text too long.");
if(text[0] == '@')
{
SendFactionMessage(PlayerData[playerid][pFaction], FactionData[PlayerData[playerid][pFaction]][factionColor], "[RADIO] %s %s: %s.%03d %s", Faction_GetRank(playerid),ReturnName2(playerid, 0), GetInitials(Faction_GetRank(playerid)), PlayerData[playerid][pBadge], text[1]);
}
else
SendFactionMessage(PlayerData[playerid][pFaction], FactionData[PlayerData[playerid][pFaction]][factionColor], "[RADIO] %s %s: %s", Faction_GetRank(playerid),ReturnName2(playerid, 0), text);
return 1;
}
if(strfind(text, "@", true, text[0]))
strfind returns the index of where it is found, and you clearly want to see if they use @ as first character, so why not just check the first character like Rufio suggested?
even if you want to check if it does hold an @, you should do strfind(...) != -1 |