error 010: invalid function or declaration
#1

Hello, I'm quite new to scripting and I get this error when trying to compile a piece of script.

Code:
error 010: invalid function or declaration
The error is in line 8129.

Here's the code:

Code:
new skyspickup1;

skyspickup1 = CreatePickup(19130, 1, 17.8010, 1526.4569, 70.1786, 0); <- line 8129.

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == skyspickup1)
	{
	SetPlayerPos(playerid, 13.5926, 1524.2189, 75.7102);
	return 1;
	}
return 0;
}
Reply
#2

show us line 8129
Reply
#3

I've marked in the original post, but here it is :P.

Code:
skyspickup1 = CreatePickup(19130, 1, 17.8010, 1526.4569, 70.1786, 0); <- line 8129.
Reply
#4

try this

Code:
new skyspickup1;

skyspickup1 = CreatePickup(19130, 1, 17.8010, 1526.4569, 70.1786);

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == skyspickup1)
	{
	SetPlayerPos(playerid, 13.5926, 1524.2189, 75.7102);
	return 1;
	}
return 0;
}
Reply
#5

Your code is good, change thr last 0 to -1
Reply
#6

Tried out both of the possible fixes, the same error still appears in the same line though.
Reply
#7

Quote:
Originally Posted by Kynice
View Post
Tried out both of the possible fixes, the same error still appears in the same line though.
Did u paste your coding under ongamemodeinit?
Reply
#8

Code:
new skyspickup1;

public OnGameModeInit()
{
    skyspickup1 = CreatePickup(19130, 1, 17.8010, 1526.4569, 70.1786);  >>>> place in onGameModeInit()
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == skyspickup1)
	{
	SetPlayerPos(playerid, 13.5926, 1524.2189, 75.7102);
	return 1;
	}
return 0;
}
Reply
#9

Quote:
Originally Posted by NewFreeroamStunt
View Post
Code:
new skyspickup1;

public OnGameModeInit()
{
    skyspickup1 = CreatePickup(19130, 1, 17.8010, 1526.4569, 70.1786);  >>>> place in onGameModeInit()
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == skyspickup1)
	{
	SetPlayerPos(playerid, 13.5926, 1524.2189, 75.7102);
	return 1;
	}
return 0;
}
Yes this is what i mean, copy and paste this
Reply
#10

That worked, thanks a ton for the help. Missed that part on the SA-MP wiki.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)