Unreachable code
#1

Hi,
I have made two pickups for the enter and exit of the LSPD, but the when I put the second one in the OnPlayerPickUpPickUp it says "Unreachable code can anyone please help. Here is my code :-

Код:
        public OnGameModeInit()
{	
        LSPD =  CreatePickup(1247, 1, 1554.3307,-1675.5238,16.1953, -1);
	LSPD2 = CreatePickup(1239, 1, 246.2705,108.3405,1003.2188, -1);

        public OnPlayerPickUpPickup(playerid, pickupid)
{
        if(pickupid == LSPD) SetPlayerInterior(playerid, 10); SetPlayerPos(playerid, 246.3931,110.4512,1003.2188 );                      SendClientMessage(playerid, 0x33AA33AA, "* You have enterd the LSPD.");
	return 1;
	if(pickupid == LSPD2) SetPlayerInterior(playerid, 0); SetPlayerPos(playerid,                           2473.1999512,-1685.9000244,10.8999996);    SendClientMessage(playerid, 0x33AA33AA, "* You have left the LSPD.");
	return 1;
}
Reply
#2

Anyone?
Reply
#3

I see you missed a brace there.

pawn Код:
public OnGameModeInit()
{  
        LSPD =  CreatePickup(1247, 1, 1554.3307,-1675.5238,16.1953, -1);
    LSPD2 = CreatePickup(1239, 1, 246.2705,108.3405,1003.2188, -1);
}
Reply
#4

Hello you have made a mistake the pickup system should be like this

PHP код:
CreatePickup(modeltypeFloat:XFloat:YFloat:Zvirtualworld 0); 
So change your code to format like this this could be the reason.
Reply
#5

Quote:
Originally Posted by Lapon
Посмотреть сообщение
Hello you have made a mistake the pickup system should be like this

PHP код:
CreatePickup(modeltypeFloat:XFloat:YFloat:Zvirtualworld 0); 
So change your code to format like this this could be the reason.
Nope.
Reply
#6

What?
Reply
#7

Quote:
Originally Posted by Riggster
Посмотреть сообщение
What?
See my first post.
Reply
#8

I dont get what u mean
Reply
#9

pawn Код:
public OnGameModeInit()
{
    LSPD =  CreatePickup(1247, 1, 1554.3307,-1675.5238,16.1953, -1);
    LSPD2 = CreatePickup(1239, 1, 246.2705,108.3405,1003.2188, -1);
    return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == LSPD)
    {
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid, 246.3931,110.4512,1003.2188 );
        SendClientMessage(playerid, 0x33AA33AA, "* You have enterd the LSPD.");
        return 1;
    }
    if(pickupid == LSPD2)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 2473.1999512,-1685.9000244,10.8999996);
        SendClientMessage(playerid, 0x33AA33AA, "* You have left the LSPD.");
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)