GL_COMMON
#1

Sup i got error how to fix it?!
ERROR:
Код:
F:\Login and Register Sytem Y_INI\Login and Register Sytem Y_INI\gamemodes\Twst2.pwn(5) : fatal error 100: cannot read from file: "gl_common"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
The Code!:
Код:
#include <a_samp>
#include <YSI\y_ini>
#include <gl_common> // Line 5

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define SCRIPT_MODE "CTDM"
#define SCRIPT_WEB "www.CokeTDM.com"
#define SCRIPT_MAP "Los Santos"
#define SCRIPT_UPDATE "18/3/1998"

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define GoldColor "{00CED1}"
#define Random "{00CED1}" "{00CED12}" "{00CED5}"

enum pInfo
{
    Password,
    AdmLevel,
    Donator,
    Level,
    Money,
    Score,
    Kills,
    Deaths,
    Sucide,
    KDR,
	vTicket,
	vKey,
	vLock,
	vColor,
	vColor2,
	vPosX,
	VPosY,
	vPosZ
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][Password]);
    INI_Int("AdmLevel",PlayerInfo[playerid][AdmLevel]);
    INI_Int("Donator",PlayerInfo[playerid][Donator]);
    INI_Int("Level",PlayerInfo[playerid][Level]);
    INI_Int("Money",PlayerInfo[playerid][Money]);
    INI_Int("Score",PlayerInfo[playerid][Score]);
    INI_Int("Kills",PlayerInfo[playerid][Kills]);
    INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
    INI_Int("Sucide",PlayerInfo[playerid][Sucide]);
    INI_Int("KDR",PlayerInfo[playerid][KDR]);
    INI_Int("vTicket",PlayerInfo[playerid][vTicket]);
    INI_Int("vKey",PlayerInfo[playerid][vKey]);
    INI_Int("vLock",PlayerInfo[playerid][vLock]);
    INI_Int("vColor",PlayerInfo[playerid][vColor]);
    INI_Int("vColor2",PlayerInfo[playerid][vColor2]);
    INI_Int("vPosX",PlayerInfo[playerid][vPosX]);
//  INI_Int("vPosY",PlayerInfo[playerid][vPosY]);
    INI_Int("vPosZ",PlayerInfo[playerid][vPosZ]);
    return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}

public OnGameModeInit()
{
	total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
	return 1;
}

public OnGameModeExit()
{
	return 1;
}
Reply
#2

Add the include to <Your server file\pawno\include>
Reply
#3

Download the include: http://pastebin.com/DUMhqqq1
Reply
#4

It's located on the main_folder\include.
So, it should be
pawn Код:
#include "../include/gl_common.inc"
Reply
#5

No is show that error:
Код:
F:\Login and Register Sytem Y_INI\Login and Register Sytem Y_INI\gamemodes\Twst2.pwn(4) : fatal error 100: cannot read from file: "YSI\y_ini"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

Include YSI folder to the main_folder\pawno\includes\YSI
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=175565
Reply
#8

i have that include, why is do this!?!?!?!
Reply
#9

Do you run the correct pawno.exe and then opening the .pwn?
Because if you do open the .pwn, it might cause that.
Reply
#10

Still not work new error:
Код:
F:\Login and Register Sytem Y_INI\Login and Register Sytem Y_INI\gamemodes\Twst2.pwn(101) : error 017: undefined symbol "total_vehicles_from_files"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
gl_common text:
Код:
//----------------------------------------------------------
//
// GRAND LARCENY common functions include.
//
//----------------------------------------------------------
new used[MAX_VEHICLES];
#pragma tabsize 0
stock LoadStaticVehiclesFromFile(const filename[])
{
	new File:file_ptr;
	new line[256];
	new var_from_line[64];
	new vehicletype;
	new Float:SpawnX;
	new Float:SpawnY;
	new Float:SpawnZ;
	new Float:SpawnRot;
    new Color1, Color2;
	new index;
	new vehicles_loaded;
        new thisone;
	file_ptr = fopen(filename,filemode:io_read);
	if(!file_ptr) return 0;

	vehicles_loaded = 0;

	while(fread(file_ptr,line,256) > 0)
	{
	    index = 0;

	    // Read type
  		index = token_by_delim(line,var_from_line,',',index);
  		if(index == (-1)) continue;
  		vehicletype = strval(var_from_line);
   		if(vehicletype < 400 || vehicletype > 611) continue;

  		// Read X, Y, Z, Rotation
  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnX = floatstr(var_from_line);

  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnY = floatstr(var_from_line);

  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnZ = floatstr(var_from_line);

  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		SpawnRot = floatstr(var_from_line);

  		// Read Color1, Color2
  		index = token_by_delim(line,var_from_line,',',index+1);
  		if(index == (-1)) continue;
  		Color1 = strval(var_from_line);

  		index = token_by_delim(line,var_from_line,';',index+1);
  		Color2 = strval(var_from_line);

  		//printf("%d,%d,%f,%f,%f,%f,%d,%d",total_vehicles_from_files+vehicles_loaded+1,vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2);

		thisone = AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2,(30*60)); // respawn 30 minutes
		vehicles_loaded++;
                used[thisone]=1;
	}

	fclose(file_ptr);
	printf("Loaded %d vehicles from: %s",vehicles_loaded,filename);
	return vehicles_loaded;
}

//----------------------------------------------------------

stock strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

//------------------------------------------------

stock strrest(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}
	new offset = index;
	new result[128];
	while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}

//----------------------------------------------------------
// Tokenise by a delimiter
// Return string and index of the end determined by the
// provided delimiter in delim

stock token_by_delim(const string[], return_str[], delim, start_index)
{
	new x=0;
	while(string[start_index] != EOS && string[start_index] != delim) {
	    return_str[x] = string[start_index];
	    x++;
	    start_index++;
	}
	return_str[x] = EOS;
	if(string[start_index] == EOS) start_index = (-1);
	return start_index;
}

//----------------------------------------------------------

stock isNumeric(const string[])
{
  new length=strlen(string);
  if (length==0) return false;
  for (new i = 0; i < length; i++)
    {
      if (
            (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+') // Not a number,'+' or '-'
             || (string[i]=='-' && i!=0)                                             // A '-' but not at first.
             || (string[i]=='+' && i!=0)                                             // A '+' but not at first.
         ) return false;
    }
  if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
  return true;
}

//----------------------------------------------------------

stock IsKeyJustDown(key, newkeys, oldkeys)
{
	if((newkeys & key) && !(oldkeys & key)) return 1;
	return 0;
}

//----------------------------------------------------------
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)