26.09.2015, 09:32
Hi, Sorry for posting many threads. I am making mission stats which will tell how many Races wons, and how many times we have finish it in 1st, 2nd and 3rd pos.
I'm little bit confused how can i count for each position(1st , 2nd, 3rd). Just give me example, i will do it further myself.
CODES:
finished checkpoint
I'm little bit confused how can i count for each position(1st , 2nd, 3rd). Just give me example, i will do it further myself.
CODES:
finished checkpoint
Код:
case 23: { //static place; //place++; //============================================================== static place; static const Scores[] = {7, 5, 4}; new ScoreAdd = (place >= sizeof(Scores)) ? 3 : Scores[place]; SetPlayerScore(playerid, GetPlayerScore(playerid) + ScoreAdd); //============================================================== static const Cash[] = {8000, 6000, 4000}; new CashAdd = (place >= sizeof(Cash)) ? 2000 : Cash[place]; GivePlayerMoney(playerid, CashAdd); place++; //============================================================== new string2[128]; format(string2,sizeof(string2),"{7C7C7C}» You've Recieved %d Points and $%d for Completing the Race.",ScoreAdd, CashAdd); SendClientMessage(playerid,-1,string2); //============================================================== DisablePlayerRaceCheckpoint(playerid); AccInfo[playerid][RacesFinish]++; PlayerPlaySound(playerid, 1056, 0.0, 0.0 , 10.0); Stats[playerid] = 31; new name[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "{FF6868}» Race: {FF0000}%s {FF6868}finished the race in %d%s place. {FF0000}(%s) (FPS: %d) ", name, place, (place == 1) ? ("st") : (place == 2) ? ("nd") : (place == 3) ? ("rd") : ("th"), ConvertTime(GetTickCount() - rTestcount), pFPS); SendClientMessageToAll(green, string); DisablePlayerCheckpoint(playerid); return 1; }