16.11.2016, 11:52
Hi guys,
I need help with the event and positions, do I position the event and writes textdraw first three places but it often happens that the first and second place in the textdraws occupies the same person and the same name, and to combine the now, at this distance
I need help with the event and positions, do I position the event and writes textdraw first three places but it often happens that the first and second place in the textdraws occupies the same person and the same name, and to combine the now, at this distance
Код:
public OnPlayerEnterRaceCheckpoint(playerid) { if(OnEventu[playerid] >= 1 && ecps[playerid] >= 1) { PlayerCP[playerid]++; RaceCheckpoints[PlayerCP[playerid]]++; gRacePosition[playerid] = floatround(RaceCheckpoints[PlayerCP[playerid]], floatround_floor); EventTD(playerid, PlayerCP[playerid]); } --------------------------------- stock EventTD(playerid, cpaa) { new string[128]; foreach(Player, i) { if(OnEventu[i] == 1) { new pName[MAX_PLAYER_NAME]; GetPlayerName(i, pName, MAX_PLAYER_NAME); new position = floatround(RaceCheckpoints[PlayerCP[i]], floatround_floor); switch(position) { case 1: { format(string, sizeof(string), "1. %s", pName); TextDrawSetString(Event[2], string); } case 2: { format(string, sizeof(string), "2. %s", pName); TextDrawSetString(Event[3], string); } case 3: { format(string, sizeof(string), "3. %s", pName); TextDrawSetString(Event[4], string); } } TextDrawShowForPlayer(i, Event[2]); TextDrawShowForPlayer(i, Event[3]); TextDrawShowForPlayer(i, Event[4]); } } format(string, sizeof(string), "CP - %d/%d", cpaa, MaxEventCP); TextDrawSetString(Eventt[playerid][1], string); return 1; }