Pickup Help
#1

Hi I am getting these errors and warning from ym script.

Код:
(76) : error 028: invalid subscript (not an array or too many subscripts): "armourpickup"
(78) : warning 217: loose indentation
(80) : error 010: invalid function or declaration
(57) : warning 204: symbol is assigned a value that is never used: "armourpickup"
Here is my code for OnPlayerPickUpPickup:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == healthpickup)
    {
        SendClientMessage(playerid, COLOR_RED, "You are now healed, you cannot collect this again until after death.");
        SetPlayerHealth(playerid, 100);
    }
    else if(pickupid == (armourpickup)
    { // Line 76
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your armour has been refilled, you cannot collect this again until after death.");
        SetPlayerArmour(playerid, 100); // Line 78
    }
    return 1; // Line 80
}

Line 57, this is under OnGameModeInit
pawn Код:
armourpickup = CreatePickup(1242, 3, -2245.4641, 2301.4973, 4.9700, -1);



I have these defined at the top:
pawn Код:
// Variables
new healthpickup;
new armourpickup;

So whats wrong with this then?
Reply
#2

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == healthpickup)
    {
        SendClientMessage(playerid, COLOR_RED, "You are now healed, you cannot collect this again until after death.");
        SetPlayerHealth(playerid, 100);
    }
    else if(pickupid == armourpickup)//<------------
    { // Line 76
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your armour has been refilled, you cannot collect this again until after death.");
        SetPlayerArmour(playerid, 100); // Line 78
    }
    return 1; // Line 80
}
take the bracket out here like i have done
Reply
#3

Such a simple mistake and a simple solution.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)