PHP код:
public OnGameModeInit()
{
for(new c = 0; c < MAX_VEHICLES; c ++)
{
SetVehicleParamsEx(c, 0, 0, 0, 0, 0, 0, 0);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 0) return SendClientMessage(playerid, -1, "Para ligar o veiculo digite /painel e selecione a primeira opзгo.");
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/painel", true) == 0)
{
if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "Vocк nгo dirigindo nenhum veiculo.");
new veiculo = GetVehicleModel(GetPlayerVehicleID(playerid));
if(Aviao(veiculo) || Trem(veiculo) || Heli(veiculo) || Barco(veiculo) || Bicicleta(veiculo) || Moto(veiculo)) return SendClientMessage(playerid, -1, "Vocк nгo pode usar o painel neste veiculo.");
ShowPlayerDialog(playerid, 495, DIALOG_STYLE_LIST, "Painel do Veiculo:", "Ligar/Desligar Veiculo\nLigar/Desligar Farуis\nLigar/Desligar Alarme\nAbrir/Fechar Capo\nAbrir/Fechar Porta-Malas", "Selecionar", "Cancelar");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 495)
{
if(response == 1)
{
if(listitem == 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 0)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Vocк ligou o motor.");
}
else
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Vocк desligou o motor.");
}
}
else if(listitem == 1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(lights == 0)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, 1, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Vocк ligou os farуis.");
}
else
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, 0, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Vocк desligou os farуis.");
}
}
else if(listitem == 2)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(alarm == 0)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, 1, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Vocк ligou o alarme.");
}
else
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, 0, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Vocк desligou o alarme.");
}
}
else if(listitem == 3)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(bonnet == 0)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, 1, boot, objective);
SendClientMessage(playerid, -1, "Vocк abriu o porta-malas.");
}
else
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, 0, boot, objective);
SendClientMessage(playerid, -1, "Vocк fechou o porta-malas.");
}
}
else if(listitem == 4)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(boot == 0)
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, 1, objective);
SendClientMessage(playerid, -1, "Vocк abriu o capф.");
}
else
{
SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, 0, objective);
SendClientMessage(playerid, -1, "Vocк fechou o capф.");
}
}
}
}
return 1;
}
stock Aviao(veiculo) //FEITO POR SHADOWW5
{
if(veiculo == 460 || veiculo == 476 || veiculo == 511 || veiculo == 512 || veiculo == 513 || veiculo == 519 || veiculo == 520 || veiculo == 553 || veiculo == 577 || veiculo == 592 || veiculo == 593)
{
return 1;
}
return 0;
}
stock Heli(veiculo) //FEITO POR SHADOWW5
{
if(veiculo == 417 || veiculo == 425 || veiculo == 447 || veiculo == 469 || veiculo == 487 || veiculo == 488 || veiculo == 497 || veiculo == 548 || veiculo == 563)
{
return 1;
}
return 0;
}
stock Barco(veiculo) //FEITO POR SHADOWW5
{
if(veiculo == 430 || veiculo == 446 || veiculo == 452 || veiculo == 453 || veiculo == 454 || veiculo == 472 || veiculo == 484 || veiculo == 493 || veiculo == 595)
{
return 1;
}
return 0;
}
stock Bicicleta(veiculo) //FEITO POR SHADOWW5
{
if(veiculo == 481 || veiculo == 509 || veiculo == 510)
{
return 1;
}
return 0;
}
stock Trem(veiculo) //FEITO POR SHADOWW5
{
if(veiculo == 449 || veiculo == 537 || veiculo == 538 || veiculo == 570)
{
return 1;
}
return 0;
}
stock Moto(veiculo) //FEITO POR SHADOWW5
{
if(veiculo == 448 || veiculo == 461 || veiculo == 462 || veiculo == 463 || veiculo == 468 || veiculo == 521 || veiculo == 522 || veiculo == 523 || veiculo == 581 || veiculo == 586)
{
return 1;
}
return 0;
}