Jump to content
  • 0

error 029: invalid expression, assumed zero


Question

Posted

D:\samp03\filterscripts\VamaT.pwn(136) : warning 225: unreachable code

D:\samp03\filterscripts\VamaT.pwn(136) : error 029: invalid expression, assumed zero

D:\samp03\filterscripts\VamaT.pwn(136) : warning 215: expression has no effect

D:\samp03\filterscripts\VamaT.pwn(136) : error 001: expected token: ";", but found "if"

D:\samp03\filterscripts\VamaT.pwn(179) : warning 225: unreachable code

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

[pawn]linia 136: else if(PlayerToPoint(5.0, playerid, -9.1664,-1361.7852,10.7733))

    {

                                if(PlayerInfo[playerid][pPassport] == 1)

                                    {

                                    MoveObject(vama2, -8.9464988708496,-1356.9973144531,10.706520080566, 5.5);

                                    SetTimer("vamaClose", 3000, 0);

                                    SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");

                        GivePlayerMoney(playerid,-100);

                                    return 1;

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");

                                    return 1;

                                    }

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "You are not at Barrier.");

                                    return 1;

                                    }

                                    }[/pawn]

3 answers to this question

Recommended Posts

Posted

Pune asta sus in script:

#define PlayerToPoint(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%1,%0,%2,%3,%4)

si sterge functia PlayerToPoint din GM, unde este ea definita.

Daca tot nu merge, pune si liniile de mai sus putin...

Posted

tot nu merge:(

[pawn]    #include <a_samp>

    #pragma tabsize 0

    #define COLOR_LIGHTBLUE 0x33CCFFAA

    #define COLOR_YELLOW 0xFFFF00AA

    #define COLOR_BLUE 0x2641FEAA

    #define COLOR_1GREEN 0x6BD700FF

    #define COLOR_WHITE  0xFFFFFFAA

    #define COLOR_1BLUE 0x0080FFFF

    #define PTP PlayerToPoint

    forward CustomPickups();

    forward vamaClose(playerid);

    forward vama1Close(playerid);

    forward vama2Close(playerid);

    forward vama3Close(playerid);

    forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);

    enum pInfo

    {

            pKey[128],

            pPassport,

    };

    new PlayerInfo[MAX_PLAYERS][pInfo];

    new vama;

    new vama1;

    new vama2;

    new vama3;

    new pickupvama;

    new pickupvama1;

    public OnGameModeInit()

    {

            pickupvama = CreatePickup(1239, 23, 600.9317,-1184.7410,20.7388);

            pickupvama1 = CreatePickup(1239, 23, 628.9692,-1188.7152,18.5387);

      CreateObject(967,-26.850067138672,-1334.3210449219,10.107961654663,0,0,40);

      CreateObject(967,-16.854888916016,-1346.0773925781,10.117139816284,0,0,220);

      CreateObject(984,-16.832099914551,-1336.0393066406,10.657336235046,0.5,0,309);

      CreateObject(1237,-21.910934448242,-1340.1557617188,10.029999732971,0,0,40);

      CreateObject(983,-24.58780670166,-1342.2296142578,10.658601760864,0,0,307.59997558594);

      CreateObject(1237,-27.26879119873,-1344.2724609375,9.9727392196655,0,0,38);

      CreateObject(1237,-11.728576660156,-1331.9340820313,10.049701690674,0,0,40);

      CreateObject(1290,-13.051498413086,-1333.0826416016,16.065097808838,0,0,310);

      CreateObject(1290,-19.289497375488,-1338.1264648438,16.029445648193,0,0,310);

      CreateObject(1290,-25.882446289063,-1343.2706298828,16.000564575195,0,0,308);

      CreateObject(983,-22.326164245605,-1332.8041992188,10.825042724609,0,0,310);

      CreateObject(983,-14.667671203613,-1342.1220703125,10.822408676147,0,0,309.29992675781);

      CreateObject(1237,-12.044784545898,-1339.9577636719,10.160488128662,0,0,38);

      CreateObject(1237,-19.686386108398,-1330.6033935547,10.163299560547,0,0,40);

      CreateObject(967,0.39705657958984,-1368.4739990234,9.8896732330322,0,0,220);

      CreateObject(967,-9.4363021850586,-1356.4261474609,9.8762083053589,0,0,38);

      CreateObject(1237,-4.556999206543,-1362.4818115234,9.7111129760742,0,0,308);

      CreateObject(983,-7.1737098693848,-1364.6610107422,10.448221206665,358.79998779297,0,309.20001220703);

      CreateObject(984,0.59994125366211,-1358.4221191406,10.193688392639,358.79992675781,0,309);

      CreateObject(1237,5.7537460327148,-1354.220703125,9.426513671875,0,0,38);

      CreateObject(1237,-9.8645248413086,-1366.8519287109,9.8185005187988,0,0,38);

      CreateObject(983,-5.0443267822266,-1355.2003173828,10.474130630493,359.20007324219,0,308.20001220703);

      CreateObject(983,2.7509002685547,-1364.4270019531,10.47036075592,359.29998779297,0,308.90002441406);

      CreateObject(1237,5.4575805664063,-1362.2467041016,9.7096014022827,0,0,38);

      CreateObject(1237,-2.3412475585938,-1353.0610351563,9.7135858535767,0,0,38);

      CreateObject(1290,4.3110275268555,-1355.3862304688,15.489709854126,0,0,310);

      CreateObject(1290,-1.9214477539063,-1360.3898925781,15.661690711975,0,0,310);

      CreateObject(1290,-8.4369926452637,-1365.6850585938,15.819143295288,0,0,308);

        vama = CreateObject(968,-26.361894607544,-1334.892578125,10.962881088257,0,90,310);

        vama1 = CreateObject(968,-17.39966583252,-1345.5533447266,10.879447937012,0,270,310);

vama2 = CreateObject(968,-8.9569120407104,-1357.0054931641,10.736392974854,0,90,309);

vama3 = CreateObject(968,-0.10332006216049,-1367.9127197266,10.680000305176,0,270,309.29992675781);

return 1;

    }

    public OnFilterScriptInit()

    {

    return 1;

    }

    public vamaClose()

    {

            MoveObject(vama, -26.361894607544,-1334.892578125,10.962881088257, 3.5);

            return 1;

    }

    public vama1Close()

    {

            MoveObject(vama1, -17.39966583252,-1345.5533447266,10.879447937012, 3.5);

            return 1;

    }

    public vama2Close()

    {

            MoveObject(vama2, -8.9569120407104,-1357.0054931641,10.736392974854, 3.5);

            return 1;

    }

    public vama3Close()

    {

            MoveObject(vama3, -0.10332006216049,-1367.9127197266,10.680000305176, 3.5);

            return 1;

    }

    public OnPlayerCommandText(playerid, cmdtext[])

    {

//------------------------------------Barrier--------------------------------------

            if(strcmp(cmdtext, "/vamat", true) == 0)

                {

                if(PlayerToPoint(3.0, playerid,  -16.8223,-1339.8367,10.9937))

                    {

                                if(PlayerInfo[playerid][pPassport] == 1)

                                    {

                                    MoveObject(vama1, -17.424459457397,-1345.57421875,11.012575149536, 5.5);

                                    SetTimer("vama1Close", 3000, 0);

                                    SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");

                        GivePlayerMoney(playerid,-100);

                                    return 1;

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");

                                    return 1;

                                    }

                                    }

                            else if(PlayerToPoint(5.0, playerid, -21.9065,-1336.4952,10.9705))

                                {

                                if(PlayerInfo[playerid][pPassport] == 1)

                                    {

                                    MoveObject(vama, -26.411027908325,-1334.9334716797,10.775354385376, 5.5);

                                    SetTimer("vamaClose", 3000, 0);

                                    SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");

                        GivePlayerMoney(playerid,-100);

                                    return 1;

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");

                                    return 1;

                                    }

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "You are not at Barrier.");

                                    return 1;

                                    }

                            else if(PlayerToPoint(5.0, playerid, -9.1664,-1361.7852,10.7733))

                                {

                                if(PlayerInfo[playerid][pPassport] == 1)

                                    {

                                    MoveObject(vama2, -8.9464988708496,-1356.9973144531,10.706520080566, 5.5);

                                    SetTimer("vamaClose", 3000, 0);

                                    SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");

                        GivePlayerMoney(playerid,-100);

                                    return 1;

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");

                                    return 1;

                                    }

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "You are not at Barrier.");

                                    return 1;

                                    }

                                    }

                            else if(PlayerToPoint(5.0, playerid, -5.5553,-1367.1934,10.7790))

                                {

                                if(PlayerInfo[playerid][pPassport] == 1)

                                    {

                                    MoveObject(vama3, -0.12400734424591,-1367.9291992188,11.005669593811, 5.5);

                                    SetTimer("vamaClose", 3000, 0);

                                    SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");

                        GivePlayerMoney(playerid,-100);

                                    return 1;

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");

                                    return 1;

                                    }

                                    }

                                    else

                                    {

                                    SendClientMessage(playerid, COLOR_WHITE, "You are not at Barrier.");

                                    return 1;

                                    }

                  return 0;

  }

    public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)

    {

        if(IsPlayerConnected(playerid))

            {

                    new Float:oldposx, Float:oldposy, Float:oldposz;

                    new Float:tempposx, Float:tempposy, Float:tempposz;

                    GetPlayerPos(playerid, oldposx, oldposy, oldposz);

                    tempposx = (oldposx -x);

                    tempposy = (oldposy -y);

                    tempposz = (oldposz -z);

                    //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);

                    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))

                    {

                            return 1;

                    }

            }

            return 0;

    }

    public OnPlayerConnect(playerid)

    {

            PlayerInfo[playerid][pPassport] = 1;

            return 1;

    }

    public OnPlayerPickUpPickup(playerid, pickupid)

    {

            if(pickupid == pickupvama)

            {

              GameTextForPlayer(playerid,"~w~Scrie ~r~/vamat ~w~pentru a deskide barriera",3000,5);

            }

            if(pickupid == pickupvama1)

            {

              GameTextForPlayer(playerid,"~w~Scrie ~r~/vamat ~w~pentru a deskide barriera",3000,5);

            }

            return 1;

    }

[/pawn]

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.