Szerző Téma: Little problem  (Megtekintve 547 alkalommal)

Nem elérhető hpeter94

  • 1450
  • Fórum fenntartó
    • Profil megtekintése
Little problem
« Dátum: 2010. november 03. - 18:40:21 »
0 Show voters
Hali van egy apró gondom :)
Ez egy verseny mode ami mûködik is annyi a probléma hogy nem az utolsó checkpointnál írja ki hogy nyertél hanem az utolsó elöttinél és nem is jeleníti meg az utolsó cp-t...
 

#include <a_samp>
new Float:Checkpoints[][] =
{
{779.4153,666.0378,11.3294},
{540.4055,679.7401,3.3386},
{384.2715,754.6032,6.1344},
{215.8735,729.2396,6.1377},
{50.9785,642.2468,6.5987},
{-23.3371,605.1353,10.8010},
{-121.6257,570.7854,15.8794},
{-274.7844,550.7006,16.1792},
{-407.3480,559.0037,17.0495},
{-525.4532,595.2121,16.6398},
{-727.0151,686.5873,17.3965},
{-786.7443,714.0154,18.5722},
{-855.3204,766.7495,19.7021},
{-892.3096,863.9409,19.4531},
{-916.7264,983.7038,19.2493},
{-973.5539,1120.9655,29.9276},
{-1013.9644,1175.9628,34.7805},
{-1133.6501,1094.7911,38.5184},
{-1296.8649,923.3022,45.8823},
{-1656.8535,543.9624,38.3067}
//{-1656.8535,543.9624,38.3067}//Az utolsónak 2szer kell lennie
};
new CheckPoint[MAX_PLAYERS];
main()
{
print(\"Verseny tesztmod\");
//printf(sizeof(Checkpoints));
}
public OnGameModeInit()
{
    SetGameModeText(\"Versenyteszt\"); //Mod neve ami a böngészõben van kiírva
    AddPlayerClass(247,779.4153,666.0378,11.3294,0.0,0,0,0,0,0,0);
    //AddStaticVehicle(200, 779.4153,666.0378,11.3294,0.0,0,0);
    AddStaticVehicle(492,779.4153,666.0378,11.3294,347.4336,96,1); // greenwood
return 1;
}
forward SetupPlayerForClassSelection(playerid);
public SetupPlayerForClassSelection(playerid)
{
PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0 );//Zene
SetPlayerInterior(playerid,0);//Interior
SetPlayerFacingAngle(playerid,180.0);//SKin elfordulása
SetPlayerPos(playerid,1605.6316,-1691.6774,28.3432);//Játékos pozició
SetPlayerCameraPos(playerid,1605.9249,-1697.3828,28.3167);//Kamera pozició
SetPlayerCameraLookAt(playerid,1605.6316,-1691.6774,28.3432);//Kamera nézési iránya
}
public OnPlayerRequestClass(playerid, classid)
{
    SetupPlayerForClassSelection(playerid);//Beállítja a játékosnak a skinválasztást
return 1;
}
public OnPlayerSpawn(playerid)
{
CheckPoint[playerid] = 0;
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], Checkpoints[CheckPoint[playerid]+1][0], Checkpoints[CheckPoint[playerid]+1][1], Checkpoints[CheckPoint[playerid]+1][2], 10);
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
CheckPoint[playerid]++;
if(CheckPoint[playerid] < sizeof(Checkpoints)-1)
{
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], Checkpoints[CheckPoint[playerid]+1][0], Checkpoints[CheckPoint[playerid]+1][1], Checkpoints[CheckPoint[playerid]+1][2], 10);
    } else if(CheckPoint[playerid]-1 == sizeof(Checkpoints)) {
        SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], 10);
} else {
GameTextForAll(\"Megvan a nyertes\", 10*1000, 5);
}
return 1;
}

Little problem
« Válasz #1 Dátum: 2010. november 03. - 20:14:18 »
0 Show voters
Csak gyorsan összedobtam,ha nemjó szolj.
 
#include <a_samp>
new Float:Checkpoints[][] =
{
{779.4153,666.0378,11.3294},
{540.4055,679.7401,3.3386},
{384.2715,754.6032,6.1344},
{215.8735,729.2396,6.1377},
{50.9785,642.2468,6.5987},
{-23.3371,605.1353,10.8010},
{-121.6257,570.7854,15.8794},
{-274.7844,550.7006,16.1792},
{-407.3480,559.0037,17.0495},
{-525.4532,595.2121,16.6398},
{-727.0151,686.5873,17.3965},
{-786.7443,714.0154,18.5722},
{-855.3204,766.7495,19.7021},
{-892.3096,863.9409,19.4531},
{-916.7264,983.7038,19.2493},
{-973.5539,1120.9655,29.9276},
{-1013.9644,1175.9628,34.7805},
{-1133.6501,1094.7911,38.5184},
{-1296.8649,923.3022,45.8823},
{-1656.8535,543.9624,38.3067}
//{-1656.8535,543.9624,38.3067}//Az utolsónak 2szer kell lennie
};
new CheckPoint[MAX_PLAYERS];
main()
{
print(\"Verseny tesztmod\");
//printf(sizeof(Checkpoints));
}
public OnGameModeInit()
{
    SetGameModeText(\"Versenyteszt\"); //Mod neve ami a böngészõben van kiírva
    AddPlayerClass(247,779.4153,666.0378,11.3294,0.0,0,0,0,0,0,0);
    //AddStaticVehicle(200, 779.4153,666.0378,11.3294,0.0,0,0);
    AddStaticVehicle(492,779.4153,666.0378,11.3294,347.4336,96,1); // greenwood
return 1;
}
forward SetupPlayerForClassSelection(playerid);
public SetupPlayerForClassSelection(playerid)
{
PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0 );//Zene
SetPlayerInterior(playerid,0);//Interior
SetPlayerFacingAngle(playerid,180.0);//SKin elfordulása
SetPlayerPos(playerid,1605.6316,-1691.6774,28.3432);//Játékos pozició
SetPlayerCameraPos(playerid,1605.9249,-1697.3828,28.3167);//Kamera pozició
SetPlayerCameraLookAt(playerid,1605.6316,-1691.6774,28.3432);//Kamera nézési iránya
}
public OnPlayerRequestClass(playerid, classid)
{
    SetupPlayerForClassSelection(playerid);//Beállítja a játékosnak a skinválasztást
return 1;
}
public OnPlayerSpawn(playerid)
{
CheckPoint[playerid] = 0;
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], Checkpoints[CheckPoint[playerid]+1][0], Checkpoints[CheckPoint[playerid]+1][1], Checkpoints[CheckPoint[playerid]+1][2], 10);
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
CheckPoint[playerid]++;
if(CheckPoint[playerid] == sizeof(Checkpoints)) return GameTextForAll(\"Megvan a nyertes\", 10*1000, 5);
else if(CheckPoint[playerid] < (sizeof(Checkpoints)-1)) SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], Checkpoints[CheckPoint[playerid]+1][0], Checkpoints[CheckPoint[playerid]+1][1], Checkpoints[CheckPoint[playerid]+1][2], 10);
    else SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], Checkpoints[CheckPoint[playerid]][0], Checkpoints[CheckPoint[playerid]][1], Checkpoints[CheckPoint[playerid]][2], 10);
return 1;
}

Nem elérhető hpeter94

  • 1450
  • Fórum fenntartó
    • Profil megtekintése
Little problem
« Válasz #2 Dátum: 2010. november 03. - 20:18:20 »
0 Show voters
Jaj köszi a gyors válaszért mûködik :P

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal