09.05.2010, 15:51
Code:
new Stats[MAX_PLAYERS]; new CheckPoints[12][3] = //4 = 4 coordenadas | 3 = 3 "valores" (X,Y,Z) { {3116.8188,-2054.5698,3.5096}, {3125.7852,-1768.5270,3.5096}, {3345.8813,-1770.8011,5.4053}, {3477.7815,-1811.6428,3.4826}, {3620.3569,-1988.3201,5.6010}, {3517.7246,-2004.3265,3.4800}, {3508.9717,-2166.2795,3.4780}, {3501.0178,-2393.7158,3.4574}, {3406.2468,-2494.4087,3.4574}, {3310.3005,-2359.6292,3.4574}, {3118.5750,-2352.3428,3.4574}, {3124.1780,-2053.6074,3.4574} }; //public OnPlayerCommandText(playerid, cmdtext[]) //{ if(strcmp(cmdtext, "/corrida", true) == 0) { if(IsPlayerAdmin(playerid)) { for(new i = 0; i < GetMaxPlayers(); i++) { if(IsPlayerConnected(i)) { SetPlayerRaceCheckpoint(i, 0, Checkpoints[1][1], Checkpoints[1][2], Checkpoints[1][3], Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], 10); Stats[i] = 1; return 1; } } } else { SendClientMessage(playerid, COLOR_RED, "Apenas Para Admins"); } } //public OnPlayerEnterCheckpoint(playerid) //{ switch(Stats[playerid]) { case 1: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[2][1], Checkpoints[2][2], Checkpoints[2][3], Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], 10); Stats[i] = 2; return 1; } case 2: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[3][1], Checkpoints[3][2], Checkpoints[3][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], 10); Stats[i] = 3; return 1; } case 3: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3], Checkpoints[4][1], Checkpoints[4][2], Checkpoints[4][3]-5, 10); Stats[i] = 4; return 1; } case 4: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[5][1], Checkpoints[5][2], Checkpoints[5][3], Checkpoints[5][1], Checkpoints[5][2], Checkpoints[5][3]-5, 10); Stats[i] = 5; return 1; } case 5: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[6][1], Checkpoints[6][2], Checkpoints[6][3], Checkpoints[6][1], Checkpoints[6][2], Checkpoints[6][3]-5, 10); Stats[i] = 6; return 1; } case 6: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[7][1], Checkpoints[7][2], Checkpoints[7][3], Checkpoints[7][1], Checkpoints[7][2], Checkpoints[7][3]-5, 10); Stats[i] = 7; return 1; } case 7: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[8][1], Checkpoints[8][2], Checkpoints[8][3], Checkpoints[8][1], Checkpoints[8][2], Checkpoints[8][3]-5, 10); Stats[i] = 8; return 1; } case 8: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[9][1], Checkpoints[9][2], Checkpoints[9][3], Checkpoints[9][1], Checkpoints[9][2], Checkpoints[9][3]-5, 10); Stats[i] = 9; return 1; } case 9: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[10][1], Checkpoints[10][2], Checkpoints[10][3], Checkpoints[10][1], Checkpoints[10][2], Checkpoints[10][3]-5, 10); Stats[i] = 10; return 1; } case 10: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[11][1], Checkpoints[11][2], Checkpoints[11][3], Checkpoints[11][1], Checkpoints[11][2], Checkpoints[11][3]-5, 10); Stats[i] = 11; return 1; } case 11: { DisablePlayerRaceCheckpoint(playerid); SetPlayerRaceCheckpoint(playerid, 1, Checkpoints[12][1], Checkpoints[12][2], Checkpoints[12][3], Checkpoints[12][1], Checkpoints[12][2], Checkpoints[12][3]-5, 10); Stats[i] = 12; return 1; } case 12: { DisablePlayerRaceCheckpoint(playerid); GameTextForPlayer(playerid, "~b~Voce ~y~ganhou ~w~a ~r~corrida~w~, e ~g~ganhou $10000 ~w~por isso!", 3000, 1); GivePlayerMoney(playerid, 10000); return 1; } } }