adding players to a game.... - 11/01/15 06:27 AM
This is a BIG tricky one... (not for you superninjas of mIRC)
I wanna add players to a game...
-when someone attacks, it adds their name to a list
-if they attack multiple times it wont add their nick more than just the once
-at the end, the players get awarded only
something like "add $nick to players.ini" <--- adds to the *tipped blah blah blah*
and then read the players.ini
and tip each one the same amount splitting a determined amount
like:
10 players total and 100 in reward
!tip playera 10
!tip playerb 10
and so on
(this part needs to go in alias rain)
Here is my gamecode i made:
I wanna add players to a game...
-when someone attacks, it adds their name to a list
-if they attack multiple times it wont add their nick more than just the once
-at the end, the players get awarded only
something like "add $nick to players.ini" <--- adds to the *tipped blah blah blah*
and then read the players.ini
and tip each one the same amount splitting a determined amount
like:
10 players total and 100 in reward
!tip playera 10
!tip playerb 10
and so on
(this part needs to go in alias rain)
Here is my gamecode i made:
Code:
alias start { var %num = $rand(0,10) if (%num == 0) { /bonus } if (%num == 1) { set %total 100 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 100 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 2) { set %total 150 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 150 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 3) { set %total 200 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 200 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 4) { set %total 250 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 250 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 5) { set %total 300 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 300 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 6) { set %total 350 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 350 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 7) { set %total 400 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 400 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 8) { set %total 450 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 450 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 9) { set %total 500 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 500 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } if (%num == 10) { set %total 550 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 550 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit timer 1 1 msg # NEW WAVE! This round has %total ZOMBIES! } } alias bonus { set %total 1000 /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) + 1000 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit msg # BONUS ROUND! } ON *:TEXT:*tipped nameofgame*:#:{ /set %money.deposit $calc( $readini( zombie.ini, ZOMBIE , Money ) - $4 ) /writeini zombie.ini ZOMBIE Money %money.deposit /unset %money.deposit var %num1 = $rand(0,4) if (%num1 == 1) { set %m1 $4 * 1 timer 1 1 msg # $1 has attacked the zombies with a x1 multiplier and taken out %m1 of %total zombies this wave with $readini(zombie.ini, ZOMBIE, Money) zombies left! halt } if (%num1 == 2) { set %m2 $4 * 2 timer 1 1 msg #doomageddon $1 has attacked the zombies with a x2 multiplier and taken out %m2 of %total zombies this wave with $readini(zombie.ini, ZOMBIE, Money) zombies left! halt } if (%num1 == 3) { set %m3 $4 * 1 timer 1 1 msg # $1 has attacked the zombies with a x1 multiplier and taken out %m3 of %total zombies this wave with $readini(zombie.ini, ZOMBIE, Money) zombies left! halt } if (%num1 == 0) { set %m4 $4 * 3 timer 1 1 msg # $1 has attacked the zombies with a x3 multiplier and taken out %m4 of %total zombies this wave with $readini(zombie.ini, ZOMBIE, Money) zombies left! halt } if (%num1 == 4) { set %m5 $4 * 1 timer 1 1 msg # $1 has attacked the zombies with a x1 multiplier and taken out %m5 of %total zombies this wave with $readini(zombie.ini, ZOMBIE, Money) zombies left! halt } /unset %num1 check } alias check { if ($readini( zombie.ini, zombie, Money ) = 0) { rain } if ($readini( zombie.ini, zombie, Money ) > 0) { halt } } alias rain { msg # THE ZOMBIES HAVE BEEN DEFEATED! The warriors will recieve the spoils of war! } ON *:TEXT:go:?: { if ($nick == adminuser) { start } }