Compile Error?
#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


Messages In This Thread
Compile Error? - by ReFuSeR - 04.10.2008, 07:10
Re: Compile Error? - by ReFuSeR - 04.10.2008, 07:46
Re: Compile Error? - by ReFuSeR - 04.10.2008, 15:17
Re: Compile Error? - by pspleo - 04.10.2008, 15:19
Re: Compile Error? - by ReFuSeR - 04.10.2008, 15:25
Re: Compile Error? - by ReFuSeR - 04.10.2008, 19:30
Re: Compile Error? - by Extremo - 04.10.2008, 22:27
Re: Compile Error? - by ReFuSeR - 04.10.2008, 22:31
Re: Compile Error? - by Naruto4 - 30.12.2009, 16:22

Forum Jump:


Users browsing this thread: 2 Guest(s)