Jump to content
  • 0

Locatie obiecte


star69

Question

Incerc sa fac un job nou
 
Cand intru in CP se creeaza un object in pozitia mea 
 

Quote

if (APlayerData[playerid][JobStep] == 1)

{
   
     if(IsPlayerInRangeOfPoint(playerid, 10, -46.6383,-108.1212,3.1172))
         {
             new Float:X, Float:Y, Float:Z, Float:A;
             DisablePlayerCheckpoint(playerid);
                PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
             GetPlayerPos(playerid, X, Y, Z);
             GetPlayerFacingAngle(playerid, A);
             Planta1 = CreateObject(813,  X, Y, Z-1.0, A);
         }
if (APlayerData[playerid][JobStep] == 2)
{
if(IsPlayerInRangeOfPoint(playerid, 10, -46.6383,-108.1212,3.1172))
{
DisablePlayerCheckpoint(playerid);
PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
SetPlayerCheckpoint(playerid,-34.9588,-69.0512,3.1172, 10);
DestroyObject(Planta1);
}

Cum pot face la JobStep == 2 sa fie if(IsPlayerInRangeOfPoint(playerid, locatia la Planta1 ?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

New float:x , float:y ... Z 

GetObjectPos(plantat,x,y,z)

IsPlayerInRangeOfPoint(playerid,2,x y z

 

Sper ca înțelegi nu am dat mura în gură cauta pe wiki. Getobjectpos

Edited by Mister
  • Upvote 1

 

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

  • 0

Am inteles.

Multumesc!

Ma mai poti ajuta cu ceva?

                DisablePlayerCheckpoint(playerid);
                PlayerPlaySound(playerid,1136,0.0,0.0,0.0);
                SetPlayerCheckpoint(playerid,-34.9588,-69.0512,3.1172, 10);
                DestroyObject(Planta1);
                
                new Float:X, Float:Y, Float:Z, Float:A;
        	GetPlayerPos(playerid, X, Y, Z);
        	GetPlayerFacingAngle(playerid, A);
        	Balot1 = CreateObject(1454, X, Y, Z-1.3, 0.0, 0.0, A);

Am dupa ce dispare planta1 sa apara objectul balot1 chestia e ca se creeaza exat unde e combina mea, vreau sa fie mai in spate

 

Am incercat sa pun la Y -1.5 a functionat, dar daca vin din partea opusa se creeaza in fata mea

 

Ai idee ce pot sa fac? sa se creeze intodeauna in spatele masinii ?

Link to comment
Share on other sites

  • 0

Înlocuiesti getplayerpos cu.  

GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	new Float:a;
	GetPlayerPos(playerid, x, y, a);
	GetPlayerFacingAngle(playerid, a);
	if (GetPlayerVehicleID(playerid))
	{
	  GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
	}
	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
}

Și adăugă funcția asta la finalul gmului 

Edited by Mister

 

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

  • 0
1 hour ago, Mister said:

Înlocuiesti getplayerpos cu.  


GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	new Float:a;
	GetPlayerPos(playerid, x, y, a);
	GetPlayerFacingAngle(playerid, a);
	if (GetPlayerVehicleID(playerid))
	{
	  GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
	}
	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
}

Și adăugă funcția asta la finalul gmului 

 

A functionat, se creeaza in spate

Cum pot face distanta mai mare sa fie mai in spate?

Edited by star69
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.