[Ajuda] sscanf nгo й lido
#1

Me ajudem, olhem esse cуdigo e no final o erro, e me diz o que eu errei pfv...

Cуdigo:

Код:
#include <a_samp>

#include <zcmd<

#include <sscanf>

#include <dof2>

#define MAX_RADAR   100

#define PastaRadares        "Radares/Radar%d.ini"

static
	lString[256],
	radarid[MAX_PLAYERS],
	vel,
	Text3D:TRadar[MAX_RADAR],
	Variavel[MAX_PLAYERS],
	ObjetoRadar[2][MAX_RADAR],
	CriandoRadar,
	Float:PosX,
	Float:PosY,
	Float:PosZ,
	Float:Angulo;
enum radar {
	Float:lPosX,
	Float:lPosY,
	Float:lPosZ,
	Float:lAngulo,
	lVelocidade,
};
new InfoRadar[MAX_RADAR][radar];


public OnFilterScriptInit()
{
    CarregarRadares();
	return 1;
}

public OnFilterScriptExit()
{
	SalvarRadares();
    DOF2_Exit();
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 3030)
	{
		if(response)
		{
			static
				strradar[100];
			GetPlayerPos(playerid, PosX,PosY,PosZ);
			GetPlayerFacingAngle(playerid, Angulo);
			IdRadarLivre(playerid);
			InfoRadar[radarid[playerid]][lPosX] = PosX;
			InfoRadar[radarid[playerid]][lPosY] = PosY;
			InfoRadar[radarid[playerid]][lPosZ] = PosZ-1.5;
			InfoRadar[radarid[playerid]][lAngulo] = Angulo;
			InfoRadar[radarid[playerid]][lVelocidade] = vel;
		    ObjetoRadar[0][radarid[playerid]] = CreateObject(18880, InfoRadar[radarid[playerid]][lPosX], InfoRadar[radarid[playerid]][lPosY], InfoRadar[radarid[playerid]][lPosZ], 0.0, 0.0, InfoRadar[radarid[playerid]][lAngulo]);
		    ObjetoRadar[1][radarid[playerid]] = CreateObject(18880, InfoRadar[radarid[playerid]][lPosX], InfoRadar[radarid[playerid]][lPosY], InfoRadar[radarid[playerid]][lPosZ], 0.0, 0.0, InfoRadar[radarid[playerid]][lAngulo] + 180.0);
			format(strradar, sizeof(strradar),"{FF0000}Radar\nLimite de velocidade: %d KM/H",InfoRadar[radarid[playerid]][lVelocidade]);
			TRadar[radarid[playerid]] = Text3D:Create3DTextLabel(strradar, -1, InfoRadar[radarid[playerid]][lPosX], InfoRadar[radarid[playerid]][lPosY], InfoRadar[radarid[playerid]][lPosZ]+1, 50.0, 0);
			format(lString, sizeof(lString),"Radar ID: %d criado.",radarid[playerid]);
			SendClientMessage(playerid, 0x004C00FF, lString);
			SetPlayerPos(playerid, PosX+1,PosY+1,PosZ+1);
			CriandoRadar = 0;
			SalvarRadares();
		}
		else
		{
			CriandoRadar = 0;
		    SendClientMessage(playerid, 0xFFFFFFFF,"Vocк fechou o dialog de criar radar!");
		}
	}
	return 1;
}

public OnPlayerUpdate(playerid)
{
	CheckRadar(playerid);
	return 1;
}

CMD:v(playerid)
{
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid, x,y,z);
	CreateVehicle(522,x,y,z,0,-1,-1,-1);
	return 1;
}

CMD:comandos(playerid)
{
	SendClientMessage(playerid, -1,"/criarradar | /deletarradar - Comandos apenas para admin rcon!");
	SendClientMessage(playerid, -1, "Sistema de criar radar por Living(Living_22) qualquer erro entre em contato com o mesmo!");
	return true;
}

CMD:deletarradar(playerid, params[])
{
	new id, strpasta[200];
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xB40000FF,"Vocк nгo й um administrador!");
	if(sscanf(params, "d", id)) return SendClientMessage(playerid, -1, "Digite: /deletarradar [Id do radar]");
	format(strpasta, sizeof(strpasta), PastaRadares, id);
	if(DOF2_FileExists(strpasta))
	{
	    DOF2_RemoveFile(strpasta);
		format(lString, sizeof(lString), "Vocк deletou o radar de ID: %d.", id);
	    SendClientMessage(playerid, 0xFF0000FF,lString);
	    DestroyObject(ObjetoRadar[0][id]);
	    DestroyObject(ObjetoRadar[1][id]);
	    Delete3DTextLabel(TRadar[id]);
		InfoRadar[id][lPosX] = 0;
		InfoRadar[id][lPosY] = 0;
		InfoRadar[id][lPosZ] = 0;
		InfoRadar[id][lAngulo] = 0;
		InfoRadar[id][lVelocidade] = 999;
		return 1;
	}
	else
	{
        format(lString, sizeof(lString), "O radar de ID: %d nгo existe.", id);
		SendClientMessage(playerid, 0xFF0000FF, lString);
	}
	return 1;
}

CMD:criarradar(playerid, params[])
{
	new velocidade;
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xB40000FF,"Vocк nгo й um administrador!");
	if(CriandoRadar == 1) return SendClientMessage(playerid,0xB40000FF, "Jб tem alguйm criando um radar, aguarde por favor!");
	if(sscanf(params,"d",velocidade)) return SendClientMessage(playerid, 0x999C9BFF,"Digite: /criarradar [velocidade]");
	vel = velocidade;
	GetPlayerPos(playerid, PosX,PosY,PosZ);
	GetPlayerFacingAngle(playerid, Angulo);
	TogglePlayerControllable(playerid, true);
	SetPlayerPos(playerid, PosX,PosY,PosZ);
	format(lString, sizeof(lString),"{FFFFFF}Vocк deseja mesmo criar um radar neste local?\n\n");
	format(lString, sizeof(lString),"%s{00B4FF}Posiзгo X: {FFFFFF}%0.4f\n{00B4FF}Posiзгo Y: {FFFFFF} %0.4f\n{00B4FF}Posiзгo Z: {FFFFFF} %0.4f\n{00B4FF}Angulo: {FFFFFF}%0.4f\n{00B4FF}Velocidade: {FFFFFF}%d",lString,PosX,PosY,PosZ,Angulo,velocidade);
	CriandoRadar = 1;
	ShowPlayerDialog(playerid, 3030, DIALOG_STYLE_MSGBOX, "Criador de radar",lString, "Criar","Cancelar");
	return 1;
}

forward CarregarRadares();
public CarregarRadares()
{
	new
		strradar[100],
		strpasta[200];

	for(new rad=0;rad<MAX_RADAR; rad++)
	{
		format(strpasta,sizeof(strpasta),PastaRadares,rad);
	    if(DOF2_FileExists(strpasta))
	    {
			InfoRadar[rad][lVelocidade] = DOF2_GetInt(strpasta,"Velocidade");
			InfoRadar[rad][lPosX] = DOF2_GetFloat(strpasta,"PosX");
			InfoRadar[rad][lPosY] = DOF2_GetFloat(strpasta,"PosY");
			InfoRadar[rad][lPosZ] = DOF2_GetFloat(strpasta,"PosZ");
			InfoRadar[rad][lAngulo] = DOF2_GetFloat(strpasta,"Angulo");
		    ObjetoRadar[0][rad] = CreateObject(18880, InfoRadar[rad][lPosX], InfoRadar[rad][lPosY], InfoRadar[rad][lPosZ], 0.0, 0.0, InfoRadar[rad][lAngulo]);
		    ObjetoRadar[1][rad] = CreateObject(18880, InfoRadar[rad][lPosX], InfoRadar[rad][lPosY], InfoRadar[rad][lPosZ], 0.0, 0.0, InfoRadar[rad][lAngulo] + 180.0);
			format(strradar, sizeof(strradar),"{FF0000}Radar\nLimite de velocidade: %d KM/H",InfoRadar[rad][lVelocidade]);
			TRadar[rad] = Text3D:Create3DTextLabel(strradar, -1, InfoRadar[rad][lPosX], InfoRadar[rad][lPosY], InfoRadar[rad][lPosZ]+1, 50.0, 0);
		}
	}
	return 1;
}

forward SalvarRadares();
public SalvarRadares()
{
	new
		strpasta[200];

	for(new rad=0;rad<MAX_RADAR; rad++)
	{
		format(strpasta,sizeof(strpasta),PastaRadares,rad);
	    if(DOF2_FileExists(strpasta))
	    {
			DOF2_SetInt(strpasta,"Velocidade",InfoRadar[rad][lVelocidade]);
			DOF2_SetFloat(strpasta,"PosX",InfoRadar[rad][lPosX]);
			DOF2_SetFloat(strpasta,"PosY",InfoRadar[rad][lPosY]);
			DOF2_SetFloat(strpasta,"PosZ",InfoRadar[rad][lPosZ]);
			DOF2_SetFloat(strpasta,"Angulo",InfoRadar[rad][lAngulo]);
		}
	}
	return 1;
}

forward CheckRadar(playerid);
public CheckRadar(playerid)
{
	new
		Float:PlayerSpeedDistance,
		VelocidadeDoPlayer[MAX_PLAYERS];

	GetVehicleVelocity(GetPlayerVehicleID(playerid), PosX, PosY, PosZ);
	PlayerSpeedDistance = floatmul(floatsqroot(floatadd(floatadd(floatpower(PosX, 2), floatpower(PosY, 2)),  floatpower(PosZ, 2))), 170.0);
	new spe = floatround(PlayerSpeedDistance * 1);
	VelocidadeDoPlayer[playerid] = spe;
	for(new rad = 0; rad < MAX_RADAR; rad++)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 8.0, InfoRadar[rad][lPosX],InfoRadar[rad][lPosY],InfoRadar[rad][lPosZ]))
		{
			if(VelocidadeDoPlayer[playerid] > InfoRadar[rad][lVelocidade])
			{
				if(gettime() > Variavel[playerid])
				{
     				Variavel[playerid] = (gettime() + 1);
     				format(lString, sizeof(lString),"(Radar) Vocк ultrapassou o limite de velocidade, o limite й {FFFFFF}%d KM/H{FD0600} e vocк passou a {FFFFFF}%d KM/H!",InfoRadar[rad][lVelocidade],VelocidadeDoPlayer[playerid]);
					SendClientMessage(playerid, 0xFD0600FF,lString);
					SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+1);
				}
			}
		}
	}
	return 1;
}

stock IdRadarLivre(playerid)
{
	static
	    rstring[74];
	for(new i; i< MAX_RADAR; i++)
	{
	    format(rstring, sizeof rstring, PastaRadares, i);
	    if(!DOF2_FileExists(rstring))
	    {
			radarid[playerid] = i;
			DOF2_CreateFile(rstring);
			return 1;
		}
	}
	return 0;
}
Erro:

Код:
fatal error 100: cannot read from file: "sscanf"

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


1 Error.
Reply
#2

Tenta

pawn Код:
#include <sscanf2>
Se nгo der, tб faltando o a include sscanf2 na pasta do pawno/includes
Reply
#3

Код:
C:\Documents and Settings\TURBO\Desktop\RADARES.pwn(3) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(278) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(471) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(485) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(497) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(520) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(536) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(551) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(679) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(697) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(707) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(998) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1005) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1037) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1054) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1056) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1063) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1096) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1161) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1173) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1197) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1217) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1220) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1227) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1235) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1564) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1569) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1579) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1582) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1607) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1615) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1618) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1629) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1632) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1639) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1642) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1645) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1648) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1651) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1659) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1814) : warning 217: loose indentation
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1878) : error 010: invalid function or declaration
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1881) : error 010: invalid function or declaration
C:\Documents and Settings\TURBO\Desktop\Tudo para meu servidor SAMP\Brasil NewLife[BNL]\pawno\include\dof2.inc(1883) : error 010: invalid function or declaration
C:\Documents and Settings\TURBO\Desktop\RADARES.pwn(244) : warning 203: symbol is never used: "comandos"
C:\Documents and Settings\TURBO\Desktop\RADARES.pwn(244) : warning 203: symbol is never used: "criarradar"
C:\Documents and Settings\TURBO\Desktop\RADARES.pwn(244) : warning 203: symbol is never used: "deletarradar"
C:\Documents and Settings\TURBO\Desktop\RADARES.pwn(244) : warning 203: symbol is never used: "v"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Deu esses erros e tenho o include sscanf2
Mas acabei de ver que nгo tenho o DOF2 da pra passar o link onde baixo?
Reply
#4

http://pastebin.com/TQJGwYyZ
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)