Question
#10

pawn Код:
forward AntiSpawnkill(playerid);
public AntiSpawnkill(playerid)
{
    switch(DMZone[playerid])
    {
        case 0 .. 4: SetPlayerHealth(playerid,100); // 0 - 4
    }
}
Is the same as

pawn Код:
forward AntiSpawnkill(playerid);
public AntiSpawnkill(playerid)
{
    switch(DMZone[playerid])
    {
        case 0: SetPlayerHealth(playerid,100);
        case 1: SetPlayerHealth(playerid,100);
        case 2: SetPlayerHealth(playerid,100);
        case 3: SetPlayerHealth(playerid,100);
        case 4: SetPlayerHealth(playerid,100);
    }
}
My example simply loops through the first 4 in one line since each case does EXACTLY the same thing anyway.
Reply


Messages In This Thread
Question - by MahdiGames - 10.01.2014, 22:52
Re: Question - by Hansrutger - 10.01.2014, 23:01
Re: Question - by MahdiGames - 10.01.2014, 23:04
Re: Question - by NightSpore - 10.01.2014, 23:08
Re: Question - by BlackBank - 10.01.2014, 23:14
Re: Question - by MahdiGames - 11.01.2014, 09:19
Re: Question - by Burridge - 11.01.2014, 09:30
Re: Question - by MahdiGames - 11.01.2014, 10:02
Re: Question - by amirab - 11.01.2014, 10:05
Re: Question - by Burridge - 11.01.2014, 10:12

Forum Jump:


Users browsing this thread: 1 Guest(s)