SA-MP Forums Archive
Race position name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Race position name (/showthread.php?tid=621889)



Race position name - SpaceRP - 16.11.2016

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


Код:
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;
}



Re: Race position name - SpaceRP - 17.11.2016

BUMP


Re: Race position name - SpaceRP - 18.11.2016

Help