2 problems
#1

1. - The first GameTextForPlayer shows up, the other 2 don't

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == armourpickup)
    {
        SetPlayerArmour(playerid, 100);
        GameTextForPlayer(playerid, "ARMOR NAPUNJEN!", 3000, 5);
    }
    return 1;
    
    if(pickupid == zatvorpickup)
    {
    GameTextForPlayer(playerid, "Zatvor (/enter)", 3000, 4);
    }
    return 1;
    
	if(pickupid == enterpickup)
    {
    GameTextForPlayer(playerid, "Koristi /enter da udjes", 3000, 4);
    }
    return 1;
}
2. When entered in LSPD and bank, everything's grey, even though I'm positive the interiors are correct.

Код:
CMD:enter(playerid, params[])
{
        if(IsPlayerInRangeOfPoint(playerid, 5, 1554.7246,-1675.5688,16.1953))//PD
        SetPlayerPos(playerid, 246.40,110.84,1003.22);
        SetPlayerInterior(playerid, 10);
        return 1;
        if(IsPlayerInRangeOfPoint(playerid, 5, 1455.1255,-1010.9031,26.8438))//BANK
        SetPlayerPos(playerid, 2315.952880,-1.618174,26.742187);
        SetPlayerInterior(playerid, 0);
        return 1;
}

CMD:exit(playerid, params[])
{
        if(IsPlayerInRangeOfPoint(playerid, 5, 246.40,110.84,1003.22)) //PD
        SetPlayerPos(playerid, 1554.7246,-1675.5688,16.1953);
        SetPlayerInterior(playerid, 0);
        return 1;
        if(IsPlayerInRangeOfPoint(playerid, 5, 2315.952880,-1.618174,26.742187)) //BANK
        SetPlayerPos(playerid, 1455.1255,-1010.9031,26.8438);
        SetPlayerInterior(playerid, 0);
        return 1;
}
Thanks
Reply
#2

Also, warning 225: unreachable code appears on all of these.
Reply
#3

I HAVE EDITED THIS:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == armourpickup)
    {
        SetPlayerArmour(playerid, 100);
        GameTextForPlayer(playerid, "ARMOR NAPUNJEN!", 3000, 5);
    }
    // removed return 1;
   
    else if(pickupid == zatvorpickup)
    {
        GameTextForPlayer(playerid, "Zatvor (/enter)", 3000, 4);
    }
    // removed return 1;
   
    if(pickupid == enterpickup)
    {
        GameTextForPlayer(playerid, "Koristi /enter da udjes", 3000, 4);
    }
    return 1; // Removed return 1;, then added it back because this should return a value
}
This should fix your unreachable code problem

And then:

pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 1554.7246,-1675.5688,16.1953))//PD
    {
        SetPlayerPos(playerid, 246.40,110.84,1003.22);
        SetPlayerInterior(playerid, 6); // Make sure this interior ID is right! LSPD = 6, LVPD = 3, SFPD = 10
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5, 1455.1255,-1010.9031,26.8438))//BANK
    {
        SetPlayerPos(playerid, 2315.952880,-1.618174,26.742187);
        SetPlayerInterior(playerid, 0); // This interior ID for the palomino bank is correct.
    }
    return 1;
}

//If it's still showing up Gray, then the coordinates are wrong.

CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 246.40,110.84,1003.22)) //PD
    {
        SetPlayerPos(playerid, 1554.7246,-1675.5688,16.1953);
        SetPlayerInterior(playerid, 0);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5, 2315.952880,-1.618174,26.742187)) //BANK
    {
        SetPlayerPos(playerid, 1455.1255,-1010.9031,26.8438);
        SetPlayerInterior(playerid, 0);
    }
    return 1;
}
Reply
#4

Thanks!
Reply
#5

Quote:
Originally Posted by Strummer
Посмотреть сообщение
Thanks!
I've edited that post quite a couple of times, but I promise you that the latest edit is the best way you should do it, and it's 100% correct, I hope.

And you're welcome! Enjoy
Reply
#6

Oh, GameText still doesn't show up :S And for some reason, whenever I use /exit, SERVER: Unknown command comes up, even if I do exit it.
Reply
#7

Quote:
Originally Posted by Strummer
Посмотреть сообщение
Oh, GameText still doesn't show up :S And for some reason, whenever I use /exit, SERVER: Unknown command comes up, even if I do exit it.
I'm not certain about the GameText, but replace CMD:exit with this:

pawn Код:
CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 246.40,110.84,1003.22)) //PD
    {
        SetPlayerPos(playerid, 1554.7246,-1675.5688,16.1953);
        SetPlayerInterior(playerid, 0);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 5, 2315.952880,-1.618174,26.742187)) //BANK
    {
        SetPlayerPos(playerid, 1455.1255,-1010.9031,26.8438);
        SetPlayerInterior(playerid, 0);
    }
    return 1; // You needed this.
}
Completely my fault, sorry.
Reply
#8

Thanks, don't apologize, you've been really helpful
Reply
#9

Managed to handle the GameText. I just created arrays for each of the pickups and it shows it on each and every one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)