30/10/2021 06:25
Fiz em mSelection.
Dentro da pasta scriptfiles crie uma pasta chamada mSelection e dentro dela crie um arquivo chamado carros.txt e cole o code abaixo no arquivo.
Código PHP:
#include <a_samp>
#include <zcmd>
#define Lista_Carros "mSelection/carros.txt"
#include <mSelection>
new VeiculoCriado[MAX_PLAYERS];
new CriouCarro[MAX_PLAYERS];
new veiculosmList = mS_INVALID_LISTID;
public OnGameModeInit()
{
veiculosmList = LoadModelSelectionMenu(Lista_Carros);
}
public OnPlayerConnect(playerid)
{
CriouCarro[playerid] = 0;
VeiculoCriado[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(CriouCarro[playerid] == 1)
{
DestroyVehicle(VeiculoCriado[playerid]);
VeiculoCriado[playerid] = INVALID_VEHICLE_ID;
CriouCarro[playerid] = 0;
}
return 1;
}
CMD:cv(playerid)
{
if(IsPlayerConnected(playerid))
{
if(CriouCarro[playerid] == 1)
{
DestroyVehicle(VeiculoCriado[playerid]);
VeiculoCriado[playerid] = INVALID_VEHICLE_ID;
CriouCarro[playerid] = 0;
SendClientMessage(playerid, 0xE6E6E6E6, "Seu veiculo anterior foi destruido.");
ShowModelSelectionMenu(playerid, veiculosmList, "Escolha seu novo carro", 50, 0x000000AA);
TogglePlayerControllable(playerid,0);
}
else
{
ShowModelSelectionMenu(playerid, veiculosmList, "Escolha seu carro", 50, 0x000000AA);
TogglePlayerControllable(playerid,0);
}
}
return 1;
}
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == veiculosmList)
{
if(response)
{
new Float:X, Float:Y, Float:Z, Float:Angle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
VeiculoCriado[playerid] = AddStaticVehicleEx(modelid, X, Y, Z, Angle, -1, -1, -1);
PutPlayerInVehicle(playerid, VeiculoCriado[playerid], 0);
LinkVehicleToInterior(VeiculoCriado[playerid], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(VeiculoCriado[playerid], GetPlayerVirtualWorld(playerid));
CriouCarro[playerid] = 1;
TogglePlayerControllable(playerid,1);
}
}
else
SendClientMessage(playerid, 0xE6E6E6E6, "Você cancelou o menu de carros!");
TogglePlayerControllable(playerid,1);
return 1;
}
Dentro da pasta scriptfiles crie uma pasta chamada mSelection e dentro dela crie um arquivo chamado carros.txt e cole o code abaixo no arquivo.
Código:
400 -16.0 0.0 -35.0
401 -16.0 0.0 -35.0
402 -16.0 0.0 -35.0
404 -16.0 0.0 -35.0
560 -16.0 0.0 -35.0
405 -16.0 0.0 -35.0
410 -16.0 0.0 -35.0
411 -16.0 0.0 -35.0
412 -16.0 0.0 -35.0
413 -16.0 0.0 -35.0
415 -16.0 0.0 -35.0
418 -16.0 0.0 -35.0
419 -16.0 0.0 -35.0
422 -16.0 0.0 -35.0
424 -16.0 0.0 -35.0
426 -16.0 0.0 -35.0
429 -16.0 0.0 -35.0
434 -16.0 0.0 -35.0
436 -16.0 0.0 -35.0
439 -16.0 0.0 -35.0
442 -16.0 0.0 -35.0
444 -16.0 0.0 -35.0
445 -16.0 0.0 -35.0
451 -16.0 0.0 -35.0
458 -16.0 0.0 -35.0
459 -16.0 0.0 -35.0
461 -16.0 0.0 -35.0
462 -16.0 0.0 -35.0
463 -16.0 0.0 -35.0
466 -16.0 0.0 -35.0
467 -16.0 0.0 -35.0
468 -16.0 0.0 -35.0
474 -16.0 0.0 -35.0
475 -16.0 0.0 -35.0
478 -16.0 0.0 -35.0
479 -16.0 0.0 -35.0
480 -16.0 0.0 -35.0
481 -16.0 0.0 -35.0
483 -16.0 0.0 -35.0
487 -16.0 0.0 -35.0
491 -16.0 0.0 -35.0
492 -16.0 0.0 -35.0
496 -16.0 0.0 -35.0
500 -16.0 0.0 -35.0
506 -16.0 0.0 -35.0
507 -16.0 0.0 -35.0
508 -16.0 0.0 -35.0
517 -16.0 0.0 -35.0
518 -16.0 0.0 -35.0
521 -16.0 0.0 -35.0
522 -16.0 0.0 -35.0
527 -16.0 0.0 -35.0
533 -16.0 0.0 -35.0
534 -16.0 0.0 -35.0
535 -16.0 0.0 -35.0
536 -16.0 0.0 -35.0
541 -16.0 0.0 -35.0
542 -16.0 0.0 -35.0
545 -16.0 0.0 -35.0
549 -16.0 0.0 -35.0
550 -16.0 0.0 -35.0
551 -16.0 0.0 -35.0
554 -16.0 0.0 -35.0
555 -16.0 0.0 -35.0
558 -16.0 0.0 -35.0
559 -16.0 0.0 -35.0
560 -16.0 0.0 -35.0
561 -16.0 0.0 -35.0
562 -16.0 0.0 -35.0
565 -16.0 0.0 -35.0
566 -16.0 0.0 -35.0
567 -16.0 0.0 -35.0
572 -16.0 0.0 -35.0
573 -16.0 0.0 -35.0
575 -16.0 0.0 -35.0
576 -16.0 0.0 -35.0
579 -16.0 0.0 -35.0
580 -16.0 0.0 -35.0
581 -16.0 0.0 -35.0
585 -16.0 0.0 -35.0
587 -16.0 0.0 -35.0
588 -16.0 0.0 -35.0
589 -16.0 0.0 -35.0
600 -16.0 0.0 -35.0
602 -16.0 0.0 -35.0
603 -16.0 0.0 -35.0
604 -16.0 0.0 -35.0
605 -16.0 0.0 -35.0