[Tutorial] Looping through arrays (two-dimensional)
#4

Sorry for this bump. But I have a question.

pawn Code:
//read the comments

enum CPData
{
    Float:x,
    Float:y,
    Float:z,
    Strings[]
}

new CP[][CPData] =
{
    {123.0, 456.0, 789.0, "You have entered CP 1"},
    {987.0, 654.0, 321.0, "You have entered CP 2"},
    {0.0, 0.0, 1.0, "You have entered CP 3"}

};

//gamemodeinit
for(new i; i < sizeof(CP); i++)
{
    CreateDynamicCP(CP[i][x], CP[i][y], CP[i][z]);
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    for(new i; i < sizeof(CP); i++)
    {
            //what should i do here to display CP 2(or any) message?
    }
};
Reply


Messages In This Thread
Looping through arrays (two-dimensional) - by Vince - 06.12.2011, 15:09
Re: Looping through arrays (two-dimensional) - by NessaHD - 06.12.2011, 15:19
Re: Looping through arrays (two-dimensional) - by T0pAz - 06.12.2011, 15:26
Re: Looping through arrays (two-dimensional) - by newbienoob - 15.08.2013, 06:53
Re: Looping through arrays (two-dimensional) - by ZcvDev - 31.01.2015, 11:05
Re: Looping through arrays (two-dimensional) - by AmigaBlizzard - 26.11.2015, 08:32
Re: Looping through arrays (two-dimensional) - by ATGOggy - 26.11.2015, 12:05

Forum Jump:


Users browsing this thread: 1 Guest(s)