Compile Error?
#1

I keep getting this error when I compile.


Код:
C:\Users\RED RANGER.Saucey-PC\Desktop\samp022server.win322\pawno\include\IsPlayerLAdmin.inc(11) : fatal error 100: cannot read from file: "lethaldudb2"

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


1 Error.

I think LethaL was talking about some kind of solution:
Quote:
by LethaL:
btw Pawno is the app (complier). The one thing i hate is that it sometimes is unable to read from includes and you have to file=>open=>comile=>open again bla bla.. to get it working again

As for the programming language "Pawn", i have to say that i hate nothing, apart from the name obviously :P


I was never getting this problem before, this is really shit!

I am so confused!

Someone PLEASE help!
[Image: LuckyOliver-3362817-blog-3d_silver_exclamation_mark.jpg]
[Image: head_scratch.png]
Reply
#2

Quote:
Originally Posted by Andre9977
Do what LethaL said - save the .pwn, quit pawno, re-open pawno, "file - open" the .pwn and compile.
I tried that, I still get the error
Reply
#3

Now it is morning!

Will anyone answer?
Reply
#4

IsPlayerLAdmin.inc(11) : fatal error 100: cannot read from file: "lethaldudb2"
You sure you have lethaldudb2?
Reply
#5

LOL, I may be a noob but ofc I have it in there, lol


[img width=1024 height=768]http://i33.tinypic.com/vgofoo.jpg[/img]

Content?

Код:
/*
 *      DUDB functions
 *    © Copyright 2006-2007 by DracoBlue
 *
 * @version  : 2.4
 * @author  : DracoBlue (http://dracoblue.net)
 * @date   : 8th May 2006
 * @update  : 12th July 2007
 * @require  : DUtils 1.10
 * @require  : DINI 1.5
 *
 * This Unit is provided as is (no warranties).
 * Feel free to use it, a little message in 
 * about box is honouring thing, isn't it?
 *
 */

#if defined _dudb_included
 #endinput
#endif

#define _dudb_included
#pragma library dutils

#include <dutils>
#include <dini>
#define dUser(%1).( udb_User(%1,
#define dUserINT(%1).( udb_UserInt(%1,
#define dUserSet(%1).( udb_UserSet(%1,
#define dUserSetINT(%1).( udb_UserSetInt(%1,
#define dUserSetFLOAT(%1).( udb_UserSetFloat(%1,
#define dUserFLOAT(%1).( udb_UserFloat(%1,

stock udb_hash(buf[]) {
	new length=strlen(buf);
  new s1 = 1;
  new s2 = 0;
  new n;
  for (n=0; n<length; n++)
  {
    s1 = (s1 + buf[n]) % 65521;
    s2 = (s2 + s1)   % 65521;
  }
  return (s2 << 16) + s1;
}

stock udb_encode(nickname[]) {
 new tmp[MAX_STRING];
 set(tmp,nickname);
 tmp=strreplace("_","_00",tmp);
 tmp=strreplace(";","_01",tmp);
 tmp=strreplace("!","_02",tmp);
 tmp=strreplace("/","_03",tmp);
 tmp=strreplace("\\","_04",tmp);
 tmp=strreplace("[","_05",tmp);
 tmp=strreplace("]","_06",tmp);
 tmp=strreplace("?","_07",tmp);
 tmp=strreplace(".","_08",tmp);
 tmp=strreplace("*","_09",tmp);
 tmp=strreplace("<","_10",tmp);
 tmp=strreplace(">","_11",tmp);
 tmp=strreplace("{","_12",tmp);
 tmp=strreplace("}","_13",tmp);
 tmp=strreplace(" ","_14",tmp);
 tmp=strreplace("\"","_15",tmp);
 tmp=strreplace(":","_16",tmp);
 tmp=strreplace("|","_17",tmp);
 tmp=strreplace("=","_18",tmp);
 return tmp;
}

stock udb_decode(nickname[]) {
 new tmp[MAX_STRING];
 set(tmp,nickname);
 tmp=strreplace("_01",";",tmp);
 tmp=strreplace("_02","!",tmp);
 tmp=strreplace("_03","/",tmp);
 tmp=strreplace("_04","\\",tmp);
 tmp=strreplace("_05","[",tmp);
 tmp=strreplace("_06","]",tmp);
 tmp=strreplace("_07","?",tmp);
 tmp=strreplace("_08",".",tmp);
 tmp=strreplace("_09","*",tmp);
 tmp=strreplace("_10","<",tmp);
 tmp=strreplace("_11",">",tmp);
 tmp=strreplace("_12","{",tmp);
 tmp=strreplace("_13","}",tmp);
 tmp=strreplace("_14"," ",tmp);
 tmp=strreplace("_15","\"",tmp);
 tmp=strreplace("_16",":",tmp);
 tmp=strreplace("_17","|",tmp);
 tmp=strreplace("_18","=",tmp);
 tmp=strreplace("_00","_",tmp);
 return tmp;
}


stock udb_Exists(nickname[]) {
 new tmp[MAX_STRING];
 format(tmp,sizeof(tmp),"ladmin/users/%s.sav",udb_encode(nickname));
 return fexist(tmp);
}


stock udb_Remove(nickname[]) {
 new tmp[MAX_STRING];
 format(tmp,sizeof(tmp),"ladmin/users/%s.sav",udb_encode(nickname));
 return dini_Remove(tmp);
}

stock udb_UserSetInt(nickname[],key[],value) {
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 return dini_IntSet(fname,key,value);
}

stock udb_UserSetFloat(nickname[],key[],Float:value) {
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 return dini_FloatSet(fname,key,value);
}

stock udb_UserSet(nickname[],key[],value[]) {
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 return dini_Set(fname,key,value);
}

stock udb_User(nickname[],key[]) {
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 format(fname,sizeof(fname),dini_Get(fname,key));
 return fname;
}

stock Float:udb_UserFloat(nickname[],key[]) {
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 return dini_Float(fname,key);
}

stock udb_UserInt(nickname[],key[]) {
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 return dini_Int(fname,key);
}

stock udb_CheckLogin(nickname[],pwd[]) {
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 if (udb_UserInt(nickname,"password_hash")==udb_hash(pwd)) return true;
 return false;
}


stock udb_Create(nickname[],pwd[]) {
 if (udb_Exists(nickname)) return false;
 new fname[MAX_STRING];
 format(fname,sizeof(fname),"ladmin/users/%s.sav",udb_encode(nickname));
 dini_Create(fname);
 udb_UserSetInt(nickname,"password_hash",udb_hash(pwd));
 return true;
}

stock udb_RenameUser(nickname[],newnick[]) {
 new oldfname[MAX_STRING];
 new newfname[MAX_STRING];
 format(oldfname,sizeof(oldfname),"ladmin/users/%s.sav",udb_encode(nickname));
 format(newfname,sizeof(newfname),"ladmin/users/%s.sav",udb_encode(newnick));
 return frenametextfile(oldfname,newfname);
}
Sexy, eh?

I got to go....

I will be responding when I get back.
Reply
#6

I am back, please continue.
Reply
#7

Can you please post the content of LAdmin, specialy line 9 up to 15. Thanks.
Reply
#8

Quote:
Originally Posted by |>Extremo<|
Can you please post the content of LAdmin, specialy line 9 up to 15. Thanks.
L-ADMIN INCLUDE
Код:
// LethaL's Adminscript

#if defined _IsPlayerLAdmin_included
#endinput
#endif
#define _IsPlayerLAdmin_included
#pragma library IsPlayerLAdmin

#include <a_samp>
#include <lethaldudb2>


stock IsPlayerLAdmin(playerid)
{

new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name));
new file[256], tmp, tmp2; 

format(file,256,"/ladmin/users/%s.sav",udb_encode(name));
tmp = dini_Int(file,"level");
tmp2 = dini_Int(file,"loggedin");

if( (IsPlayerConnected(playerid)) && (tmp > 0) && (tmp2 == 1) )
	return true;
else return false;

}


stock IsPlayerAdminLevel(playerid, level)
{

new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name));
new file[256], tmp, tmp2; 

format(file,256,"/ladmin/users/%s.sav",udb_encode(name));
tmp = dini_Int(file,"level");
tmp2 = dini_Int(file,"loggedin");
printf("tmp = %d, tmp2(logged) = %d, level = %d", tmp, tmp2, level );
if( (IsPlayerConnected(playerid)) && (tmp >= level) && (tmp2 != 0) )
	return true;
else return false;

}
AddGate INCLUDE
Код:
#include <a_samp>
#define MAX_GATES	20
new GateCount = 0, GateTimer = -1,SomeoneNearGate[MAX_GATES];
enum gatesinfo
{
	Created,
	Model,
	Float:closeX,
	Float:closeY,
	Float:closeZ,
	Float:rotX,
	Float:rotY,
	Float:rotZ,
	Float:openX,
	Float:openY,
	Float:openZ,
	NameCanEnter[24],
	Distance,
	GateObject
}
new Gate[MAX_GATES][gatesinfo];
forward CheckGates();


/*
native AddAutoGate(modelid,Float:cX,Float:cY,Float:cZ,Float:rX,Float:rY,Float:rZ,Float:oX,Float:oY,Float:oZ,namecanenter[24],open_distance)
*/

stock AddAutoGate(modelid,Float:cX,Float:cY,Float:cZ,Float:rX,Float:rY,Float:rZ,Float:oX,Float:oY,Float:oZ,namecanenter[24],open_distance)
{
	GateCount++;
	new ID = GateCount;
	Gate[ID][Created] = 1;
	Gate[ID][Model] = modelid;
	Gate[ID][closeX] = cX;
	Gate[ID][closeY] = cY;
	Gate[ID][closeZ] = cZ;
	Gate[ID][rotX] = rX;
	Gate[ID][rotY] = rY;
	Gate[ID][rotZ] = rZ;
	Gate[ID][openX] = oX;
	Gate[ID][openY] = oY;
	Gate[ID][openZ] = oZ;
	format(Gate[ID][NameCanEnter],24,"%s",namecanenter);
	Gate[ID][Distance] = open_distance;
	Gate[ID][GateObject] = CreateObject(modelid,cX,cY,cZ,rX,rY,rZ);
	if(GateTimer == -1)
	{
		GateTimer = SetTimer("CheckGates",100,1);
	}
	return 1;
}

public CheckGates()
{
	for(new ID = 0; ID < MAX_GATES; ID++)
	{
		if(Gate[ID][Created] == 1)
		{
			for(new i = 0; i < GetMaxPlayers(); i++)
			{
				if(IsPlayerConnected(i))
				{
					if(IsPlayerNearGateAndCanHeEnter(i,ID))
					{
						SomeoneNearGate[ID] = 1;
					}else
					{
						if(SomeoneNearGate[ID] == 0)
						{
							MoveObject(Gate[ID][GateObject],Gate[ID][closeX],Gate[ID][closeY],Gate[ID][closeZ],5);
						}
					}
				}
			}
			if(SomeoneNearGate[ID] == 1)
			{
				MoveObject(Gate[ID][GateObject],Gate[ID][openX],Gate[ID][openY],Gate[ID][openZ],5);
			}
			SomeoneNearGate[ID] = 0;
		}
	}
	return 1;
}

stock IsPlayerNearGateAndCanHeEnter(playerid, gateid)
{
	new nameofthisplayer[24]; GetPlayerName(playerid,nameofthisplayer,24);
	if(PlayerToPoint(Gate[gateid][Distance],playerid,Gate[gateid][closeX],Gate[gateid][closeY],Gate[gateid][closeZ]) && !strfind(nameofthisplayer,Gate[gateid][NameCanEnter],true))
	{
		return 1;
	}
	return 0;
}

stock PlayerToPoint(Float:radi,playerid,Float:x,Float:y,Float:z)
{
	new Float:oldposx, Float:oldposy, Float:oldposz;
	new Float:tempposx, Float:tempposy, Float:tempposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	tempposx = (oldposx -x);
	tempposy = (oldposy -y);
	tempposz = (oldposz -z);
	if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
	{
		return 1;
	}
	return 0;
}
Reply
#9

just run the pawno program from your server folder and open your script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)