Ranged command
#6

pawn Код:
CMD:rangeweapon( playerid, params[ ] )
{
    new
        Float: range,
        weaponid,
        ammo
    ;
    if( sscanf( params, "fdd", range, weaponid, ammo ) ) return SendClientMessage( playerid, -1, "Syntax: /rangeweapon <range> <weaponid> <ammo>" );
    switch( weaponid )
    {
        case 0 .. 18, 22 .. 46:
        {
            new
                Float: x,
                Float: y,
                Float: z
            ;
            GetPlayerPos( playerid, x, y, z );
            for( new i = 0; i < MAX_PLAYERS; i++ )
            {
                if( !IsPlayerConnected( i ) ) continue;
                if( IsPlayerInRangeOfPoint( i, range, x, y, z ) ) GivePlayerWeapon( i, weaponid, ammo );
            }
        }
        default: SendClientMessage( playerid, -1, "Invalid weaponid" );
    }
    return 1;
}
Reply


Messages In This Thread
Ranged command - by siemka321 - 24.09.2013, 15:51
Re: Ranged command - by DanishHaq - 24.09.2013, 15:55
Re: Ranged command - by Konstantinos - 24.09.2013, 15:56
Re: Ranged command - by EiresJason - 24.09.2013, 15:58
Re: Ranged command - by siemka321 - 25.09.2013, 11:03
Re: Ranged command - by Konstantinos - 25.09.2013, 11:19

Forum Jump:


Users browsing this thread: 1 Guest(s)