new Float: Cimzett[][11] ={{1550.3191,1121.7886,10.8203}, {1115.6642,1365.1157,10.8203}, {1036.4130,2313.1960,11.4683}, {1458.4666,1953.5004,11.4683}, {1599.9231,2144.2908,11.4609},{1655.5189,1736.1045,10.8281}, {2025.9143,998.1968,10.8203}, {2192.9465,1994.2487,12.2969}, {1530.4325,2355.3801,10.8203}, {1347.0576,2608.6394,10.8203}};
new rand = random(sizeof(Cimzett)); SetPlayerCheckpoint(playerid,Cimzett[rand][0],Cimzett[rand][1],Cimzett[rand][2], 1.0);
#include <a_samp>#define MAXCP 10#define MAX_RANDCP 3#define DEBUG stockRandomCP(array[]){newbool:e[MAXCP] = { false, ... };for(new p = 0; p < MAX_RANDCP; p++){do array[p] = random(MAXCP);while(e[array[p]])e[array[p]] = true;}}new Float:Cimzett[MAXCP][] ={{ 1550.3191, 1121.7886, 10.8203 },{ 1115.6642, 1365.1157, 10.8203 },{ 1036.4130, 2313.1960, 11.4683 },{ 1458.4666, 1953.5004, 11.4683 },{ 1599.9231, 2144.2908, 11.4609 },{ 1655.5189, 1736.1045, 10.8281 },{ 2025.9143, 998.1968, 10.8203 },{ 2192.9465, 1994.2487, 12.2969 },{ 1530.4325, 2355.3801, 10.8203 },{ 1347.0576, 2608.6394, 10.8203 }};newCp_Player[MAX_PLAYERS][MAX_RANDCP];publicOnPlayerConnect(playerid){for(new i; i < MAX_RANDCP; i++){Cp_Player[playerid] = -1;}return 1;}publicOnPlayerCommandText(playerid, cmdtext[]){if(strcmp(cmdtext, \"/start\", true) == 0){if(Cp_Player[playerid][0] != -1) return SendClientMessage(playerid, -1, \"Már elindítva.\");RandomCP(Cp_Player[playerid]);#if defined DEBUG new str[128]; format(str, sizeof str, \"%d, %d, %d,\", Cp_Player[playerid][0] , Cp_Player[playerid][1] , Cp_Player[playerid][2]); SendClientMessage(playerid, -1, str);#endifSetPlayerCheckpoint(playerid, Cimzett[ Cp_Player[playerid][0] ][0], Cimzett[ Cp_Player[playerid][0] ][1], Cimzett[ Cp_Player[playerid][0] ][2], 1.0);Cp_Player[playerid][0] = -2;return 1;}#if defined DEBUGif(strcmp(cmdtext, \"/gotocp\", true, 7) == 0){ new t = strval(cmdtext[8]); if(!(0 <= t < MAXCP)) return SendClientMessage(playerid, -1, \"Nincs ilyen cp, maximális érték (\" #MAXCP \" minusz 1)\"); SetPlayerPos(playerid, Cimzett[ t ][0] + 1.5, Cimzett[ t ][1], Cimzett[ t ][2]); return 1;}#endifreturn 0;}public OnPlayerEnterCheckpoint(playerid){DisablePlayerCheckpoint(playerid);if(Cp_Player[playerid][1] != -1){SetPlayerCheckpoint(playerid, Cimzett[ Cp_Player[playerid][1] ][0], Cimzett[ Cp_Player[playerid][1] ][1], Cimzett[ Cp_Player[playerid][1] ][2], 1.0);Cp_Player[playerid][1] = -1;} else if(Cp_Player[playerid][2] != -1){ SetPlayerCheckpoint(playerid, Cimzett[ Cp_Player[playerid][2] ][0], Cimzett[ Cp_Player[playerid][2] ][1], Cimzett[ Cp_Player[playerid][2] ][2], 1.0);Cp_Player[playerid][2] = -1;} else if(Cp_Player[playerid][0] == -2){SendClientMessage(playerid, -1, \"Game Over\");Cp_Player[playerid][0] = -1;}return 1;}
#include <a_samp>#define MAXCP 10#define MAX_RANDCP 3 stockRandomCP(array[]){newbool:e[MAXCP] = { false, ... };for(new p = 0; p < MAX_RANDCP; p++){do array[p] = random(MAXCP);while(e[array[p]])e[array[p]] = true;}} newFloat:Cimzett[MAXCP][] ={{ 1550.3191, 1121.7886, 10.8203 },{ 1115.6642, 1365.1157, 10.8203 },{ 1036.4130, 2313.1960, 11.4683 },{ 1458.4666, 1953.5004, 11.4683 },{ 1599.9231, 2144.2908, 11.4609 },{ 1655.5189, 1736.1045, 10.8281 },{ 2025.9143, 998.1968, 10.8203 },{ 2192.9465, 1994.2487, 12.2969 },{ 1530.4325, 2355.3801, 10.8203 },{ 1347.0576, 2608.6394, 10.8203 }}; newCp_Player[MAX_PLAYERS][MAX_RANDCP];publicOnPlayerConnect(playerid){for(new i; i < MAX_RANDCP; i++){Cp_Player[playerid] = -1;}return 1;} publicOnPlayerCommandText(playerid, cmdtext[]){if(strcmp(cmdtext, \"/start\", true) == 0){if(Cp_Player[playerid][0] != -1) return SendClientMessage(playerid, -1, \"Már elindítva.\");RandomCP(Cp_Player[playerid]);SetPlayerCheckpoint(playerid, Cimzett[Cp_Player[playerid][0]][0], Cimzett[Cp_Player[playerid][0]][1], Cimzett[Cp_Player[playerid][0]][2], 1.0);Cp_Player[playerid][0] = -2;return 1;}return 0;}publicOnPlayerEnterCheckpoint(playerid){DisablePlayerCheckpoint(playerid);if(Cp_Player[playerid][1] != -1){SetPlayerCheckpoint(playerid, Cimzett[Cp_Player[playerid][1]][0], Cimzett[Cp_Player[playerid][1]][1], Cimzett[Cp_Player[playerid][1]][2], 1.0);Cp_Player[playerid][1] = -1;}else if(Cp_Player[playerid][2] != -1){ SetPlayerCheckpoint(playerid, Cimzett[Cp_Player[playerid][2]][0], Cimzett[Cp_Player[playerid][2]][1], Cimzett[Cp_Player[playerid][2]][2], 1.0);Cp_Player[playerid][2] = -1;}else if(Cp_Player[playerid][0] == -2){SendClientMessage(playerid, -1, \"Game Over\");Cp_Player[playerid][0] = -1;}return 1;}