PDA

View Full Version : Pickup Error.


Weaselpwns
12/08/2014, 12:52 AM
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 (c) 1997-2006, ITB CompuPhase


1 Error.

Here's the code I've modified:


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.

Threshold
12/08/2014, 02:14 AM
Put it under OnGameModeInit

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;
}

Weaselpwns
12/08/2014, 03:58 PM
Thanks, it worked!