[FilterScript] Evento System [Ultima Atualizaзгo]
#1

Evento System v1.3b


Desenvolvido by: Airton.Vitor


Para ver os comandos basta digitar /comandos - Mostra os seguintes comandos:
/einiciar - Inicia o Teleporte do evento podendo digitar /evento,
/edestrancar - Destrancara o evento caso esteja trancado,
/etrancar - Trancara o evento caso esteja iniciado,
/ekick - Kicka o id selecionado caso esteja no evento,
/evw - Comando desabilitado,
/ecarro - Enviara o id do carro selecionado aos jogadores que estiverem no evento,
/evida - Setara a vida aos jogadores que estiverem no evento. -Nota Importante- Nгo digite /evida 0 pois matara os jogadores ,
/earma - Setara o id de arma selecionado aos jogadores do evento,
/ecolete - Setara a quantidade de colete selecionado aos jogadores do evento,
/econtar - Iniciara uma contagem de 5 segundos.-Nota Importante- A todos os jogadores,
/econgelar - Congelara todos jogadores do evento,
/edescongelar - Descongelara os jogadores do evento,
/eskin - Setara o id da skin selecionado aos jogadores do evento,
/etermina - Destruira o teleporte e todos jogadores do evento voltaram a posiзгo de quando entraram.


Pastbind
Solidfiles
evento.pwn
Reply
#2

bem legal airton
Reply
#3

Sу coloco mais opзхes, o bug continua e ninguйm usa *-*
Reply
#4

Muito bom , esse FS
Reply
#5

Nao consigo tirar esse erro :/ ajuda

Код:
error: 001: expected token: ";", but found "for"
Linha do erro
Код:
       	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(IsPlayerConnected(possiveis))
Me ajudaa
Reply
#6

pawn Код:
for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(IsPlayerConnected(possiveis));
Tenta ai!
Reply
#7

Quote:
Originally Posted by Katros
Посмотреть сообщение
pawn Код:
for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(IsPlayerConnected(possiveis));
Tenta ai!
Nao й isso ja tentei da mais erros
Reply
#8

Conseguiii vou mandar o codigo pronto!


Код:
#include <a_samp>

#define COR_VERMELHA 0xF66767AA
#define COR_BRANCO   0xFFFFFFAA
#define COR_AZUL     0x447FECAA
enum DataSystem
{
	Float:HP,
	Float:Colete,
	Float:PosX,
	Float:PosY,
	Float:PosZ,
	vw,
	grana,
	interior,
	ang,
	Skin,
};
new AirtonData[MAX_PLAYERS][DataSystem];
enum EventoSystem
{
	bool:Eventoiniciado,//bool irб indicar sim ou nгo (false or true) melhor doque 0 ou 1
	bool:Eventotrancado,
	bool:Eventodestrancado,
	bool:Entrar,
	bool:Eventocontagem,
	vw,
	interior,
};
new Airton[MAX_PLAYERS][EventoSystem];
new Float:ex,Float:ey,Float:ez;
new Float:entroux,Float:entrouy,Float:entrouz;
new entraram;
new CountDown = -1;
new Veiculos[MAX_VEHICLES];
new tmp[128];
new VeiculosCriados = 0;
forward countdown();

public OnFilterScriptInit()
{
	print("--**Evento System Iniciado com sucesso**--");
	print("--**Desenvolvido para o SA-MP 0.3b RC2**--");
	print("--**Progamado por Airton.Vitor**--");
	SendClientMessageToAll(COR_VERMELHA,"Evento System Iniciado com sucesso by  Airton");
	return 1;
}

public OnFilterScriptExit()
{
	print("--**Evento System Finalizado com sucesso**--");
	SendClientMessageToAll(COR_AZUL,"Evento System Finalizado com sucesso by  Airton");
	return 1;
}

main(){}

public OnPlayerConnect(playerid)
{
    Airton[playerid][Eventoiniciado] = false;
    Airton[playerid][Eventodestrancado] = false;
    Airton[playerid][Eventotrancado] = false;
    Airton[playerid][Entrar] = false;
	return 1;
}

public OnPlayerSpawn(playerid)
{
	if(IsPlayerAdmin(playerid))
	{
	   	SendClientMessage(playerid, COR_AZUL, "[EVENTOS]: Uso> /comandos para ver os comandos disponiveis");
	}
	return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
    Airton[playerid][Entrar] = false;
    SetPlayerVirtualWorld(playerid, 0);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128]; new streventu[128]; new idcmd;
    new admnick[20];
    cmd = strtok(cmdtext, idcmd);
    if(strcmp(cmd, "/eventocomandos", true) == 0&&IsPlayerAdmin(playerid))
	{
	   	SendClientMessage(playerid, COR_AZUL, "[EVENTOS]: /eventocriar,/eventotrancar,/eventodestrancar,/eventoterminar,/eventokick,/evw,/skin,/eventodesarmar");
       	SendClientMessage(playerid, COR_AZUL, "[EVENTOS]: /eventosair,/eventocarro,/eventovida,/eventoarma,/eventocolete,/eventocontar,/eventocongelar,/eventodescongelar,/eventoterminar");
    	return 1;
	}
    if(strcmp(cmd, "/eventocriar", true) == 0&&Airton[playerid][Eventoiniciado] == false &&IsPlayerAdmin(playerid))
	{
    	SalvarPlayer(playerid);
		GetPlayerPos(playerid, ex, ey, ez);
		Airton[playerid][interior] = GetPlayerInterior(playerid);
		//Airton[playerid][vw] = GetPlayerVirtualWorld(playerid);
       	SendClientMessageToAll(COR_AZUL, "-INFO- Um evento acaba de ser iniciado! Digite /evento para se teleportar atй o evento");
       	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(IsPlayerConnected(possiveis))
       	{
         	GameTextForPlayer(possiveis,"~y~novo evento aberto ~n~digite ~b~/evento", 2200, 1);
         	Airton[possiveis][Eventoiniciado] = true;
         	Airton[possiveis][Eventotrancado] = false;
         	Airton[possiveis][Eventodestrancado] = false;
         	Airton[playerid][Entrar] = false;
       	}
    	return 1;
	}
    if(strcmp(cmd, "/eventotrancar", true) == 0&&Airton[playerid][Eventoiniciado] == true&&Airton[playerid][Eventotrancado] == false &&IsPlayerAdmin(playerid))
	{
    	format(streventu, 128, "-INFO- O evento foi trancado - %d jogadores(ras) entrarao", entraram);
       	SendClientMessageToAll(COR_AZUL, streventu);
       	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(IsPlayerConnected(possiveis))
       	{
         	GameTextForPlayer(possiveis,"~y~evento ~r~fechado", 2500, 1);
         	Airton[possiveis][Eventotrancado] = true;
         	Airton[possiveis][Eventodestrancado] = true;
       	}
    	return 1;
	}
    if(strcmp(cmd, "/eventodestrancar", true) == 0&&Airton[playerid][Eventoiniciado] == true &&Airton[playerid][Eventodestrancado] == true&&IsPlayerAdmin(playerid))
	{
       	SendClientMessageToAll(COR_AZUL, "-INFO- O evento foi destrancado! Digite /evento");
       	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(IsPlayerConnected(possiveis))
       	{
         	GameTextForPlayer(possiveis,"~b~evento ~g~aberto", 2500, 1);
         	Airton[possiveis][Eventotrancado] = false;
         	Airton[possiveis][Eventodestrancado] = false;
       	}
    	return 1;
	}
    if(strcmp(cmd, "/eventoterminar", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
    	GetPlayerName(playerid,admnick, 24);
       	format(streventu, 128, "-INFO- O Administrador RCON %s evento foi finalizado!", admnick);
       	SendClientMessageToAll(COR_AZUL, streventu, 47);
        for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(IsPlayerConnected(possiveis))
       	{
         	GameTextForPlayer(possiveis, "~w~evento ~r~terminado", 2500, 1);
         	Airton[possiveis][Eventotrancado] = false;
         	Airton[possiveis][Eventoiniciado] = false;
         	Airton[possiveis][Eventodestrancado] = false;
       	}
       	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
       	{
         	Airton[possiveis][Entrar] = false;
         	SetPlayerInterior(playerid, 0);
         	SetPlayerPos(playerid, entroux, entrouy, entrouz);
         	SetPlayerVirtualWorld(playerid, 0);
       		//SetPlayerVirtualWorld(playerid, Airton[playerid][vw]);
    		SetPlayerInterior(playerid, Airton[playerid][interior]);
       	}
       	for(new carros = 0; carros < MAX_VEHICLES; carros++)
		{
		    if(Veiculos[carros])
			{
			    DestroyVehicle(Veiculos[carros]);
				Veiculos[carros] = 0;
				VeiculosCriados = 0;
			}
		}
       	entraram = 0;
    	return 1;
	}
    if(strcmp(cmd, "/evento", true) == 0&&Airton[playerid][Entrar] == false&&Airton[playerid][Eventoiniciado] == true &&Airton[playerid][Eventotrancado] == false&&IsPlayerAdmin(playerid))
	{
    	SalvarPlayer(playerid);
      	Airton[playerid][Entrar] = true;
      	entraram++;
      	GetPlayerPos(playerid, entroux, entrouy, entrouz);
		SetPlayerPos(playerid, ex, ey, ez);
		SetPlayerVirtualWorld(playerid, 5);
		//SetPlayerVirtualWorld(playerid, Airton[playerid][vw]);
		SetPlayerInterior(playerid, Airton[playerid][interior]);
    	return 1;
	}
    if(strcmp(cmd, "/eventosair", true) == 0&&Airton[playerid][Entrar] == true&&Airton[playerid][Eventoiniciado] == true &&Airton[playerid][Eventotrancado] == false&&IsPlayerAdmin(playerid))
  	{
    	SetPlayerVirtualWorld(playerid, 0);
      	Airton[playerid][Entrar] = false;
      	entraram -- ;
		SetPlayerPos(playerid, entroux, entrouy, entrouz);
    	return 1;
	}
    if(strcmp(cmd, "/eventodesarmar", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
	    {
         	ResetPlayerWeapons(possiveis);
        	SetPlayerArmedWeapon(possiveis,0);
   		}
    	GetPlayerName(playerid,admnick, 24);
      	format(streventu, 128, "-INFO- O Administrador RCON %s desarmou todos jogadores do evento!", admnick);
       	SendClientMessageToAll(COR_AZUL, streventu);
   		return 1;
	}
    if(strcmp(cmd, "/eventokick", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
    	tmp = strtok(cmdtext, idcmd);
		if(!strlen(tmp))
		{
	    	SendClientMessage(playerid, COR_AZUL, "Digite: /eventokick [id]");
    		return 1;
		}
		new id;
		id = strval(tmp);
    	if(Airton[id][Entrar] == true)
	    {
         	ResetPlayerWeapons(id);
         	SetPlayerInterior(id, 0);
         	SetPlayerVirtualWorld(id, 0);
        	SetPlayerPos(id, entroux, entrouy, entrouz);
        	Airton[id][Entrar] = false;
        	new jogadornick[24];
        	GetPlayerName(playerid,admnick, 24);
        	GetPlayerName(id,jogadornick, 24);
         	format(streventu, 128, "-INFO- O Administrador RCON %s kickou jogador %s do evento!", admnick,jogadornick);
         	SendClientMessageToAll(COR_AZUL, streventu);
         	entraram --;
         	UsarPlayer(id);
   		}
   		else if(Airton[id][Entrar] == true)
   		{
   	    	SendClientMessage(playerid, COR_AZUL, "O jogador selecionado nгo encontra-se no evento!");
   		}
   		return 1;
    }
    if(strcmp(cmd, "/eventoskin", true) == 0&&IsPlayerAdmin(playerid))
	{
  		new skinide;
	   	tmp = strtok(cmdtext, idcmd);
	   	skinide = strval(tmp);
	   	if(!strlen(tmp))
	   	{
	     	SendClientMessage(playerid, COR_BRANCO, "Digite o id da skin que desejas setar!");
	    	return 1;
	   	}
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
	    {
			SetPlayerSkin(possiveis, skinide);
   		}
   		return 1;
	}
    /*if(strcmp(cmd, "/evw", true) == 0&&IsPlayerAdmin(playerid))
	{
  		new virtualtele;
	   	tmp = strtok(cmdtext, idcmd);
	   	virtualtele = strval(tmp);
	   	if(!strlen(tmp))
	   	{
	     	SendClientMessage(playerid, COR_BRANCO, "Digite o id do virtualworld que queres ir para iniciar o evento em outro mundo!");
	    	return 1;
	   	}
	   	SetPlayerVirtualWorld(playerid, virtualtele);
   		return 1;
	}*/
    if(strcmp(cmd, "/eventoarma", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
  		new gun;
	   	new ammo;
	   	tmp = strtok(cmdtext, idcmd);
	   	gun = strval(tmp);
	   	if(!strlen(tmp))
	   	{
	     	SendClientMessage(playerid, COR_BRANCO, "Digite o id da arma e a muniзгo!");
	    	return 1;
	   	}
	   	tmp = strtok(cmdtext, idcmd);
	   	ammo = strval(tmp);
	   	/*if(ammo < 1||ammo > 9999)
	   	{
	   		return 1;
		}*/
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
	    {
			GivePlayerWeapon(possiveis, gun, ammo);
   		}
    	GetPlayerName(playerid,admnick, 24);
       	format(streventu, 128, "-INFO- O Administrador RCON %s deu arma %d muniзгo %d aos jogadores do evento!", admnick,gun,ammo);
       	SendClientMessageToAll(COR_AZUL, streventu);
   		return 1;
	}
    if(strcmp(cmd, "/eventocarro", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
    	tmp = strtok(cmdtext, idcmd);
  		new carro;
	   	carro = strval(tmp);
	   	if(!strlen(tmp))
	   	{
	     	SendClientMessage(playerid, COR_BRANCO, "Digite o id do carro!");
	    	return 1;
	   	}
	   	if(carro < 400 || carro > 611)
	   	{
    	   	SendClientMessage(playerid, COR_VERMELHA, "   O ID do veiculo digitado estб invalido! veiculos de 400 б 611");
	   		return 1;
		}
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[possiveis][Entrar] == true)
	    {
			new Float:X = 0,Float:Y = 0,Float:Z = 0,Float:Angulo = 0;
		   	GetPlayerPos(possiveis, X,Y,Z);
		   	GetPlayerFacingAngle(playerid, Angulo);
		   	Veiculos[VeiculosCriados++] = CreateVehicle(carro, X, Y, Z, 0, random(126), random(126), 60000);
		   	LinkVehicleToInterior(Veiculos[VeiculosCriados-1], GetPlayerInterior(possiveis));
			SetVehicleVirtualWorld(Veiculos[VeiculosCriados-1], GetPlayerVirtualWorld(possiveis));
	    	PutPlayerInVehicle(possiveis, Veiculos[VeiculosCriados-1], 0);
   		}
   	   	GetPlayerName(playerid,admnick, 24);
       	format(streventu, 128, "-INFO- O Administrador RCON %s deu veiculo %d aos jogadores do evento!", admnick,carro);
       	SendClientMessageToAll(COR_AZUL, streventu);
   		return 1;
	}
    if(strcmp(cmd, "/eventocontar", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
        if(CountDown == -1)
		{
			CountDown = 6;
			SetTimer("countdown",1000,0);
  	        GetPlayerName(playerid,admnick, 24);
         	format(streventu, 128, "-INFO- O Administrador RCON %s iniciou a contagem do evento!", admnick);
        	SendClientMessageToAll(COR_AZUL, streventu);
		}
   		return 1;
	}
    if(strcmp(cmd, "/eventocongelar", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
	    {
         	TogglePlayerControllable(possiveis, false);
   		}
    	GetPlayerName(playerid,admnick, 24);
       	format(streventu, 128, "-INFO- O Administrador RCON %s congelou os jogadores do evento!", admnick);
       	SendClientMessageToAll(COR_AZUL, streventu);
   		return 1;
	}
    if(strcmp(cmd, "/eventodescongelar", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
	    {
         	TogglePlayerControllable(possiveis, true);
   		}
    	GetPlayerName(playerid,admnick, 24);
       	format(streventu, 128, "-INFO- O Administrador RCON %s descongelou os jogadores do evento!", admnick);
       	SendClientMessageToAll(COR_AZUL, streventu);
   		return 1;
	}
    if(strcmp(cmd, "/eventovida", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
	{
    	tmp = strtok(cmdtext, idcmd);
    	new vida = strval(tmp);
     	if(!strlen(tmp))
		{
    		SendClientMessage(playerid, COR_BRANCO, "Digite a quantidade do HP!");
			return 1;
		}
     	/*if(vida < 1 || vida > 9999)
        {
			return 1;
		}*/
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
	    {
         	SetPlayerHealth(possiveis,vida);
   		}
    	GetPlayerName(playerid,admnick, 24);
       	format(streventu, 128, "-INFO- O Administrador RCON %s setou HP %d para os jogadores do evento", admnick,vida);
       	SendClientMessageToAll(COR_AZUL, streventu);
   		return 1;
	}
    if(strcmp(cmd, "/eventocolete", true) == 0&&Airton[playerid][Eventoiniciado] == true &&IsPlayerAdmin(playerid))
    {
    	tmp = strtok(cmdtext, idcmd);
    	new colete = strval(tmp);
     	if(!strlen(tmp))
	 	{
	     	SendClientMessage(playerid, COR_BRANCO, "Digite a quantidade do Colete!");
			return 1;
		}
       	/*if(colete < 1 || colete > 9999)
		{
			return 1;
		}*/
    	for(new possiveis = 0; possiveis < MAX_PLAYERS; possiveis++) if(Airton[playerid][Entrar] == true)
	    {
         	SetPlayerArmour(possiveis, colete);
   		}
    	GetPlayerName(playerid,admnick, 24);
       	format(streventu, 128, "-INFO- O Administrador RCON %s setou Colete %d para os jogadores do evento", admnick, colete);
       	SendClientMessageToAll(COR_AZUL, streventu);
   		return 1;
	}
	return 1;
}

public countdown()
{
	if(CountDown==6) GameTextForAll("~p~Starting...",1000,6);

	CountDown--;
	if(CountDown==0)
	{
		GameTextForAll("~g~GO~ r~!",1000,6);
		CountDown = -1;
		for(new i = 0; i < MAX_PLAYERS; i++) {
			TogglePlayerControllable(i,true);
			PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
		}
		return 0;
	}
	else
	{
		new text[7]; format(text,sizeof(text),"~w~%d",CountDown);
		for(new i = 0; i < MAX_PLAYERS; i++) {
			PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			TogglePlayerControllable(i,false);
		}
	 	GameTextForAll(text,1000,6);
	}

	SetTimer("countdown",1000,0);
	return 0;
}

stock SalvarPlayer(playerid)
{
	new Float: health, Float: armour, Float: SX, Float: SY, Float: SZ;
	GetPlayerHealth(playerid, health);
	GetPlayerArmour(playerid, armour);
	GetPlayerPos(playerid, SX, SY, SZ);
	AirtonData[playerid][grana] = GetPlayerMoney(playerid);
	AirtonData[playerid][Skin] = GetPlayerSkin(playerid);
	AirtonData[playerid][HP] = health;
	if (armour > 0) AirtonData[playerid][Colete] = armour;
	AirtonData[playerid][PosX] = SX;
	AirtonData[playerid][PosY] = SY;
	AirtonData[playerid][PosZ] = SZ;
	AirtonData[playerid][interior] = GetPlayerInterior(playerid);
}
stock UsarPlayer(playerid)
{
	SetPlayerSkin(playerid,AirtonData[playerid][Skin]);
    GivePlayerMoney(playerid, AirtonData[playerid][grana]);
    SetPlayerHealth(playerid, AirtonData[playerid][HP]);
    SetPlayerArmour(playerid, AirtonData[playerid][Colete]);
    SetPlayerPos(playerid, AirtonData[playerid][PosX],
	AirtonData[playerid][PosY], AirtonData[playerid][PosZ]);
	SetPlayerFacingAngle(playerid, AirtonData[playerid][grana]);
	SetPlayerInterior(playerid, AirtonData[playerid][grana]);
	SetPlayerInterior(playerid, AirtonData[playerid][interior]);
	return 1;
}
/*

	Discriзгo: Sistema de eventos v0.3b
	Progamado por: Airton.Vitor
	Manual: Para criar,trancar,setar,etc vocк deve estar logado como Administrador RCON
	Dica: /rcon login [suasenha]
	Lembrete: Sejб um bom menino e mantenha os crйditos :p

*/
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;
}
Reply
#9

Adiciona um ';' no final da linha acima
Reply
#10

Que estranho nunca deu erro na hora de compila o fs.Pelo menos aqui nгo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)