SA-MP Forums Archive
INC Problems - 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: INC Problems (/showthread.php?tid=295013)



INC Problems - Zonoya - 04.11.2011

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


Re: INC Problems - =WoR=G4M3Ov3r - 04.11.2011

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


Re: INC Problems - Zonoya - 04.11.2011

So I Carry On As Normal?


Re: INC Problems - =WoR=G4M3Ov3r - 04.11.2011

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.


Re: INC Problems - Zonoya - 04.11.2011

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


Re: INC Problems - =WoR=G4M3Ov3r - 04.11.2011

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.


Re: INC Problems - Zonoya - 04.11.2011

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:


Re: INC Problems - SmiT - 04.11.2011

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



Re: INC Problems - =WoR=G4M3Ov3r - 04.11.2011

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) ?


Re: INC Problems - Zonoya - 04.11.2011

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