SA-MP Forums Archive
Pickup Error. - 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: Pickup Error. (/showthread.php?tid=531294)



Pickup Error. - Weaselpwns - 12.08.2014

So, this is the compiler output:
Код:
C:\Users\Gaming\Desktop\SA-MP Pawno\gamemodes\pickup.pwn(8) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Here's the code I've modified:

pawn Код:
new weapon;

weapon = CreatePickup(1276 ,2 ,1364.8728, -1279.6969, 13.5469, -1);// Line of the error.
//These are on top of my script^

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == weapon)
    {
        GivePlayerWeapon(playerid, 23, 50);
        SendClientMessage(playerid, 0xFFFFFFFF, "You've picked up a weapon!");
        GivePlayerMoney(playerid, -100);
    }
    return 1;
}
Thanks in advance.


Re: Pickup Error. - Threshold - 12.08.2014

Put it under OnGameModeInit

pawn Код:
new weapon; //Top of your script

public OnGameModeInit()
{
    weapon = CreatePickup(1276 ,2 ,1364.8728, -1279.6969, 13.5469, -1);// Line of the error.
    return 1;
}



Re: Pickup Error. - Weaselpwns - 12.08.2014

Thanks, it worked!