April 27, 2024, 12:35:18 pm

Author Topic: (Simple) Wep Command With [Weapons Blocked]  (Read 230 times)

0 Members and 1 Guest are viewing this topic.

Jutt

  • Newbie
  • *
  • Posts: 4
  • Country: pk
    • View Profile
(Simple) Wep Command With [Weapons Blocked]
« on: October 24, 2021, 06:38:08 am »
Code: [Select]
   if ( cmd == "wep" )
    {

  if ( !text ) ClientMessage( "[#ea4335]-> Error: [#fbbc05]Type /wep <Wep1> <Wep2> <Wep3> <Wep4> <Wep5> <Wep6>...", player,0,0,0 );
        else
        {
            local weps = split( text, " " ),ID, wepsset = null;
            for( local i = 0; i < weps.len(); i++ )
            {
                ( IsNum( weps[ i ] ) ) ? ID = weps[ i ].tointeger() : ID = GetWeaponID( weps[ i ] );
                if ( ID >= 33 ) ClientMessage( "[#ea4335]-> Error: [#c0c0c0]Invalid Weapon ID/Name.", player,0,0,0 );
                else
                {
                    player.SetWeapon( ID, 99999 );
                    ClientMessage( "-> [#daff00]Weapon(S) " + GetWeaponName( ID ) + " Successfully Recieved.",player,255,0,102);
                    if (wepsset == null) wepsset = " "+ ID;
                    else wepsset += (" " + ID);
                }
            }
            if (wepsset) SpawnwepPlayer[ player.ID ] = wepsset;
        }
    }
Funny Funny x 1 (list)
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

Jutt