SA-MP Forums Archive
error 010: invalid function or declaration - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: error 010: invalid function or declaration (/showthread.php?tid=274238)



error 010: invalid function or declaration - iGetty - 05.08.2011

Line: 187 : error 010: invalid function or declaration

Here is that line:
pawn Код:
new Float:sva[MAX_PLAYERS];
But I don't know what's up with it?


Re: error 010: invalid function or declaration - Krx17 - 05.08.2011

Show us the block of code around it.


Re: error 010: invalid function or declaration - Toreno - 05.08.2011

That can't be the problem since this vairable looks okay, so you might have forgot to close a bracket or accidenlty added one and it causes a problem.


Re: error 010: invalid function or declaration - iGetty - 05.08.2011

Hmmm, I will post all the areas that this code is in, hold up, I will edit this post:

pawn Код:
public speedometer(playerid) {
    GetVehicleVelocity(GetPlayerVehicleID(playerid), sva[playerid], svb[playerid], svc[playerid]);
    svd[playerid] = floatsqroot(((sva[playerid]*sva[playerid])+(svb[playerid]*svb[playerid]))+(svc[playerid]*svc[playerid]))*100;
    s2[playerid] = floatround(svd[playerid],floatround_round);
    format(s3[playerid],256,"%i MPH", s2[playerid]);
    TextDrawSetString(sdisplay[playerid], s3[playerid]);
    return 1;
}
That is just it, apart from the variable at the top, which you've seen.


Re: error 010: invalid function or declaration - Riddick94 - 05.08.2011

You got it all defined for sure?

pawn Код:
#include    "a_samp"

new
    Float:sva[MAX_PLAYERS],
    Float:svb[MAX_PLAYERS],
    Float:svc[MAX_PLAYERS];

public speedometer(playerid)
{
    GetVehicleVelocity(GetPlayerVehicleID(playerid), sva[playerid], svb[playerid], svc[playerid]);
    svd[playerid] = floatsqroot(((sva[playerid]*sva[playerid])+(svb[playerid]*svb[playerid]))+(svc[playerid]*svc[playerid]))*100;
    s2[playerid] = floatround(svd[playerid],floatround_round);
    format(s3[playerid], sizeof(64), "%i MPH", s2[playerid]);
    TextDrawSetString(sdisplay[playerid], s3[playerid]);
    return true;
}
If yes and you have still error.. i'll give you a better way to make Speedometer.


Re: error 010: invalid function or declaration - iGetty - 05.08.2011

It still gave errors, please could you show me? PM it to me?, thanks.


Re: error 010: invalid function or declaration - Riddick94 - 05.08.2011

Sended..


Re: error 010: invalid function or declaration - MadeMan - 05.08.2011

Show the code around this line:

pawn Код:
new Float:sva[MAX_PLAYERS];



Re: error 010: invalid function or declaration - Riddick94 - 05.08.2011

I helped him on PM. Topic is ended