SA-MP Forums Archive
More pickups problem - 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: More pickups problem (/showthread.php?tid=175988)



More pickups problem - nejc001 - 11.09.2010

I want to have script like this
Код:
new bcp1;
new bcp2;

public OnGameModeInit()
{
bcp1 = CreatePickup(1239, 2, 2245.5100,-1188.6433,33.5313, 0);
bcp2 = CreatePickup(1239, 2, 2193.4993,-1147.6654,1033.7969, 0);
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == bcp1) SetPlayerPos(playerid,2193.1792,-1165.0936,1031.2986); SetPlayerInterior(playerid,15);
    return 1;

    if(pickupid == bcp2) SetPlayerPos(playerid,2192.9453,-1151.6418,33.5240); SetPlayerInterior(playerid,0);
    return 1;

}
I get *warning 225: unreachable code* for script line: if(pickupid == bcp2)...
Anyone knows why?

Problem is, if i try it like this, than pickup bcp2 doesnt work and than i deleted *return 1;* under if(pickupid == bcp1)... and i get no warnings, but then pickup bcp1 doesnt work right.
I tryed to add more brackets on spots where should be, but no... -.-


Re: More pickups problem - Rachael - 11.09.2010

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == bcp1)
    {
         SetPlayerPos(playerid,2193.1792,-1165.0936,1031.2986);
         SetPlayerInterior(playerid,15);
         return 1;
    }
    if(pickupid == bcp2)
    {
         SetPlayerPos(playerid,2192.9453,-1151.6418,33.5240);
         SetPlayerInterior(playerid,0);
         return 1;
     }
     return 1;

}



Re: More pickups problem - nejc001 - 11.09.2010

what can i say... ty