GetWeaponData help
#6

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
pawn Код:
..
Your code looks long and looks dirty, it isn't the best way to do that, Konstatinos would work properly if the Hybris understand what he means, anyways, here's the code.

pawn Код:
CMD:weaps(playerid, params[])
{
    new
        PlayerWeapons[13], PlayerAmmo[13],
        WeaponName[30], string[100],
        targetid, i = 1
    ;

    if( sscanf ( params, "u", targetid ) )
        return SendClientMessage(playerid, -1, "Syntax: /weaps [Player Name/ID]");

    while(i <= 12)
    {
        GetPlayerWeaponData( id, i, PlayerWeapons[ i ], PlayerAmmo[ i ] );
        if( PlayerWeapons[ i ] != 0 )
        {
            GetWeaponName( PlayerWeapons[i], WeaponName, sizeof( WeaponName ) );
            format( string, sizeof( string ) , "Weapon ID: [%d] Weapon Name: [%s] - Ammo: [%d]", PlayerWeapons[ i ], WeaponName, PlayerAmmo[ i ] );
            SendClientMessage( playerid, -1, string );
        }
        i++;
    }
    return true;
}
Reply


Messages In This Thread
GetWeaponData help - by Hybris - 22.12.2013, 14:05
Re: GetWeaponData help - by Konstantinos - 22.12.2013, 14:13
Re: GetWeaponData help - by Hybris - 22.12.2013, 15:33
Re: GetWeaponData help - by Konstantinos - 22.12.2013, 15:39
Re: GetWeaponData help - by BlackWolf120 - 22.12.2013, 15:42
Re: GetWeaponData help - by Patrick - 22.12.2013, 15:49
Re: GetWeaponData help - by BlackWolf120 - 22.12.2013, 16:56
Re: GetWeaponData help - by Patrick - 22.12.2013, 17:00
Re: GetWeaponData help - by Hybris - 23.12.2013, 10:15

Forum Jump:


Users browsing this thread: 2 Guest(s)