23.02.2009, 15:05
An useful macro
It can help when you can't remember at all the formula to make some plain simple loops :P
For example, the code given below
replaces the code give below
Tested and works
You don't need a
or something to define the "i" given in
for example, the script creates it by himself.
- X Cutter
pawn Код:
#define CallLoop(%1,%2) for( new %1; %1 < %2; %1++ )
For example, the code given below
Код:
CallLoop(i,MAX_PLAYERS)
{
if(IsPlayerConnected(i))
{
SendClientMessage(i,somecolor,"Payday! You won $-9999 >:D");
GivePlayermoney(i,-9999);
GameTextForPlayer(i,"~r~ n~b~00~y~b ~p~ pwnt",5000,4);
}
}

Код:
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SendClientMessage(i,somecolor,"Payday! You won $-9999 >:D");
GivePlayermoney(i,-9999);
GameTextForPlayer(i,"~r~ n~b~00~y~b ~p~ pwnt",5000,4);
}
}
You don't need a
pawn Код:
new i;
pawn Код:
CallLoop(i,MAX_PLAYERS)
- X Cutter

