Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddRandomAttachment( weapon )
- {
- weapon = subWeapon( weapon );
- attachements = getAttachements( weapon );
- return weapon + attachements[ randomint( attachements.size ) ] + "_mp";
- }
- getAttachements( weapon )
- {
- attachements = [];
- for(i=12;;i++)
- {
- _return = TableLookup( "mp/statstable.csv", 4, weapon, i );
- if( _return == "" )
- return attachements;
- attachements[ attachements.size ] = "_" + _return;
- }
- }
- subWeapon( weapon )
- {
- size = weapon.size;
- string = "";
- for( i=3;i>0;i--)
- string += weapon[ size-i ];
- if( string != "_mp" )
- return weapon;
- string = "";
- for( i=0;i<size-3;i++)
- string += weapon[ i ];
- return string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement