SA-MP Forums Archive
Problem with angle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with angle (/showthread.php?tid=601116)



Problem with angle - ImMuslimNigga - 16.02.2016

Код:
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


Re: Problem with angle - Chilli9434 - 16.02.2016

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


Re: Problem with angle - Trucido - 16.02.2016

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


Re: Problem with angle - ImMuslimNigga - 16.02.2016

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


Re: Problem with angle - Chilli9434 - 16.02.2016

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


Re: Problem with angle - YouServ - 17.02.2016

remove "f" ....


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



Re: Problem with angle - ImMuslimNigga - 17.02.2016

@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



Re: Problem with angle - ImMuslimNigga - 17.02.2016

No one can help me ?


Re: Problem with angle - Chilli9434 - 17.02.2016

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.


Re: Problem with angle - ImMuslimNigga - 17.02.2016

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