dcmd_makefaction(playerid,params[])
{
new fname,fleader,fmoney,ftype,str[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"[System] You need to be admin to use this command.");
if(sscanf(params, "ssds", fname, fleader, fmoney, ftype)) return SendClientMessage(playerid, COLOR_RED, "[System]Usage: /makefaction [Faction Name] [Faction Leader] [Faction Money] [Faction Type]");
format(str,sizeof(str),"You have made Faction: %s with the leader: %s and money: %s Type: %s",fname,fleader,fmoney, ftype);
SendClientMessage(playerid,COLOR_BLUE,str);
for(new i = 0; i < sizeof(FactionInfo); i++)
{
FactionInfo[i][FactionName] = fname;
FactionInfo[i][FactionLeader] = fleader;
FactionInfo[i][FactionMoney] = fmoney;
FactionInfo[i][FactionType] = ftype;
return 1;
}
return 1;
}
dcmd_deletefaction(playerid,params[])
{
new fname,str[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"[System] You need to be admin to use this command.");
if(sscanf(params,"s",fname)) return SendClientMessage(playerid,COLOR_RED,"[System]Usage: /deletefaction [FactionName]");
if(strfind(Ffile,FactionInfo[fname][FactionName],false) == -1) return SendClientMessage(playerid,COLOR_RED,"[System] Faction not found.");
{
for(new i = 0; i < sizeof(FactionInfo); i++)
{
// First of all.. what do i need to type here. i got a Factions.ini in my scriptfiles folder
// But it'll have more factions.. I want to delete one entire faction.
format(str,sizeof(str),"You have deleted the faction: %s",fname);
SendClientMessage(playerid,COLOR_YELLOW,str);
return 1;
}
}
return 1;
}
I am a good scripter but i haven't scripted PAWN for like 1-2 months so i dont know how to figure it out.
|
dcmd_makefaction(playerid,params[])
{
new fname[24],fleader[24],fmoney,ftype[24],str[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"[System] You need to be admin to use this command.");
if(sscanf(params, "s[24]s[24]ds[24]", fname, fleader, fmoney, ftype)) return SendClientMessage(playerid, COLOR_RED, "[System]Usage: /makefaction [Faction Name] [Faction Leader] [Faction Money] [Faction Type]");
format(str,sizeof(str),"You have made Faction: %s with the leader: %s and money: %s Type: %s",fname,fleader,fmoney, ftype);
SendClientMessage(playerid,COLOR_BLUE,str);
for(new i = 0; i < sizeof(FactionInfo); i++)
{
FactionInfo[i][FactionName] = fname;
FactionInfo[i][FactionLeader] = fleader;
FactionInfo[i][FactionMoney] = fmoney;
FactionInfo[i][FactionType] = ftype;
return 1;
}
return 1;
}