Weird error help
#1

Well, I want to compare the numbers from 2 different files. I get the following errors:

pawn Код:
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\vehtest.pwn(83) : error 036: empty statement
C:\Users\Kreso\Desktop\SAMP Server\gamemodes\vehtest.pwn(87) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
This is the code I get the error at:

pawn Код:
for(new i = 0; i < OWNED_CARS; i ++)
    {
        new file[50];
        format(file, sizeof(file), "vehicles/%d.json", i);
        if(djInt(file, "player/owner") == djInt("users/Admin.json", "vehicle/ID"));
        {
        SendClientMessage(playerid, 0x355262, "Welcome to your vehicle");
        }
        else
        {
        RemovePlayerFromVehicle(playerid);
        }
    }
Error 83 is at If..., and 87 at Else...
Reply
#2

which is 83 and which is 87
Reply
#3

I said it already, 83 is at the "If(djInt(..."
and 87 is at "Else"
Reply
#4

if so then try this

pawn Код:
for(new i = 0; i < OWNED_CARS; i ++)
{
        new file[50];
        format(file, sizeof(file), "vehicles/%d.json", i);
        if(djInt(file, "player/owner") == djInt("users/Admin.json", "vehicle/ID"))
        {
           SendClientMessage(playerid, 0x355262, "Welcome to your vehicle");
        }
        else
        {
           RemovePlayerFromVehicle(playerid);
        }
}
Reply
#5

Thanks for the help. It worked. I accidentaly put ";" at the end of "if".
Reply
#6

no problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)