A function wich returns all the players weapons wont work.
#10

pawn Код:
stock GetAllPlayerWeapons(playerid)
{
    new fstr[175], count, weapons[13][2];
    for(new w = 0; w < 13; w++)
    {
        GetPlayerWeaponData(playerid, w, weapons[w][0], weapons[w][1]);
        if(weapons[w][0])
        {
            new str[21];
            GetWeaponName(weapons[w][0], str, sizeof(str));
            format(str, sizeof(str), ((count) ? (", %s") : ("%s")), str);
            strcat(fstr, str);
            count++;
        }
    }
    return fstr;
}
Example:
pawn Код:
SendClientMessage( ADMIN, -1, GetAllPlayerWeapons( TARGET ));
Take note that GetAllPlayerWeapons can be longer than 128 cells if the target has a lot of weapons. So make sure you consider using a function that will make the one line into two.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)