06-01-2011, 22:46
heyho, can you help me to make this code shorter? Same function but shorter!
PHP Code:
customrecoil()
{
while( true )
{
self waittill ( "begin_firing" );
curWeapon = self GetCurrentWeapon();
{
self setClientDvar("perk_weapSpreadMultiplier", 0.20);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.5;
self setClientDvar("perk_weapSpreadMultiplier", 0.21);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.22);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.23);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.24);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.25);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.26);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.27);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.28);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.29);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.30);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.31);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.32);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.33);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.34);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.35);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.36);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.37);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.38);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.40);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.41);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self setClientDvar("perk_weapSpreadMultiplier", 0.42);
self endon ( "end_firing" );
self thread customrecoil();
wait 0.01;
self endon ( "end_firing" );
self thread customrecoil();
}
}
}