SA-MP Forums Archive
error 010: invalid function or declaration - 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: error 010: invalid function or declaration (/showthread.php?tid=636537)



error 010: invalid function or declaration - Kynice - 29.06.2017

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



Re: error 010: invalid function or declaration - MrCesar - 29.06.2017

show us line 8129


Re: error 010: invalid function or declaration - Kynice - 29.06.2017

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.



Re: error 010: invalid function or declaration - NewFreeroamStunt - 29.06.2017

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



Re: error 010: invalid function or declaration - 1fret - 29.06.2017

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


Re: error 010: invalid function or declaration - Kynice - 29.06.2017

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


Re: error 010: invalid function or declaration - 1fret - 29.06.2017

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?


Re: error 010: invalid function or declaration - NewFreeroamStunt - 29.06.2017

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



Re: error 010: invalid function or declaration - 1fret - 29.06.2017

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


Re: error 010: invalid function or declaration - Kynice - 29.06.2017

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