SA-MP Forums Archive
Unreachable code - 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: Unreachable code (/showthread.php?tid=401067)



Unreachable code - Riggster - 21.12.2012

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;
}



Re: Unreachable code - Riggster - 21.12.2012

Anyone?


Re: Unreachable code - Mr.Anonymous - 21.12.2012

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);
}



Re: Unreachable code - Lapon - 21.12.2012

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.


Re: Unreachable code - Mr.Anonymous - 21.12.2012

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.


Re: Unreachable code - Riggster - 21.12.2012

What?


Re: Unreachable code - Mr.Anonymous - 21.12.2012

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


Re: Unreachable code - Riggster - 21.12.2012

I dont get what u mean


Re: Unreachable code - Yiin - 21.12.2012

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;
}