Problem with angle
#1

Код:
new Float:x, Float:y, Float:z;
    GetPlayerPos(issuerid, x, y, z);
    if (newkeys & KEY_FIRE && newkeys & KEY_SPRINT && newkeys & KEY_HANDBRAKE)
    {
    if(IsPlayerInRangeOfPoint(issuerid, 2.0, x, y, z))
    {
    ApplyAnimation(issuerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0);
    ApplyAnimation(playerid,"DODGE","Crush_Jump",4.0,0,1,1,1,0);
    }
}
Hello i want to add when a player make this in other player he will have anim like in the video but i dont know how to use the angle. https://www.youtube.com/watch?v=80b1BYiOJyg
Reply
#2

I'm not sure exactly if this is what you're saying, but if it helps:
GetPlayerFacingAngle(playerid, Angle); might be what you are looking for
Reply
#3

psuedo
Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	// Created by ******

	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));
}

// ... somewhere
if ( (newkeys & KEY_FIRE) && (newkeys & KEY_SPRINT) && (newkeys & KEY_HANDBRAKE))
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    new Float:pos[2];
    GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 2.0f);
    if( IsPlayerInRangeOfPoint(issuerid, 2.0, pos[0], pos[1], z) {
       ApplyAnimation(issuerid,"GYMNASIUM","gym_tread_falloff",1.0,0,0,0,0,0);
       ApplyAnimation(playerid,"DODGE","Crush_Jump",4.0,0,1,1,1,0);
   }
}
try to work on that idea, dont know if it will work
Reply
#4

Код:
GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 2.0f);
Error with this lines
Reply
#5

Quote:
Originally Posted by ImMuslimNigga
Посмотреть сообщение
Код:
GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 2.0f);
Error with this lines
Whats the error?
Reply
#6

remove "f" ....


Код:
GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 2.0);
Reply
#7

@YouServ its the same :/

@Chilli9434
Код:
C:\Users\famille nait\Desktop\U2C\gamemodes\U2C.pwn(68605) : error 012: invalid function call, not a valid address
C:\Users\famille\Desktop\U2C\gamemodes\U2C.pwn(68605) : warning 215: expression has no effect
C:\Users\famille\Desktop\U2C\gamemodes\U2C.pwn(68605) : warning 215: expression has no effect
C:\Users\famille\Desktop\U2C\gamemodes\U2C.pwn(68605) : warning 215: expression has no effect
C:\Users\famille\Desktop\U2C\gamemodes\U2C.pwn(68605) : warning 215: expression has no effect
C:\Users\famille\Desktop\U2C\gamemodes\U2C.pwn(68605) : error 001: expected token: ";", but found ")"
C:\Users\famille\Desktop\U2C\gamemodes\U2C.pwn(68605) : error 029: invalid expression, assumed zero
C:\Users\famille\Desktop\U2C\gamemodes\U2C.pwn(68605) : fatal error 107: too many error messages on one line
Reply
#8

No one can help me ?
Reply
#9

Its working for me, make sure you have definitely removed the "f". If you have, please send the surrounding lines as it may be an issue with them.
Reply
#10

Oh it was my includes, i can compile but it dont work In Game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)