How to make include file?
#1

Hello,
plz tell me how to make include file, and need scripter and tester plz help me
i am very thankful to you
Reply
#2

Right at top
pawn Код:
#if defined _iggy_included
    #endinput
#endif
#define _iggy_included
//your funtions here.
Makes an include called "iggy" in script use #include <iggy>. delete all callbacks, oh and save it with the extenson .inc (don't compile just save)

Edit: Just thought id add this too, if you want your includes functions to show on the function list on the right hand side of PAWNO, do the following underneath your include text (above).
pawn Код:
/*
native playername(playerid);
native IsInArea(playerid, Float:min_x, Float:min_y, Float:max_x, Float:max_y);
native GetWeaponIDFromName(WeaponName[]);
native IsValidEmail(const email[]);
*/
Obviously swap them for your own fuctions. hope this helped.
Reply
#3

I tried it, it doesn't work for me.
Код:
#if !defined _samp_included
	#error "Please include a_samp.inc before a_other.inc!"
#endif
#if !defined mysql_included
	#error "Please include a_mysql.inc before a_other.inc!"
#endif
#if defined _a_other2_included
	#endinput
#endif
#define _a_other2_included
#pragma library a_other2
stock explode(string[],delim[],result[][],maxsplit=0,size1 = sizeof(result), size2 = sizeof(result[]))
{
    new track=0,idx=0, maxlen = strlen(string), tmpx;
    while (idx < maxlen)
    {
        //Scan the string for our search.
        tmpx = strfind(string,delim,true,idx);
        if (tmpx != -1 && ((maxsplit > 0 && track < maxsplit) || (maxsplit == 0)))
        {
            //If we found it..
	    	strmid(result[track],string,idx,tmpx,size2);
	    	idx = tmpx + 1;
    	}
    	else
    	{
    	    //..Otherwise..
    	    strmid(result[track],string,idx,strlen(string),size2);
    	    idx = strlen(string);
		}
		track++;
		//..And if they are out of space in their storage array.. Shut it down.
		if (track > size1)
		    idx = strlen(string);
    }
    return result;
}
stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5,col6)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {

                    GetPlayerPos(i, posx, posy, posz);
                    tempposx = (oldposx -posx);
                    tempposy = (oldposy -posy);
                    tempposz = (oldposz -posz);
                    printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                    if (((tempposx < radi/32) && (tempposx > -radi/32)) && ((tempposy < radi/32) && (tempposy > -radi/32)) && ((tempposz < radi/32) && (tempposz > -radi/32)))
                    {
                        SendClientMessage(i, col1, string);
                    }
                    else if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                    {
                        SendClientMessage(i, col2, string);
                    }
                    else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                    {
                        SendClientMessage(i, col3, string);
                    }
                    else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                    {
                        SendClientMessage(i, col4, string);
                    }
                    else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                    {
                        SendClientMessage(i, col5, string);
                    }
                    else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                    {
                        SendClientMessage(i, col6, string);
                    }
                }
                else
                {
                    SendClientMessage(i, col1, string);
                }
            }
        }
    //not connected
    return 1;
}
stock GetFLName(playerid) //F = First L = Last
{
  new string[24];
  GetPlayerName(playerid,string,24);
  new pos = strfind(string,"_", true);
  if(pos != -1)
  string[pos] = ' ';
  return string;
}
stock GetUserName(playerid)
{
  new tehname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, tehname, sizeof(tehname));
  return tehname;
}
/*
stock SelectMySQL(ExplodeSplit[6][32])
{
	new Data[80];
	mysql_fetch_row_format(Data, "|");
	explode(ExplodeSplit, Data, "|");
	return ExplodeSplit;
}
*/
stock NameorIDtoID(name[])
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(strfind(GetUserName(i), name, true) != -1 || (IsPlayerConnected(i) && strval(name) == i && IsNumeric(name)))
    {
      return i;
    }
  }
  return -1;
}
native explode(string[],delim[],result[][],maxsplit=0,size1 = sizeof(result), size2 = sizeof(result[]));
native ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5,col6);
native GetFLName(playerid); //Get Firstname Lastname
native GetUserName(playerid); //Get Firstname_Lastname
//native SelectMySQL(ExplodeSplit[][]); // Use it between mysql_store_result() to mysql_free_result()
native NameorIDtoID(name[]); //you write the name and it will reterun
Reply
#4

add #include <a_samp>
#include <a_other> or your include name


anyway thanks i'm creating Admin FS but my server don't find his inc Thanks
Reply
#5

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Right at top
pawn Код:
#if defined _iggy_included
    #endinput
#endif
#define _iggy_included
//your funtions here.
Makes an include called "iggy" in script use #include <iggy>. delete all callbacks, oh and save it with the extenson .inc (don't compile just save)

Edit: Just thought id add this too, if you want your includes functions to show on the function list on the right hand side of PAWNO, do the following underneath your include text (above).
pawn Код:
/*
native playername(playerid);
native IsInArea(playerid, Float:min_x, Float:min_y, Float:max_x, Float:max_y);
native GetWeaponIDFromName(WeaponName[]);
native IsValidEmail(const email[]);
*/
Obviously swap them for your own fuctions. hope this helped.
@iggy, ****** explained me about that method and said it's useless, you don't need to put inside your include.
I'm talking about this;
pawn Код:
#if defined _iggy_included
    #endinput
#endif
#define _iggy_included
//your funtions here.
He said you don't need them and people use them because other people use them, you know... they do what everyone else does.
Reply
#6

Quote:
Originally Posted by shadow_ghost
Посмотреть сообщение
Hello,
[b]Please tell me how to make an include file, and I need a scripter and tester please help me
i am very thankful to you
I have fixed all your grammar problems for you.
Reply
#7

I still see some grammar mistakes, also if they are OFFTOPIC!

Quote:

Hello!
Please tell me how to make an include file, and I need a scripter and tester, please help me
I am very thankful to you!
Reply
#8

He didn't ask you for a grammar book...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)