Jump to content
  • 0

Problema Distanta


kiLLers10

Question

Problema intalnita (descriere): Am o problema la acest script . imi arata distanta pana la checkpoint dar nu scade deloc . ramane asa
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu): 

        Float: fDistance = GetPlayerDistanceFromPoint(playerid, 2700.3777, -2388.7659, 13.7271);
		new playerState = GetPlayerState(playerid);
  		if (playerState == PLAYER_STATE_DRIVER)
  		{
    		if(!response) return 1;
      		switch(listitem)
        	{
         		case 0:
           		{
            		DisablePlayerCheckpoint(playerid);
					SetPlayerCheckpoint(playerid, 2700.3777, -2388.7659, 13.7271, 3.0);
				    format(string, sizeof(string), "~y~Mai ai~w~~h~~n~ %0.2f metri pana la destinatie.", fDistance);
			     	PlayerTextDrawSetString(playerid, InfoTD, string);
			     	PlayerTextDrawShow(playerid, InfoTD);
					Traseu[playerid] = 1;
					CPT[playerid] = 2;
     			}


Imagini / Video (optional):
Ati incercat sa rezolvati singur?:da

Edited by kiLLers10
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Unde ai tu acel cod? 

Cauta de exemplu un tiner de 1 secu de si te duci la publicul acela si pui scriptul in el

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Adauga asta la ongamemodeinit SetTimer ("tdjob",1000,true);

Apoi asta la sfarsitul gmului si ii adaugi o restrictie de job si de hidetextdraw

forward tdjob()

 

public tdjob()
{
	for(new playerid;playerid<MAX_PLAYERS;playerid++)
	{
		Float: fDistance = GetPlayerDistanceFromPoint(playerid, 2700.3777, -2388.7659, 13.7271);
		new playerState = GetPlayerState(playerid);
  		if (playerState == PLAYER_STATE_DRIVER)
  		{
    	
					
				    format(string, sizeof(string), "~y~Mai ai~w~~h~~n~ %0.2f metri pana la destinatie.", fDistance);
			     	PlayerTextDrawSetString(playerid, InfoTD, string);
			     	PlayerTextDrawShow(playerid, InfoTD);
					Traseu[playerid] = 1;
					CPT[playerid] = 2;
         }
     }
     return1;
}
     			
Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
SetPlayerCheckpoint(playerid, X, Y, Z, 3.0);//Setezi un Cp pana unde vrei tu
TextDrawShowForPlayer(playerid, Textdraw-ulTau);
SetTimerEx("Distance", 1000, true, "iiii", playerid,  X, Y, Z);

forward Distance(playerid, Float:X, Float:Y, Float:Z);
public Distance(playerid, Float:X, Float:Y, Float:Z)
{
    new KM = (GetPlayerDistanceFromPoint(playerid, X, Y, Z)*4)/1000;

    new Str[100];
    format(Str, 100, "%0.1f KM pana la destinatie", KM);
    TextDrawSetString(Textdraw-ulTau, Str);
}

Sper sa te ajute.

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.