I'm new in includes
#1

Hello!

I'm new in includes. I made a native in a_vehicles.inc, added a function in gamemode, but when I open the server it says function is not found And here I ask, in what file and where I must "install" it
Reply
#2

you should get a_vehicle into the pawno file - includes , Then it will work well
Reply
#3

Native... is simply allows you to add it into your PAWNO menu in the right side.
There you could see the native, it's kinda helping. However, you need to make a function/stock.
Native doesn't do it.
Reply
#4

Hmm... I must compile it? (asking, because I can't open it with Pawno )

Ok, so about the function - where? (I kinda couldn't do that with stock)
Reply
#5

Compile includes then open with notepad to change to .inc
Reply
#6

Ok - I must compile. But everythere I got this error: error 013: no entry point (no public functions)

=)
Reply
#7

Let me explain to you like that.
Credits for SA-MP Wiki.

Native:
"A native function is one defined in the virtual machine (i.e. the thing which runs the script), not in the script itself.
You can only define native functions if they're coded into SA:MP or a plugin, however you can create fake natives.
Because the native functions from .inc files are detected by pawno and listed in the box on the right hand side of pawno.
it can be useful to use native to get your own custom functions listed there."


Example:
pawn Code:
native FunctionName(playerid, const string[]);
Native is simply needed when you create a specific function/stock.

Lets say I have created a simple function that tells your ID.
I will have to forward it also.
Example:
pawn Code:
forward ShowID(playerid);
public ShowID(playerid)
{
    new string[14];
    format(string, sizeof(string), "Your ID: %d!",playerid)
    SendClientMessageToAll(0xFFFFFFAA, string);
    return 1;
}
Now, if you don't use a native for that function. so on the right side you won't see ShowID example.
Like, GivePlayerMoney, GetPlayerMoney and etc.

If you make a new include and type inside:
pawn Code:
native ShowID(playerid);
When you open the pawno program, it will automatically show it.
Reply
#8

Quote:
Originally Posted by EliranPesahov
View Post
Let me explain to you like that.
Credits for SA-MP Wiki.

Native:
"A native function is one defined in the virtual machine (i.e. the thing which runs the script), not in the script itself.
You can only define native functions if they're coded into SA:MP or a plugin, however you can create fake natives.
Because the native functions from .inc files are detected by pawno and listed in the box on the right hand side of pawno.
it can be useful to use native to get your own custom functions listed there."


Example:
pawn Code:
native FunctionName(playerid, const string[]);
Native is simply needed when you create a specific function/stock.

Lets say I have created a simple function that tells your ID.
I will have to forward it also.
Example:
pawn Code:
forward ShowID(playerid);
public ShowID(playerid)
{
    new string[14];
    format(string, sizeof(string), "Your ID: %d!",playerid)
    SendClientMessageToAll(0xFFFFFFAA, string);
    return 1;
}
Now, if you don't use a native for that function. so on the right side you won't see ShowID example.
Like, GivePlayerMoney, GetPlayerMoney and etc.

If you make a new include and type inside:
pawn Code:
native ShowID(playerid);
When you open the pawno program, it will automatically show it.
NICE SOLUTION MAN, I've been trying to add my methods to the right bar just as you said and been looking around for the soultion. Big Help A+

Edited: Worked perfectly thank you XP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)