SA-MP Forums Archive
Cmd tuning crash - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Cmd tuning crash (/showthread.php?tid=66859)



Cmd tuning crash - saladaaBR - 24.02.2009

Код:
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


Re: Cmd tuning crash - Norn - 24.02.2009

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


Re: Cmd tuning crash - Jefff - 24.02.2009

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;
	}



Re: Cmd tuning crash - [RP]Rav - 25.02.2009

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;
}