Is there something wrong in this command?
#1

PHP код:
CMD:fdelete(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= && PlayerInfo[playerid][pGangMod] > || PlayerInfo[playerid][pAdmin] >= 3)
    {
        if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 5)
              return 
SendClientMessage(playerid,COLOR_WHITE"You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
        new 
family;
        if(
sscanf(params"d"family))
            return 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /fdelete [familyid]");
        if(
family || family 10)
        {
            
SendClientMessage(playeridCOLOR_GREY"   Gang Slot can't be below 1 or above 10!");
            return 
1;
        }
        if(
FamilyInfo[family-1][FamilyTaken] != 1)
        {
            
SendClientMessage(playeridCOLOR_GREY"   That Gang Slot isn't taken!");
            return 
1;
        }
//Works until here
        
ClearFamily(family);
        
SaveGangs();
        for(new 
i=0MAX_POINTSi++)
        {
            if(
Points[i][OwnerTeam] == family)
            {
                
Points[i][OwnerTeam] = 0;
            }
        }
    }
    return 
1;

Whenever I use it on a family, it sends the client the unknown command error.
Reply
#2

Is this from a filterscirpt?
Are you using more than one command processor ?
Reply
#3

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
Is this from a filterscirpt?
Are you using more than one command processor ?
No, this isn't from a filterscript. It's from the main gamemode
No, I'm only using ZCMD
Reply
#4

Quote:
Originally Posted by NealPeteros
Посмотреть сообщение
PHP код:
CMD:fdelete(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < && PlayerInfo[playerid][pGangMod] < || PlayerInfo[playerid][pAdmin] < 3) return 0;
        if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 5)
              return 
SendClientMessage(playerid,COLOR_WHITE"You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
        new 
family;
        if(
sscanf(params"d"family))
            return 
SendClientMessage(playeridCOLOR_WHITE"USAGE: /fdelete [familyid]");
        if(
family || family 10)
        {
            
SendClientMessage(playeridCOLOR_GREY"   Gang Slot can't be below 1 or above 10!");
            return 
1;
        }
        if(
FamilyInfo[family-1][FamilyTaken] != 1)
        {
            
SendClientMessage(playeridCOLOR_GREY"   That Gang Slot isn't taken!");
            return 
1;
        }
//Works until here
        
ClearFamily(family);
        
SaveGangs();
        for(new 
i=0MAX_POINTSi++)
        {
            if(
Points[i][OwnerTeam] == family)
            {
                
Points[i][OwnerTeam] = 0;
            }
        }
    return 
1;

Whenever I use it on a family, it sends the client the unknown command error.
Not sure but try this.
Take every line back on identitation
Reply
#5

Quote:
Originally Posted by saffierr
Посмотреть сообщение
Not sure but try this.
Take every line back on identitation
What do you mean?
Reply
#6

I am on my phone, so I can't be arsed to get every line of your code back so it's actually in line with the 'return 1;'
Try my code.
Reply
#7

There are many returns on the code. Kindly be specific
Reply
#8

Код:
CMD:fdelete(playerid, params[]) 
{ 
    if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pGangMod] > 1 || PlayerInfo[playerid][pAdmin] >= 3) 
    { 
        if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5) 
              return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty."); 

        new family; 
        if(sscanf(params, "d", family)) 
            return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fdelete [familyid]"); 

        if(family < 1 || family > 10)
        	return SendClientMessage(playerid, COLOR_GREY, "Gang slot can't be below 1 or above!");

        if(FamilyInfo[family-1][FamilyTaken != 1])
        	return SendClientMessage(playerid, COLOR_GREY, "   That Gang Slot isn't taken!"); 

        ClearFamily(family); 
        SaveGangs(); 
        for(new i=0; i < MAX_POINTS; i++) 
        { 
            if(Points[i][OwnerTeam] == family) 
            { 
                Points[i][OwnerTeam] = 0; 
            } 
        } 
    } 
    return 1; 
}
Reply
#9

Show us your functions ClearFamily & SaveGangs.
Reply
#10

try this
Код:
change this :
if(FamilyInfo[family-1][FamilyTaken] != 1) 
{ 
SendClientMessage(playerid, COLOR_GREY,"That Gang Slot isn't taken!"); 
return1; 
}
to this
if(FamilyInfo[family-1][FamilyTaken]!=1) return SendClientMessage(playerid, COLOR_GREY, "That Gang Slot isn't taken!"); 
or  to this:
if(FamilyInfo[family-1][FamilyTaken]!=1)
           return SendClientMessage(playerid, COLOR_GREY, "That Gang Slot isn't taken!");
hop it help you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)