Pomoc

Započeo Sosa, Januar 12, 2022, 18:35:56 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

C:\Users\Hristijan\Desktop\Amazing Gaming Roleplay\gamemodes\sa-rpomg.pwn(79338) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\Hristijan\Desktop\Amazing Gaming Roleplay\gamemodes\sa-rpomg.pwn(79338) : warning 219: local variable "Y" shadows a variable at a preceding level
Pawn compiler 3.2.3664           Copyright (c) 1997-2016, ITB CompuPhase


2 Warnings.

stock SetPlayerLookAt(playerid,Float:X,Float:Y)
{
   new Float: Pos[3];
   GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
   Pos[2] = floatabs(atan((Y - Pos[1]) / (X - Pos[0])));
   if(X <= Pos[0] && Y >= Pos[1]) Pos[2] = floatsub(180.0, Pos[2]);
   else if(X < Pos[0] && Y < Pos[1]) Pos[2] = floatadd(Pos[2], 180.0);
   else if(X >= Pos[0] && Y <= Pos[1]) Pos[2] = floatsub(360.0, Pos[2]);
   Pos[2] = floatsub(Pos[2], 90.0);
   if(Pos[2] >= 360.0) Pos[2] = floatsub(Pos[2], 360.0);
   SetPlayerFacingAngle(playerid, Pos[2]);
   return true;
}

Ako znate gde su warnizi bilo bih od pomoci ....

Promenive X i Y vec negde postoje (verovatno globalno) . Samo ih preimenuj i nesto drugo. PosX, PosY, ili tako nesto vidi sta je slobodno...