pragma library - 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: pragma library (
/showthread.php?tid=400439)
pragma library -
zgintasz - 18.12.2012
Hi,
can someone give me idea of using #pragma library, I mean how to use it? Don't say it's useless, I must try it myself first.
Thanks.
Re: pragma library -
ReneG - 18.12.2012
Never had to use it before, but it says it's often misused in SA-MP
Re: pragma library -
zgintasz - 18.12.2012
I know, but if it's mentioned in wiki, it should be able to be used. Example please.
Re: pragma library -
ReneG - 18.12.2012
Found an old include that uses it.
pawn Код:
/*
* PointToPoint Functions
* © Copyright 2010, Blacklite & <__Ethan__>
*
*/
#if defined _PointToPoint_included
#endinput
#endif
#define _PointToPoint_included
#pragma library PointToPoint
native Float:PointToPoint2D(Float:x1,Float:y1,Float:x2,Float:y2);
native Float:PointToPoint3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2);
Where "PointToPoint" was the .dll file in the plugins directory. Did you read the wiki? It's pretty straight forward
Re: pragma library -
Ballu Miaa - 18.12.2012
Only usage i think of it is this:
pawn Код:
#pragma unused intvar
/*
This appears after the symbol you wish to surpress the "symbol is never used" warning for. Generally the preferred method of doing this is by using stock however this is not always applicable (e.g. function parameters cannot not be compiled).
*/
Re: pragma library -
zgintasz - 18.12.2012
Quote:
Originally Posted by VincentDunn
Found an old include that uses it.
pawn Код:
/* * PointToPoint Functions * © Copyright 2010, Blacklite & <__Ethan__> * */
#if defined _PointToPoint_included #endinput #endif #define _PointToPoint_included #pragma library PointToPoint
native Float:PointToPoint2D(Float:x1,Float:y1,Float:x2,Float:y2); native Float:PointToPoint3D(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2);
Where "PointToPoint" was the .dll file in the plugins directory. Did you read the wiki? It's pretty straight forward
|
Oh, so it works exactly the same as plugin? I thought it's something different. What is the difference in writing "#pragma library PointToPoint" and not in this example? The result will be the same.