Dynamic Faction System
#1

Hello all, it been a long time ago since i posted here.

I need some help with my scratch RP server together with my friend.
I wanted to make a command /makefaction and /deletefaction. But i've got a problem. Both of them don't work.
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.
By typing /deletefaction and /makefaction it works correct. once im setting parameters it gives Unknown Command.
Please don't tell me to use zcmd.. im using dcmd.
heres the code.

pawn Code:
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;
}
Reply


Messages In This Thread
Dynamic Faction System - by Mike_Peterson - 24.03.2011, 10:56
Re: Dynamic Faction System - by Mike_Peterson - 24.03.2011, 13:25
Re: Dynamic Faction System - by Biesmen - 24.03.2011, 13:44
Re: Dynamic Faction System - by Mike_Peterson - 24.03.2011, 14:45
Re: Dynamic Faction System - by antonio112 - 24.03.2011, 16:49
Re: Dynamic Faction System - by Macluawn - 24.03.2011, 16:58

Forum Jump:


Users browsing this thread: 2 Guest(s)