PHP Code:
new const ZombieClass[][] = {
"0",
"1",
"2"
};
If you are storing integer values in the array then you can use an integer array instead of a string array:
PHP Code:
new const ZombieClass[] = { 0 , 1 , 2 };
You can also do something like this just for better readability
PHP Code:
enum _:ZombieClass
{
SkinnyZombie, //0
FatZombie, //1
SlowZombie //2
};
new PlayerClass[ 33 ];
//Assign player a zombie class
PlayerClass[ id ] = FatZombie;
//Check if player is a fat zombie
if ( PlayerClass[ id ] == FatZombie )
{
//...
And
Code:
if (!g_infreezetime && g_zombie[id] && ZombieClass[id] == 0)
{
set_user_maxspeed(id, 280.0)
set_user_health(id, 600)
set_user_gravity(id, 0.7)
}
else if (!g_infreezetime && g_zombie[id] && PlayerClass[id] == 1)
Looks like just a typo but ZombieClass[id] will throw an error if id > 2.
And a little overall indentation work wouldnt hurt either:
PHP Code:
public Function( params )
{
new var1;
new var2;
if ( var1 == 5 )
{
//do stuff
//do more stuff
for ( new i = 0 ; i < var1 ; i++ )
{
//loop code
}
}
}
__________________