07.10.2014, 15:03
pawn Код:
CMD:factioninfo(playerid, params[])
{
new string[128], factionname[32], success = -1;
if(sscanf(params, "s[32]", factionname)) return SendClientMessage(playerid, cred, "USAGE: /factioninfo [factionname]");
for(new i = 0; i <= Total_Factions_Created; i++)
{
if(!strcmp(factionname, fInfo[i][Name], true))
{
SendClientMessage(playerid, cwhite, "================Faction Info================");
format(string, sizeof(string), "Faction Name: %s", fInfo[i][Name]);
SendClientMessage(playerid, cwhite, string);
format(string, sizeof(string), "Faction ID: %d", i);
SendClientMessage(playerid, cwhite, string);
success = i;
break;
}
}
if(success == -1) return SendClientMessage(playerid, -1, "this faction doesn't exist!");
return 1;
}