Jump to content

Question

Posted
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 ?

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

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
  • 0
Posted

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 ?

  • 0
Posted (edited)

Î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
  • 0
Posted (edited)
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
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.