new Float: UTCP[][3] ={{-1426.3839,2169.4773,50.0169},{-1501.1021,1962.9080,47.9499},{-1479.3350,2547.4475,55.7802},{-1479.3350,2547.4475,55.7802},{-1529.7706,2686.3264,55.8359},{-1563.9922,2711.1482,55.8594},{-1563.9922,2711.1482,55.8594}};public OnPlayerEnterCheckpoint(playerid){new rand = random(sizeof(UTCP));SetPlayerCheckpoint(playerid,UTCP[rand][0],UTCP[rand][1],UTCP[rand][2],4);new randomcash[MAX_PLAYERS];randomcash[playerid] = random(200);GivePlayerMoney(playerid,randomcash[playerid]);new str[25+1];format(str, sizeof(str), \"Kereset: %d$\", randomcash[playerid]);GameTextForPlayer(playerid, str, 3000, 1);return 1;}[/code]Checkpoint megjelenitései:[code=pawn]new rand = random(sizeof(UTCP));SetPlayerCheckpoint(playerid, UTCP[rand][0],UTCP[rand][1],UTCP[rand][2], 4);
new Float: UTCP[7][3] ={{-1426.3839,2169.4773,50.0169},{-1501.1021,1962.9080,47.9499},{-1479.3350,2547.4475,55.7802},{-1479.3350,2547.4475,55.7802},{-1529.7706,2686.3264,55.8359},{-1563.9922,2711.1482,55.8594},{-1563.9922,2711.1482,55.8594}};
public OnPlayerEnterCheckpoint(playerid){return1;}
public OnPlayerEnterCheckpoint(playerid){DisablePlayerCheckpoint(playerid);new rand = random(sizeof(UTCP));SetPlayerCheckpoint(playerid,UTCP[rand][0],UTCP[rand][1],UTCP[rand][2],4);new randomcash[MAX_PLAYERS];randomcash[playerid] = random(200);GivePlayerMoney(playerid,randomcash[playerid]);new str[25+1];format(str, sizeof(str), \"Kereset: %d$\", randomcash[playerid]);GameTextForPlayer(playerid, str, 3000, 1);return 1;}
case 0:{new rand = random(sizeof(UTCP));SetPlayerCheckpoint(playerid,UTCP[rand][0],UTCP[rand][1],UTCP[rand][2],4);new randomcash[MAX_PLAYERS];randomcash[playerid] = random(200);GivePlayerMoney(playerid,randomcash[playerid]);new str[25+1];format(str, sizeof(str), \"Kereset: %d$\", randomcash[playerid]);
new aktivcp[MAX_PLAYERS];enum { NOAKTIVCP, ANYAMTYUKJACHECKPOINT, KISDENEVERKOLOK, MALOMKOTOREDEK}; public OnPlayerConnect(playerid){ aktivcp[playerid] = NOAKTIVCP; return 1;} CMD:empire(playerid){ SetPlayerCheckpoint(playerid, .............. aktivcp[playerid] = ANYAMTYUKJACHECKPOINT; return 1;}CMD:vasalo(playerid){ SetPlayerCheckpoint(playerid, .............. aktivcp[playerid] = KISDENEVERKOLOK; return 1;}CMD:hegesztogep(playerid){ SetPlayerCheckpoint(playerid, .............. aktivcp[playerid] = MALOMKOTOREDEK; return 1;} public OnPlayerEnterCheckpoint(playerid){ switch(aktivcp[playerid]) { case ANYAMTYUKJACHECKPOINT: { SendClientMessage(playerid, -1, \"hullahopp\"); DisablePlayerCheckpoint(playerid); aktivcp[playerid] = NOAKTIVCP;} case KISDENEVERKOLOK: { SendClientMessage(playerid, -1, \"Ipijáé\"); DisablePlayerCheckpoint(playerid); aktivcp[playerid] = NOAKTIVCP; } case MALOMKOTOREDEK: { SendClientMessage(playerid, -1, \"sörlock holms\"); DisablePlayerCheckpoint(playerid); aktivcp[playerid] = NOAKTIVCP; } } return 1;}
Egy SetPlayerCheckpointnak nincs id visszatérése ami alapján betudod azonosítani melyik van éppen megjelenítve egy játékosnak.Tehát létre kell hoznod egy plusz változót, ami majd tárolni fogja hogy éppen melyik checkpoint van megjelenítve egy játékosnak. new aktivcp[MAX_PLAYERS];enum { NOAKTIVCP, ANYAMTYUKJACHECKPOINT, KISDENEVERKOLOK, MALOMKOTOREDEK}; public OnPlayerConnect(playerid){ aktivcp[playerid] = NOAKTIVCP; return 1;} CMD:empire(playerid){ SetPlayerCheckpoint(playerid, .............. aktivcp[playerid] = ANYAMTYUKJACHECKPOINT; return 1;}CMD:vasalo(playerid){ SetPlayerCheckpoint(playerid, .............. aktivcp[playerid] = KISDENEVERKOLOK; return 1;}CMD:hegesztogep(playerid){ SetPlayerCheckpoint(playerid, .............. aktivcp[playerid] = MALOMKOTOREDEK; return 1;} public OnPlayerEnterCheckpoint(playerid){ switch(aktivcp[playerid]) { case ANYAMTYUKJACHECKPOINT: { SendClientMessage(playerid, -1, \"hullahopp\"); DisablePlayerCheckpoint(playerid); aktivcp[playerid] = NOAKTIVCP;} case KISDENEVERKOLOK: { SendClientMessage(playerid, -1, \"Ipijáé\"); DisablePlayerCheckpoint(playerid); aktivcp[playerid] = NOAKTIVCP; } case MALOMKOTOREDEK: { SendClientMessage(playerid, -1, \"sörlock holms\"); DisablePlayerCheckpoint(playerid); aktivcp[playerid] = NOAKTIVCP; } } return 1;}