Need help understanding this code
#1

What this code do?

Код:
new Float:x, Float:y, Float:z;
GetPlayerCameraFrontVector(playerid, x, y, z);
#pragma unused x
#pragma unused y
if(z < -0.8) 
{
     SendClientMessage(playerid, -1, "Good");
}
Reply
#2

pawn Код:
new Float:x,Float:y, Float:z;//We are defining the floats here, we will use them on the next line
GetPlayerCameraFrontVector(playerid, x, y, z);//In here we are getting the x, y, z of the player's front vector
More info here and here.
pawn Код:
#pragma unused x
#pragma unused y
This means we will not be using the x and y of the player's front vector.
Read this.
pawn Код:
if(z < -0.8)
{
     SendClientMessage(playerid, -1, "Good");
}
That code above will check in the player's front vector "z" is lower than -0.8.Then sends him the messsage.
Reply
#3

Thanks man! You helped me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)