Command help
#4

Quote:
Originally Posted by Stevee
Посмотреть сообщение
pawn Код:
CMD:showlicense(playerid, params[])
{
    new OtherPlayer;
   
    sscanf(params, "i", OtherPlayer) {
        if(playerVariables[playerid][pCarLic] == 0)
        {
            SendClientMessage(OtherPlayer, COLOR_WHITE, "|__________________ACTS INFO__________________|");
            SendClientMessage(OtherPlayer, COLOR_GREY, "Driver License: No");
        }
        else
        {
            SendClientMessage(OtherPlayer, COLOR_WHITE, "|__________________ACTS INFO__________________|");
            SendClientMessage(OtherPlayer, COLOR_GREY, "Driver License: Yes");
        }
        if(playerVariables[playerid][pPassport] == 0)
        {
            SendClientMessage(OtherPlayer, COLOR_GREY, "Passport: No");
        }
        else
        {
            SendClientMessage(OtherPlayer, COLOR_GREY, "Passport: Yes");
        }
    }
    else
    {
        SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/showlicense <OtherPlayer>\"");
    }
    return 1;
}
You can see if this works, I'm not a PAWN guru, so no guarantees!
Why would you use the i specifier instead of the u?
pawn Код:
CMD:showlicenses(playerid, params[])
{
    new
        targetid,
        string[128],
        name[MAX_PLAYER_NAME]
    ;
    if(sscanf(params, "u", targetid))
    {
        return SendClientMessage(playerid, -1, "USAGE: /showlicenses [playerid/PartOfName]");
    }
    if(targetid == INVALID_PLAYER_ID)
    {
        return SendClientMessage(playerid, COLOR_GREY, "Player is not connected.");
    }
    GetPlayerName(playerid, name, 24);
    format(string, 128, "|_________________%s's Licenses__________________|", name);
    SendClientMessage(targetid, COLOR_GREY, string);
    if(playerVariables[playerid][pCarLic] == 0)
    {
        SendClientMessage(targetid,COLOR_GREY, "Driver License: No");
    }
    else
    {
        SendClientMessage(targetid,COLOR_GREY, "Driver License: Yes");
    }
    if(playerVariables[playerid][pPassport] == 0)
    {
        SendClientMessage(targetid,COLOR_GREY, "Passport: No");
    }
    else
    {
        SendClientMessage(targetid,COLOR_GREY, "Passport: Yes");
    }
    return 1;
}
Reply


Messages In This Thread
Command help - by christiand - 12.06.2012, 19:36
Re: Command help - by Stevee - 12.06.2012, 19:41
Re: Command help - by christiand - 12.06.2012, 19:58
Re: Command help - by ReneG - 12.06.2012, 20:09
Re: Command help - by christiand - 12.06.2012, 21:16
Re: Command help - by Stevee - 12.06.2012, 22:44
Re: Command help - by SuperViper - 12.06.2012, 23:22

Forum Jump:


Users browsing this thread: 1 Guest(s)