More pickups problem
#1

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... -.-
Reply
#2

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;

}
Reply
#3

what can i say... ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)