Cmd tuning crash
#1

Код:
if(strcmp(cmd,"/tuning",true) == 0)
	{
		if(AccountInfo[playerid][AdminLevel] >= 1)
		{
			if(IsPlayerInAnyVehicle(playerid))
			{
				new carro;
				carro = GetPlayerVehicleID(playerid);
				if(carro == 562 || carro == 565 || carro == 559 || carro == 561)
				if(IsPlayerInAnyVehicle(playerid))
				{
				ChangeVehicleColor(carro, 6,6);
				AddVehicleComponent(carro, 1010);
				AddVehicleComponent(carro, 1087);
				}
				else
				{
                SendClientMessage(playerid,Erro,"[ERROR] This car not tuning");
               }
			}
			else
			{
			SendClientMessage(playerid,Erro,"Need a car");
			}
		}
		else
		{
		SendClientMessage(playerid,Erro,"You do not have permission to use this command");
		}
		return 1;
	}
HEEEEEEEEEEEELP
Reply
#2

Your probably adding an invalid component ID, check the wiki.
Reply
#3

GetPlayerVehicleID is not a Model. This is number of vehicle in your map.

Код:
if(strcmp(cmd,"/tuning",true) == 0)
	{
		if(AccountInfo[playerid][AdminLevel] >= 1)
		{
			if(IsPlayerInAnyVehicle(playerid))
			{
				new carro = GetVehicleModel(GetPlayerVehicleID(playerid));
				if(carro == 562 || carro == 565 || carro == 559 || carro == 561)
				ChangeVehicleColor(carro, 6,6);
				AddVehicleComponent(carro, 1010);
				AddVehicleComponent(carro, 1087);
				}
				else
				{
  			SendClientMessage(playerid,Erro,"[ERROR] This car not tuning");
  			}
			}
			else
			{
			SendClientMessage(playerid,Erro,"Need a car");
			}
		}
		else
		{
		SendClientMessage(playerid,Erro,"You do not have permission to use this command");
		}
		return 1;
	}
Reply
#4

that wouldn't work either, you're editting the wrong car now

pawn Код:
if(strcmp(cmd,"/tuning",true) == 0)
{
    if(AccountInfo[playerid][AdminLevel] < 1)
      return SendClientMessage(playerid,Erro,"You do not have permission to use this command");
    if(!IsPlayerInAnyVehicle(playerid))
      return SendClientMessage(playerid,Erro,"Need a car");

    new carro = GetPlayerVehicleID(playerid);
    new model = GetVehicleModel(carro);
    if(!(model == 562 || model == 565 || model == 559 || model == 561))
      return SendClientMessage(playerid,Erro,"[ERROR] This car not tuning");

    ChangeVehicleColor(carro, 6, 6);
    AddVehicleComponent(carro, 1010);
    AddVehicleComponent(carro, 1087);

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)