AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Trouble with for loop... (https://forums.alliedmods.net/showthread.php?t=17828)

Zenith77 09-09-2005 23:27

Trouble with for loop...
 
Its seems as though i can not do this with getting the erro "experssion has no effect" :/

Code:
new dmgmult = floatround(coins[id]/25,floatround_floor)         if( coins[id] >= 25 ) {                 for( new i=0; i<coins[id]; dmgmult ) {                         coins[id] -=dmgmult             coinDamage[id] +=5.0                                 }         coinHasExtraDamage[id] = 1                 client_print(id, print_chat, " [COIN MOD] You recived extra damage!" )     }

XxAvalanchexX 09-09-2005 23:43

You didn't post what line it was on, but I'm guessing this one:

Code:
for( new i=0; i<coins[id]; dmgmult ) {

The third parameter in for() is a statement to execute each iteration. dmgmult doesn't do anything. It should probably be i++ to keep the loop going.

Zenith77 09-10-2005 00:19

but your the one who game me that code :/


how am i supposed to increase there attacker for ever 25 coins?

XxAvalanchexX 09-10-2005 01:25

Code:
new dmgmult = floatround( float(coins[id]) / 25.0, floatround_floor ); coinDamage[id] += float(dmgmult) * 5.0;


All times are GMT -4. The time now is 14:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.