SA-MP Forums Archive
My pickup Warnings... - 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: My pickup Warnings... (/showthread.php?tid=458329)



My pickup Warnings... - cray1100 - 16.08.2013

Ok, i get this warning,

Quote:

warning 215: expression has no effect

24 times... In this script,

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

new jedicollect1;
new jedicollect2;
new jedicollect3;
new sithcollect1;
new sithcollect2;
new sithcollect3;
new PickedUpJedi[MAX_PLAYERS];
new PickedUpSith[MAX_PLAYERS];

public OnFilterScriptInit()
{
    jedicollect1 = AddStaticPickup(1274, 15, -140.1850, 597.2230, 9.0258, -1);
    jedicollect2 = AddStaticPickup(1274, 15, 817.6894, 843.1435, 12.9462, -1);
    jedicollect3 = AddStaticPickup(1274, 15, 1748.3247, 630.2747, 10.3003, -1);
    sithcollect1 = AddStaticPickup(1274, 15, 1685.0314, 407.2442, 19.7121, -1);
    sithcollect2 = AddStaticPickup(1274, 15, 740.9005, 300.8302, 19.7186, -1);
    sithcollect3 = AddStaticPickup(1274, 15, -587.2263, -151.6541, 77.6556, -1);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    (PickedUpJedi[playerid] == 0);
    (PickedUpSith[playerid] == 0);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    (PickedUpJedi[playerid] == 0);
    (PickedUpSith[playerid] == 0);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    (PickedUpJedi[playerid] == 0);
    (PickedUpSith[playerid] == 0);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == jedicollect1)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            if(PickedUpJedi[playerid] == 0)
            {
                (PickedUpJedi[playerid] == 1);
            }
            else if(PickedUpJedi[playerid] == 1)
            {
                (PickedUpJedi[playerid] == 2);
            }
            else if(PickedUpJedi[playerid] == 2)
            {
                (PickedUpJedi[playerid] == 3);
            }
        }
    }
    else if(pickupid == jedicollect2)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            if(PickedUpJedi[playerid] == 0)
            {
                (PickedUpJedi[playerid] == 1);
            }
            else if(PickedUpJedi[playerid] == 1)
            {
                (PickedUpJedi[playerid] == 2);
            }
            else if(PickedUpJedi[playerid] == 2)
            {
                (PickedUpJedi[playerid] == 3);
            }
        }
    }
    else if(pickupid == jedicollect3)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            if(PickedUpJedi[playerid] == 0)
            {
                (PickedUpJedi[playerid] == 1);
            }
            else if(PickedUpJedi[playerid] == 1)
            {
                (PickedUpJedi[playerid] == 2);
            }
            else if(PickedUpJedi[playerid] == 2)
            {
                (PickedUpJedi[playerid] == 3);
            }
        }
    }
    else if(pickupid == sithcollect1)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            if(PickedUpSith[playerid] == 0)
            {
                (PickedUpSith[playerid] == 1);
            }
            else if(PickedUpSith[playerid] == 1)
            {
                (PickedUpSith[playerid] == 2);
            }
            else if(PickedUpSith[playerid] == 2)
            {
                (PickedUpSith[playerid] == 3);
            }
        }
    }
    else if(pickupid == sithcollect2)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            if(PickedUpSith[playerid] == 0)
            {
                (PickedUpSith[playerid] == 1);
            }
            else if(PickedUpSith[playerid] == 1)
            {
                (PickedUpSith[playerid] == 2);
            }
            else if(PickedUpSith[playerid] == 2)
            {
                (PickedUpSith[playerid] == 3);
            }
        }
    }
    else if(pickupid == sithcollect3)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            if(PickedUpSith[playerid] == 0)
            {
                (PickedUpSith[playerid] == 1);
            }
            else if(PickedUpSith[playerid] == 1)
            {
                (PickedUpSith[playerid] == 2);
            }
            else if(PickedUpSith[playerid] == 2)
            {
                (PickedUpSith[playerid] == 3);
            }
        }
    }
    return 1;
}
And i dont understand why, can someone help me?


Re: My pickup Warnings... - Binx - 16.08.2013

pawn Код:
(PickedUpSith[playerid] == 1);
Needs to be
pawn Код:
PickedUpSith[playerid] == 1;
So remove the ()


Re: My pickup Warnings... - cray1100 - 16.08.2013

Do i need to do that to EVERY SINGLE ONE?


Re: My pickup Warnings... - Binx - 16.08.2013

Yes.


Re: My pickup Warnings... - cray1100 - 16.08.2013

Even, the...

if(PickedUpSith[playerid] == 0) 's?


Re: My pickup Warnings... - Binx - 16.08.2013

If it's an "if" statement, no.


Re: My pickup Warnings... - cray1100 - 16.08.2013

I tried it, and still got the warnings


Re: My pickup Warnings... - Ballu Miaa - 16.08.2013

You should use CreatePickup() to make pickups for that purpose. Here's the wiki link , click here.


Re: My pickup Warnings... - cray1100 - 16.08.2013

I tried that... Thats what i had at first, thats why i tried to use addstaticpickup... Neither work...


Re: My pickup Warnings... - cray1100 - 16.08.2013

Someone please help... ),: