array help
#1

hey i need some help im useing a streemer and i need an array so that i can go and have 5 pos for enter and 5 pos for exit so could someone help

Код:
YCP_OnPlayerEnterCheckpoint(playerid);
thx for ur time
Reply
#2

pawn Код:
// TOP
#define CPCOUNT 5 // change this if you need more CP's
#define CP_SIZE 8.0 // CP size
#define CP_RANGE 50.0 // view distance

new CPID[CPCOUNT]; // this stores the CP id's
new Float:CPData[CPCOUNT][3] =
{
    {0.0, 0.0, 0.0}, // add X, Y and Z coordinates
    {10.0, 10.0, 10.0},
    {20.0, 20.0, 20.0},
    {30.0, 30.0, 30.0},
    {40.0, 40.0, 40.0} // no comma needed here
}; // and this stores the CP positions (X Y Z)

// OnGameModeInit()
    for (new i = 0; i < CPCOUNT; i++)
    {
        CPID[i] = SetStreamCheckpoint(CPData[i][0], CPData[i][1], CPData[i][2], CP_SIZE, CP_RANGE);
    }

// [...]
OnPlayerEnterStreamCheckpoint(playerid, checkpointid)
{
    switch (checkpointid)
    {
        case CPID[0]:
        {
            // what happens when you enter CP #0
        }
        case CPID[1]:
        {
            // what happens when you enter CP #1
        }
        // and so on
    }
}
But make sure YCP is installed properly before you use it!
Reply
#3

ok with that i get these errers


C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\cops&robbers.pwn(1332) : error 021: symbol already defined: "OnPlayerEnterStreamCheckpoint"
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\cops&robbers.pwn(1335) : error 008: must be a constant expression; assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\cops&robbers.pwn(1339) : error 008: must be a constant expression; assumed zero
Reply
#4

You have the OnPlayerEnterStreamCheckpoint(playerid, checkpointid) function twice. Remove one of them.
Reply
#5

no i dont
Reply
#6

hey i need some help i have these errors now .... C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\cops&robbers.pwn(1335) : error 008: must be a constant expression; assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\cops&robbers.pwn(133 : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\samp sever\gamemodes\cops&robbers.pwn(1340) : error 008: must be a constant expression; assumed zero
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)