[AJUDA] Sistema de Neon
#1

To com um sistema de neon aqui que se por mas de 2 neons buga entгo como faзo para adicionar apenas 1 em cada carro?

Код:
#define FILTERSCRIPT
#define COLOR_WHITE 0xFFFFFFAA
#include <a_samp>
#define NEON 1337
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("		        	 Neon System			");
	print(" 			Traduzido					");
	print("--------------------------------------\n");
	return 1;
}

#endif
new ObjetoNeon[15];
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/neon", cmdtext, true, 10) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
 		{
  			if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
			{
				SendClientMessage(playerid, COLOR_WHITE, " Vocк tem que ser o motorista para comprar o neon");
				return 1;
			}
			ShowPlayerDialog(playerid, NEON, DIALOG_STYLE_LIST, "Escolha seu neon","{0000FF}Azul\n{00FF00}Verde\n{FFFF00}Amarelo\n{FFFFFF}Branco\n{FF00FF}Rosa\nRemover Neon","Ok","Cancelar");
		}
		else
		{
		    SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo estб em um veiculo");
		}
		return 1;
	}
	return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == NEON)
	{
		if(response)
		{
		    if(listitem == 0)
		    {
		        SetPVarInt(playerid, "neon", 1);
            	SetPVarInt(playerid, "blue", ObjetoNeon[0] = CreateObject(18648,0,0,0,0,0,0));
            	SetPVarInt(playerid, "blue1", ObjetoNeon[1] = CreateObject(18648,0,0,0,0,0,0));
            	AttachObjectToVehicle(GetPVarInt(playerid, "blue"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            	AttachObjectToVehicle(GetPVarInt(playerid, "blue1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            	SendClientMessage(playerid, COLOR_WHITE, "Voce instalou o neon azul em seu carro");
			}
			if(listitem == 1)
			{
   				SetPVarInt(playerid, "neon", 1);
       			SetPVarInt(playerid, "green", ObjetoNeon[2] = CreateObject(18649,0,0,0,0,0,0));
       			SetPVarInt(playerid, "green1", ObjetoNeon[3] = CreateObject(18649,0,0,0,0,0,0));
       			AttachObjectToVehicle(GetPVarInt(playerid, "green"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
          		AttachObjectToVehicle(GetPVarInt(playerid, "green1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
          		SendClientMessage(playerid, COLOR_WHITE, "Voce instalou o neon verde em seu carro");
			}
			if(listitem == 2)
			{
			    SetPVarInt(playerid, "neon", 1);
       			SetPVarInt(playerid, "yellow", ObjetoNeon[4] = CreateObject(18650,0,0,0,0,0,0));
          		SetPVarInt(playerid, "yellow1", ObjetoNeon[5] = CreateObject(18650,0,0,0,0,0,0));
            	AttachObjectToVehicle(GetPVarInt(playerid, "yellow"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
             	AttachObjectToVehicle(GetPVarInt(playerid, "yellow1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
				SendClientMessage(playerid, COLOR_WHITE, "Voce instalou o neon amarelo em seu carro");
			}
			if(listitem == 3)
			{
   				SetPVarInt(playerid, "neon", 1);
   				SetPVarInt(playerid, "white", ObjetoNeon[6] = CreateObject(18652,0,0,0,0,0,0));
   				SetPVarInt(playerid, "white1", ObjetoNeon[7] = CreateObject(18652,0,0,0,0,0,0));
       			AttachObjectToVehicle(GetPVarInt(playerid, "white"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
          		AttachObjectToVehicle(GetPVarInt(playerid, "white1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_WHITE, "Voce instalou o neon branco em seu carro");
			}
			if(listitem == 4)
			{
   				SetPVarInt(playerid, "neon", 1);
     			SetPVarInt(playerid, "pink", ObjetoNeon[8] = CreateObject(18651,0,0,0,0,0,0));
        		SetPVarInt(playerid, "pink1", ObjetoNeon[9] = CreateObject(18651,0,0,0,0,0,0));
          		AttachObjectToVehicle(GetPVarInt(playerid, "pink"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            	AttachObjectToVehicle(GetPVarInt(playerid, "pink1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
				SendClientMessage(playerid, COLOR_WHITE, "Voce instalou o neon rosa em seu carro");
			}
			if(listitem == 5)
			{
			    DestroyObject(ObjetoNeon[0]);
			    DestroyObject(ObjetoNeon[1]);
			    DestroyObject(ObjetoNeon[2]);
			    DestroyObject(ObjetoNeon[3]);
			    DestroyObject(ObjetoNeon[4]);
			    DestroyObject(ObjetoNeon[5]);
			    DestroyObject(ObjetoNeon[6]);
			    DestroyObject(ObjetoNeon[7]);
			    DestroyObject(ObjetoNeon[8]);
			    DestroyObject(ObjetoNeon[9]);
			    DestroyObject(ObjetoNeon[0]);
			    DestroyObject(ObjetoNeon[1]);
			    DestroyObject(ObjetoNeon[2]);
			    DestroyObject(ObjetoNeon[3]);
			    DestroyObject(ObjetoNeon[4]);
			    DestroyObject(ObjetoNeon[5]);
			    DestroyObject(ObjetoNeon[6]);
			    DestroyObject(ObjetoNeon[7]);
			    DestroyObject(ObjetoNeon[8]);
			    DestroyObject(ObjetoNeon[9]);
	            SendClientMessage(playerid, COLOR_WHITE, "Voce removeu o seu neon");
            }
		}
 	}
	return 1;
}


public OnVehicleDeath(vehicleid)
{
    DestroyObject(ObjetoNeon[0]);
    DestroyObject(ObjetoNeon[1]);
    DestroyObject(ObjetoNeon[2]);
    DestroyObject(ObjetoNeon[3]);
    DestroyObject(ObjetoNeon[4]);
    DestroyObject(ObjetoNeon[5]);
    DestroyObject(ObjetoNeon[6]);
    DestroyObject(ObjetoNeon[7]);
    DestroyObject(ObjetoNeon[8]);
    DestroyObject(ObjetoNeon[9]);
    DestroyObject(ObjetoNeon[0]);
    DestroyObject(ObjetoNeon[1]);
    DestroyObject(ObjetoNeon[2]);
    DestroyObject(ObjetoNeon[3]);
    DestroyObject(ObjetoNeon[4]);
    DestroyObject(ObjetoNeon[5]);
    DestroyObject(ObjetoNeon[6]);
    DestroyObject(ObjetoNeon[7]);
    DestroyObject(ObjetoNeon[8]);
    DestroyObject(ObjetoNeon[9]);
}
public OnVehicleSpawn(vehicleid)
{
    DestroyObject(ObjetoNeon[0]);
    DestroyObject(ObjetoNeon[1]);
    DestroyObject(ObjetoNeon[2]);
    DestroyObject(ObjetoNeon[3]);
    DestroyObject(ObjetoNeon[4]);
    DestroyObject(ObjetoNeon[5]);
    DestroyObject(ObjetoNeon[6]);
    DestroyObject(ObjetoNeon[7]);
    DestroyObject(ObjetoNeon[8]);
    DestroyObject(ObjetoNeon[9]);
    DestroyObject(ObjetoNeon[0]);
    DestroyObject(ObjetoNeon[1]);
    DestroyObject(ObjetoNeon[2]);
    DestroyObject(ObjetoNeon[3]);
    DestroyObject(ObjetoNeon[4]);
    DestroyObject(ObjetoNeon[5]);
    DestroyObject(ObjetoNeon[6]);
    DestroyObject(ObjetoNeon[7]);
    DestroyObject(ObjetoNeon[8]);
    DestroyObject(ObjetoNeon[9]);
}
Reply


Messages In This Thread
[AJUDA] Sistema de Neon - by L.S.T - 15.12.2011, 00:54
Re: [AJUDA] Sistema de Neon - by Lуs - 15.12.2011, 01:04
Re: [AJUDA] Sistema de Neon - by L.S.T - 15.12.2011, 01:13
Re: [AJUDA] Sistema de Neon - by Lуs - 15.12.2011, 01:19
Re: [AJUDA] Sistema de Neon - by L.S.T - 15.12.2011, 01:23
Re: [AJUDA] Sistema de Neon - by Lуs - 15.12.2011, 01:30
Re: [AJUDA] Sistema de Neon - by L.S.T - 15.12.2011, 02:00
Re: [AJUDA] Sistema de Neon - by Lуs - 15.12.2011, 02:21
Re: [AJUDA] Sistema de Neon - by L.S.T - 15.12.2011, 02:26
Re: [AJUDA] Sistema de Neon - by Lуs - 15.12.2011, 02:29

Forum Jump:


Users browsing this thread: 6 Guest(s)