Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if( cmd == "wep" || cmd == "we" )
- {
- local plr = player.ID;
- if ( status[ player.ID ].Registered == false ) ErrorMessage( "[#FFFFFF]You need to be a part of our community to use this command.", player );
- else if ( status[ player.ID ].Logged == false ) ErrorMessage( "[#FFFFFF]You need to be identified to use this command.", player );
- else if ( LMSS[ plr ].IsLMS == true ) ErrorMessage("You cannot use this command while in LMS.", player );
- else if ( status[ player.ID ].minigun == true ) ErrorMessage( "You cannot use this command while in minigun stadium.", player );
- else if ( !text ) return ErrorMessage( "[#FFFFFF]/"+cmd+" <wep1, wep2, wep3...>", player );
- else
- {
- local params = split( text, " " ); // Take out the space array
- local weapons; // Create a new null variable which will be holding the list of weapons player took.
- for( local i = 0; i <= params.len() - 1; i++ ) // since the 'len' returns value from 1 and array's starting value point is 0, we will use len() - 1 otherwise we'll receive an error.
- {
- if( !IsNum( params[i] ) && GetWeaponID( params[i] ) && GetWeaponID( params[i] ) > 0 && GetWeaponID( params[i] ) <= 32 ) // if Name was specified.
- {
- player.SetWeapon( GetWeaponID( params[i] ), 999 ); // Get the weapon ID from its Name
- weapons = weapons + " " + GetWeaponName( GetWeaponID( params[i] ) ); // Add the weapon name to given weapon list
- }
- else if( IsNum( params[i] ) && params[i].tointeger() < 33 && params[i].tointeger() > 0 ) // if ID was specified
- {
- player.SetWeapon( params[i].tointeger(), 999 ); // Then just give player that weapon
- weapons = weapons + " " + GetWeaponName( params[i].tointeger() ); // Get the weapon name from the ID and add it.
- }
- else ErrorMessage( "[#FF0000][Server] - [#FFFFFF]Invalid Weapon Name/ID!", player ); // if the invalid ID/Name was given
- }
- if( weapons != null ) SendMessage( "[#008000][WEAPONS] - [#FFFFFF]Received weapons: "+weapons+".", player );
- else ErrorMessage( "[#FF0000][Server] - [#FFFFFF]No weapons specified", player );
- }
- }
Add Comment
Please, Sign In to add comment