Pickup problem
#1

Hello,i've created a drugpack but Pawno doesn't let me compile.

OnGameModeInit:

pawn Код:
new DrugPack = CreatePickup(1279, 14, -2179.2732,-260.0395,36.5156, 0);
OnPlayerPickUpPickup

pawn Код:
if(pickupid == DrugPack)
    {
        SendClientMessage(playerid, red, "You have now the drug pack,now you can start the drug smuggling job with /drug and collecting drug also!");
        GameTextForPlayer(playerid, "~g~Drug pack taken!", 5000, 6);
        PlayerInfo[playerid][pDrug] = 20;
        HasTakenDrugPack[playerid] =1;
        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
       
        if(HasTakenDrugPack[playerid] == 1)
        {
        SendClientMessage(playerid,0xFF0000FF,"You have already a drug pack,you can't pickup it more.");
        }
    }
I keep getting this errors:

error 017: undefined symbol "DrugPack"
warning 204: symbol is assigned a value that is never used: "DrugPack"
Reply
#2

Make the DrugPack var global.
Reply
#3

Make it a gobal variable.

This forum requires that you wait 120 seconds between posts. Please try again in 62 seconds.

EDIT: Beaten to it -.- :P
Reply
#4

How to make it global variable?
Reply
#5

pawn Код:
new DrugPack;
public OnGameModeInit()
{
    DrugPack = CreatePickup(...);
    return 1;
}
Reply
#6

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)