Multiple SSCANF checks not working.
#2

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
The title really says it all but for note, When i use /company invite it will show the useage but after putting my id in witch is 0 (/company invite 0) none of the code is used after that. EG Messages.

pawn Код:
COMMAND:company(playerid, params[], option[])
{
    if(sscanf(params, "s[10]", option))
    {
        SendClientMessage(playerid, COLOR_WHITE, "{C2A2DA}Usage{FFFFFF}: /company [option]");
        SendClientMessage(playerid,COLOR_YELLOW2,"Actions: members, invite, uninvite, setrank");
        SendClientMessage(playerid,COLOR_YELLOW2,"Actions:");
    }

    if(strcmp(option,"invite",true) == 0)
    {
        new InviteID;
        if(sscanf(params, "d", InviteID))  return SendClientMessage(playerid, COLOR_WHITE, "{C2A2DA}Usage{FFFFFF}: /company invite [playerid]");
        {
            if(!IsPlayerConnected(InviteID)) return SendClientMessage(playerid, COLOR_WHITE, "[{FF6347}Error{FFFFFF}]: This person is not connect or you have provided an invalid id.");

            if(CharacterInfo[InviteID][cCompany] > 0)
            {
                CharacterInfo[InviteID][cCompany] = CharacterInfo[playerid][cCompany];
                format(CharacterInfo[InviteID][cCompanyRank], 32, "No Rank");

                SendClientMessage(InviteID, COLOR_YELLOW2, "You have been invited to a company.");
                SendClientMessage(playerid, COLOR_YELLOW2, "You have invited another player to your company.");
                SendClientMessage(playerid, COLOR_YELLOW2, "Make sure you set this players rank.");

            } else SendClientMessage(playerid, COLOR_WHITE, "[{FF6347}Error{FFFFFF}]: This person is already a member of another company..");
        }
    }
}
Have you tried using a "i" instead of a "d" in this line?

Код:
 if(sscanf(params, "d", InviteID))  return SendClientMessage(playerid, COLOR_WHITE, "{C2A2DA}Usage{FFFFFF}: /company invite [playerid]");
Cause "i" is integer, try using that, may work.
Reply


Messages In This Thread
Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 13:59
Re: Multiple SSCANF checks not working. - by KtotheYle - 07.01.2014, 14:02
Re: Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 14:05
Re: Multiple SSCANF checks not working. - by CutX - 07.01.2014, 14:21
Re: Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 14:42
Re: Multiple SSCANF checks not working. - by zT KiNgKoNg - 07.01.2014, 14:57

Forum Jump:


Users browsing this thread: 2 Guest(s)