Pickup's messed up
#1

My Pickups are all messed up. I'm going to copy the code here. I've been struggling with this problem for a few days now and I still can't figure it out. Please help me.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    Elud = CreatePickup(1240,1, X, Y, Z, -1);
    if(playerid == CashboxOwner)
    {
        new str[128], pName[MAX_PLAYER_NAME];
        GetPlayerPos(playerid, CashboxX, CashboxY, CashboxZ);
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "Cashbox owner %s (ID: %d) died and he dropped his cashbox", pName, playerid);
        DisablePlayerCheckpoint(playerid);
        SendClientMessageToAll(0xFFD700AA, str);
        CashboxPickup = CreatePickup(1210, 3, CashboxX, CashboxY, CashboxZ);
        CashboxOwner = INVALID_PLAYER_ID;
        if(mode == 1)
        {
            for(new i; i<MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    SetPlayerCheckpoint(i, CashboxX, CashboxY, CashboxZ, 1);
                }
            }
        }
    }
    return 1;
}
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == CashboxPickup)
    {
        PlayerPlaySound(playerid, 1150, 0, 0, 0);
        new str[128], pName[MAX_PLAYER_NAME];
        DestroyPickup(CashboxPickup);
        IsCashboxPickedUp = 1;
        CashboxOwner = playerid;
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "%s  picked up the cashbox. Kill him before he reaches the droplocation.", pName);
        SendClientMessageToAll(0xFFD700AA, str);
        if(mode == 1)
        {
            for(new i; i<MAX_PLAYERS; i++)
            {
                DisablePlayerCheckpoint(i);
            }
        }
        SetPlayerCheckpoint(playerid, DropLocation[0], DropLocation[1], DropLocation[2], 3);
    }
    if(pickupid == Elud)
    {
    SetPlayerHealth(playerid,100);
    }
    return 1;
}
My problem is with the pickup "Elud". The pickup creates when you kill someone. When I'm trying to pick up the "Elud" pickup then the cashbox string shows up. They're kinda messed up.
+REP to the person who helps me out!
Reply
#2

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == CashboxPickup)
    {
        PlayerPlaySound(playerid, 1150, 0, 0, 0);
        new str[128], pName[MAX_PLAYER_NAME];
        DestroyPickup(CashboxPickup);
        IsCashboxPickedUp = 1;
        CashboxOwner = playerid;
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "%s  picked up the cashbox. Kill him before he reaches the droplocation.", pName);
        SendClientMessageToAll(0xFFD700AA, str);
        if(mode == 1)
        {
            for(new i; i<MAX_PLAYERS; i++)
            {
                DisablePlayerCheckpoint(i);
            }
        }
        SetPlayerCheckpoint(playerid, DropLocation[0], DropLocation[1], DropLocation[2], 3);
        return 1;
    }
    if(pickupid == Elud)
    {
    SetPlayerHealth(playerid,100);
    }
    return 1;
}
You forgot the return 1;
Reply
#3

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == CashboxPickup)
    {
        PlayerPlaySound(playerid, 1150, 0, 0, 0);
        new str[128], pName[MAX_PLAYER_NAME];
        DestroyPickup(CashboxPickup);
        IsCashboxPickedUp = 1;
        CashboxOwner = playerid;
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "%s  picked up the cashbox. Kill him before he reaches the droplocation.", pName);
        SendClientMessageToAll(0xFFD700AA, str);
        if(mode == 1)
        {
            for(new i; i<MAX_PLAYERS; i++)
            {
                DisablePlayerCheckpoint(i);
            }
        }
        SetPlayerCheckpoint(playerid, DropLocation[0], DropLocation[1], DropLocation[2], 3);
        return 1;
    }
    if(pickupid == Elud)
    {
        SetPlayerHealth(playerid,100);
    }
    return 1;
}
pawn Код:
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(145) : warning 217: loose indentation
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(170) : warning 225: unreachable code
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(170) : warning 217: loose indentation
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(170) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(170) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(172) : error 017: undefined symbol "cmdtext"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(196) : error 017: undefined symbol "cmdtext"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(214) : warning 225: unreachable code
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(214) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(214) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(243) : warning 225: unreachable code
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(243) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(243) : error 004: function "OnPlayerPickUpPickup" is not implemented
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(245) : error 017: undefined symbol "pickupid"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(265) : error 017: undefined symbol "pickupid"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(272) : warning 225: unreachable code
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(272) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(272) : error 017: undefined symbol "StartNewCashboxGame"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(273) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(273) : error 017: undefined symbol "StartNewCashboxGame"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(315) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(315) : error 017: undefined symbol "DropCashboxValue"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(316) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(316) : error 017: undefined symbol "DropCashboxValue"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(348) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(348) : error 017: undefined symbol "ResetCam"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(349) : error 029: invalid expression, assumed zero
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(349) : error 017: undefined symbol "ResetCam"
C:\Users\Alari\Desktop\Server\Server\filterscripts\PWN FAILID\RahaMinigame.pwn(356) : error 030: compound statement not closed at the end of file (started at line 142)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


23 Errors.
Reply
#4

Hmmm... Remove then return 1; and change the places of the scripts - place the Elud pickup check on the top and the cashbox at the bottom.
Reply
#5

Still nothing , Thanks for trying tho
Reply
#6

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == CashboxPickup)
    {
        PlayerPlaySound(playerid, 1150, 0, 0, 0);
        new str[128], pName[MAX_PLAYER_NAME];
        DestroyPickup(CashboxPickup);
        IsCashboxPickedUp = 1;
        CashboxOwner = playerid;
        GetPlayerName(playerid, pName, sizeof(pName));
        format(str, 128, "%s  picked up the cashbox. Kill him before he reaches the droplocation.", pName);
        SendClientMessageToAll(0xFFD700AA, str);
        if(mode == 1)
        {
            for(new i; i<MAX_PLAYERS; i++)
            {
                DisablePlayerCheckpoint(i);
            }
        }
        SetPlayerCheckpoint(playerid, DropLocation[0], DropLocation[1], DropLocation[2], 3);
    }
    else if(pickupid == Elud) SetPlayerHealth(playerid,100);
    return 1;
}
Reply
#7

Doesn't work with your code either... Is it really so impossible..
Reply
#8

bbbbbbump
Reply
#9

When you destroy a pickup the pickup id coming next becomes the one you destroyed and once you create another, it becomes the next pickup id.
To explain better, once you destroy CashBoxPickup, Elude becomes CashBoxPickup and once you re-create CashBoxPickup, it become Elude.
Reply
#10

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
When you destroy a pickup the pickup id coming next becomes the one you destroyed and once you create another, it becomes the next pickup id.
To explain better, once you destroy CashBoxPickup, Elude becomes CashBoxPickup and once you re-create CashBoxPickup, it become Elude.
Could you please fix this script for me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)