SA-MP Forums Archive
Too many errors. - 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: Too many errors. (/showthread.php?tid=511730)



Too many errors. - Laure - 07.05.2014

Hey there since my gm didnt load ironman fs i excluding the javelin code in the fs added the flying mode from it. But i got a problem in the public of facing angle while flying.Here is the errors,
Код:
D:\Unitech Roleplay\gamemodes\ug-rp.pwn(3735) : error 012: invalid function call, not a valid address
D:\Unitech Roleplay\gamemodes\ug-rp.pwn(3735) : warning 215: expression has no effect
D:\Unitech Roleplay\gamemodes\ug-rp.pwn(3735) : warning 215: expression has no effect
D:\Unitech Roleplay\gamemodes\ug-rp.pwn(3735) : warning 215: expression has no effect
D:\Unitech Roleplay\gamemodes\ug-rp.pwn(3735) : error 001: expected token: ";", but found ")"
D:\Unitech Roleplay\gamemodes\ug-rp.pwn(3735) : error 029: invalid expression, assumed zero
D:\Unitech Roleplay\gamemodes\ug-rp.pwn(3735) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
And the script it
pawn Код:
forward Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y)
{
    new Float:pX,Float:pY,Float:pZ,Float:ang;

    if(IsPlayerConnected(playerid))
    GetPlayerPos(playerid, pX, pY, pZ);

    if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
    else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0); // error line
    else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);

    if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
    else ang = (floatabs(ang) - 180.0);

    ang += 180.0;

    SetPlayerFacingAngle(playerid, ang);

    return ang;
}
PS: I used to get 20 warnings and 1 error till i didnt add new Float:SetPlayerToFacePos[MAX_PLAYERS]; in the top of my script..


Re: Too many errors. - Vince - 07.05.2014

Quote:
Originally Posted by Imperor
Посмотреть сообщение
PS: I used to get 20 warnings and 1 error till i didnt add new Float:SetPlayerToFacePos[MAX_PLAYERS]; in the top of my script..
Less errors don't necessarily indicate less problems. With fatal error 107 it's quite the opposite. The line I quoted above is completely wrong and should be removed. As I said in your previous thread (!) you cannot have the same name for a global variable and a local variable. In the function, rename pX, pY and pZ to something else (example: local_pX, local_pY, local_pZ)


Re: Too many errors. - Laure - 07.05.2014

ops sorry i forgot to check that post so i got to rename but rename which one? Didnt get you all.
Please explain a bit.


Re: Too many errors. - Laure - 07.05.2014

oh alright done it worked bro thanks repped