SA-MP Forums Archive
Small stupid error - 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: Small stupid error (/showthread.php?tid=264865)



Small stupid error - Tachibana - 28.06.2011

Mhm I have no idea what it wants lol it is all god but it says

pawn Код:
(334) : error 001: expected token: ";", but found "if"
This is the line 334
pawn Код:
if(health > oldHP && allowHPchange==false)



Re: Small stupid error - JaTochNietDan - 28.06.2011

That's most likely a problem with the line above the one you highlighted.


Re: Small stupid error - Tachibana - 28.06.2011

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInVehicle(playerid, examCarPlayer[playerid]) && isInExam[playerid])
    {
        new Float:health;
        GetVehicleHealth(examCarPlayer[playerid], health)
        if(health > oldHP && allowHPchange==false)
  {
            if(timeChanged)
Here is the full line (line 334 starts at
pawn Код:
if(health > oldHP && allowHPchange==false)
And JaTochNietDan - U confused me lol

(btw lol did u know ur website got suspended? xD)


Re: Small stupid error - JaTochNietDan - 28.06.2011

pawn Код:
GetVehicleHealth(examCarPlayer[playerid], health);
You're missing a semi-colon at the end. Also thanks for informing me, I did not notice that, I probably went over the bandwidth limit, my downloads consume quite a bit of traffic


JaTochNietDan - Tachibana - 28.06.2011

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
pawn Код:
GetVehicleHealth(examCarPlayer[playerid], health);
You're missing a semi-colon at the end. Also thanks for informing me, I did not notice that, I probably went over the bandwidth limit, my downloads consume quite a bit of traffic
lol thanks xD anyways Why did it say it is like 334 when it was like 333? stupid pawn

Mhm sorry for the bump but got another of these stupid errors when it looks fine and I bet pawn again gave me the wrong place

pawn Код:
(45) : error 001: expected token: "}", but found "."
line 45:
pawn Код:
new Float:checkZ[36] = {35.0638,89.7550,35.0634,268.4326,35.0707,85.1039,13.8719,135.3842,7.1194,105.0700,4.0898,2.6716,14.2975,273.3081,14.3524,359.7387,40.0793,90.5029,49.7223,176.932034.9148,269.9108,34.9156,268.2417,35.0719,270.8340,35.0720,179.2827,35.0716,268.7200,35.0631,185.7353};
full line of positions

pawn Код:
new Float:checkX[36] = {-2064.0234,-2068.6179,-2072.8752,-2047.0416,-2356.8132,-2270.4839,-2254.8474,-2456.1243,-2602.8225,-2704.5544,-2737.4063,-2605.6226,-2712.8962,-2609.8054,-2400.4209,-2287.0122,-2162.4268,-2149.6414,-2119.8162,-2041.4552};
new Float:checkY[36] = {-83.8152,-69.1279,48.4772,323.1645,202.3318,222.2223,322.5443,563.1190,587.6475,710.3633,800.2923,706.2100,560.9179,453.4330,332.7725,108.3535,-98.6638};
new Float:checkZ[36] = {35.0638,89.7550,35.0634,268.4326,35.0707,85.1039,13.8719,135.3842,7.1194,105.0700,4.0898,2.6716,14.2975,273.3081,14.3524,359.7387,40.0793,90.5029,49.7223,176.932034.9148,269.9108,34.9156,268.2417,35.0719,270.8340,35.0720,179.2827,35.0716,268.7200,35.0631,185.7353};
new checkpoint[MAX_PLAYERS];
new bool:ejectFromVeh = false;
new Float:oldHP, bool:allowHPchange = false, bool:timeChanged = false;



Re: Small stupid error - JaTochNietDan - 28.06.2011

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
lol thanks xD anyways Why did it say it is like 334 when it was like 333? stupid pawn
It's actually completely logical, it's looking for the semi-colon in the next space in code, which is on line 334. So then instead of the required semi-colon it finds "if" on line 334, so line 334 is where the error actually occurs. If you want it to show the error on line 333 then simply put the next bit of code on line 333

Also as regards to your second part of code, why do you make 3 new variables to deal with the x,y,z? Just make a multi-dimensional array and it would be a lot cleaner, for example:

pawn Код:
new Float:checkpoints[2][3] = {
{x,y,z},
{x,y,z}
};
Edit: Finally after scanning through it, the reason there is an error is because you have a value in there that is not a valid float, the value you have that is causing the error is: 176.932034.9148


Re: Small stupid error - Tachibana - 28.06.2011

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
It's actually completely logical, it's looking for the semi-colon in the next space in code, which is on line 334. So then instead of the required semi-colon it finds "if" on line 334, so line 334 is where the error actually occurs.
Yea but (thx for editing my bump :3) in the one I posted now all of them have what they need... (as far as I can see)

EDIT: as well I just prefer in that way and the way u showed confused me as with these two
{x,y,z},
{x,y,z}

What are they about? isnt one enough?


Re: Small stupid error - JaTochNietDan - 28.06.2011

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
Yea but (thx for editing my bump :3) in the one I posted now all of them have what they need... (as far as I can see)

EDIT: as well I just prefer in that way and the way u showed confused me as with these two
{x,y,z},
{x,y,z}

What are they about? isnt one enough?
Because instead of having 3 variables you have just 1 variable with all of the information in it. So it can be used like so:

pawn Код:
new Float:positions[1][3] = {
     {3221.3242,5632.3132,353.221}
};
Then you can simply set the players position using:

pawn Код:
SetPlayerPos(playerid, positions[1][0], positions[1][1], positions[1][2]);
Also for the solution to your error, look at my edited post.


Re: Small stupid error - Tachibana - 28.06.2011

Got it fixed thanks.

(Oh when is ur website back online?)


Re: Small stupid error - JaTochNietDan - 28.06.2011

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
Got it fixed thanks.

(Oh when is ur website back online?)
It already is, just refresh the page

And you're welcome.