INC Problems
#1

I'm making a simple include for my server and i added a Repair(vehicleid) function but im getting this error D:
pawn Код:
C:\Documents and Settings\Rhys\Desktop\samp03dsvr_RC7_win32\pawno\include\Usefull_Functions.INC(6) : error 021: symbol already defined: "Repair"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
I Dont Get Why This Has Happened here is my code
pawn Код:
#include <a_samp>

native Repair(vehicleid);


stock Repair(vehicleid)
{
    RepairVehicle(vehicleid);
}
Any Ideas
Reply
#2

Don't compile it, just save it as .inc in a notepad, then include it in your script.
Reply
#3

So I Carry On As Normal?
Reply
#4

Quote:
Originally Posted by Zonoya
Посмотреть сообщение
So I Carry On As Normal?
Yes, just don't use pawno to create it set it as a .inc, use notepad.
Reply
#5

That Wont work i include it on my GM and it gives the same error it gave on the Include
Reply
#6

Quote:
Originally Posted by Zonoya
Посмотреть сообщение
That Wont work i include it on my GM and it gives the same error it gave on the Include
Show me how you did it in your script, and how you did it in your .inc, btw don't forget the native shouldn't be added in the script aswell.
Reply
#7

here is the include:
pawn Код:
native Repair(vehicleid);

#include <a_samp>

stock Repair(vehicleid)
{
    RepairVehicle(vehicleid);
}
Here is a snippet of my GM including the include:
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <Usefull_Functions>

#pragma tabsize 0

main()
{
    print("\n----------------------------------");
    print("  Bare Script\n");
    print("----------------------------------\n");
}

public OnPlayerConnect(playerid)
{
    GameTextForPlayer(playerid,"~r~Call Of Duty: ~b~MW~g~2~b~(Roleplay)",5000,5);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
    TogglePlayerClock(playerid,0);
    return 1;
}
and here are the errors:
Код:
C:\Documents and Settings\Rhys\Desktop\samp03dsvr_RC7_win32\pawno\include\Usefull_Functions.inc(6) : error 021: symbol already defined: "Repair"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
thats plain and simple my problem D:
Reply
#8

You can't create native functions like that - read the pawn-language documentation to see how native functions are created or see How to create a plugin Tutorial. You can comment the native part so it will appear in your native list - right side of pawno:

pawn Код:
#include <a_samp>

/*
native Repair(vehicleid);
*/


stock Repair(vehicleid)
{
    RepairVehicle(vehicleid);
}
Reply
#9

Sorry for the late reply, but since its just a simple stock, with actually 1 function inside, why on earth would you wanna use native Repair(vehicleid) ?
Reply
#10

SmiT Thx +rep but i want the functions to appear on the includes functions list and only native can do that D:
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)