SA-MP Forums Archive
Got a pawno error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Got a pawno error (/showthread.php?tid=471991)



Got a pawno error - thomaswilliams - 26.10.2013

I got this command to make families in my server

PHP код:
CMD:fcreate(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] > || PlayerInfo[playerid][pGangModerator] == 1)
    {
        new 
string[128], familygiveplayerid;
        if(
sscanf(params"du"familygiveplayerid)) return SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /fcreate [FamilyNr] [playerid]");
        if(
family || family 14) { SendClientMessageEx(playeridCOLOR_GREY"   Family Slot can't be below 1 or above 14!"); return 1; }
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
FamilyInfo[family-1][FamilyTaken] == 1)
            {
                
SendClientMessageEx(playeridCOLOR_GREY"   That Family Slot is already taken!" );
                return 
1;
            }
            
format(stringsizeof(string), "* You've made %s the Leader of Family Slot %d.",GetPlayerNameEx(giveplayerid),family);
            
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "* Admin %s has made you a Family Leader."GetPlayerNameEx(playerid));
            
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
            new 
sendername[MAX_PLAYER_NAME];
            
GetPlayerName(giveplayeridsendernamesizeof(sendername));
            
format(stringsizeof(string), "%s",sendername);
            
strmid(FamilyInfo[family-1][FamilyLeader], string0strlen(string), 24);
            
FamilyInfo[family-1][FamilyMembers] ++;
            
FamilyInfo[family-1][FamilyTaken] = 1;
            
PlayerInfo[giveplayerid][pFMember] = family-1;
            
PlayerInfo[giveplayerid][pRank] = 6;
            
SaveFamilies();
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_GREY"Invalid player specified.");
            return 
1;
        }
    }
    return 
1;

But when i do /fcreate [myid] [FamilySlotNumber] it just makes it for a different person and not me?


Re: Got a pawno error - PAF - 26.10.2013

show your errors dude


Re: Got a pawno error - thomaswilliams - 26.10.2013

It isn't a error its more of a not working properly command it just makes the family for someone else and not me


Re: Got a pawno error - Misiur - 26.10.2013

Quoting your code
Quote:

"USAGE: /fcreate [FamilyNr] [playerid]"




Re: Got a pawno error - thomaswilliams - 26.10.2013

What?


Re: Got a pawno error - MrTinder - 26.10.2013

try this:

Код:
CMD:fcreate(playerid, params[]) 
{ 
    if(PlayerInfo[playerid][pAdmin] > 3 || PlayerInfo[playerid][pGangModerator] == 1) 
    { 
        new string[128], family, giveplayerid; 
        if(sscanf(params, "dr", family, giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /fcreate [FamilyNr] [playerid]"); 
        if(family < 1 || family > 14) { SendClientMessageEx(playerid, COLOR_GREY, "   Family Slot can't be below 1 or above 14!"); return 1; } 

        if(IsPlayerConnected(giveplayerid)) 
        { 
            if(FamilyInfo[family-1][FamilyTaken] == 1) 
            { 
                SendClientMessageEx(playerid, COLOR_GREY, "   That Family Slot is already taken!" ); 
                return 1; 
            } 

            format(string, sizeof(string), "* You've made %s the Leader of Family Slot %d.",GetPlayerNameEx(giveplayerid),family); 
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); 
            format(string, sizeof(string), "* Admin %s has made you a Family Leader.", GetPlayerNameEx(playerid)); 
            SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); 

            new sendername[MAX_PLAYER_NAME]; 
            GetPlayerName(giveplayerid, sendername, sizeof(sendername)); 
            format(string, sizeof(string), "%s",sendername); 
            strmid(FamilyInfo[family-1][FamilyLeader], string, 0, strlen(string), 24); 
            FamilyInfo[family-1][FamilyMembers] ++; 
            FamilyInfo[family-1][FamilyTaken] = 1; 
            PlayerInfo[giveplayerid][pFMember] = family-1; 
            PlayerInfo[giveplayerid][pRank] = 6; 
            SaveFamilies(); 

        } 
        else 
        { 
            SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified."); 
            return 1; 
        } 
    } 
    return 1; 
}