CMD:car(playerid, params[])
{
if(pAusente[playerid] == true) return pMensagem(playerid, Vermelho, "| ERRO | Vocк estб ausente.");
if(pPreso[playerid] == true) return pMensagem(playerid, Vermelho, "| ERRO | Vocк estб preso.");
if(EmArenaDM[playerid] == true) return pMensagem(playerid, Vermelho, "| ERRO | Vocк nгo pode usar este comando em uma arena.");
if(pEvento[playerid] == true) return pMensagem(playerid, Vermelho, "| ERRO | Vocк estб no evento.");
new vID[15], Cor, Cor2;
if(sscanf(params, "s[15]ii", vID, Cor, Cor2)) return pMensagem(playerid, AzulC, "| INFO | Use: /Car [Nome] [Corid] [Corid]");
new bool:existe, VeiculoID;
for(new r = 0;r < 212; r++)
{
if(!strcmp(vID, sCars[r],true))
{
existe = true;
}
if(!strcmp(vID, sCars[r],true)) VeiculoID = (r+400);
}
if(!existe) return pMensagem(playerid, Vermelho, "| ERRO | Veнculo nгo existe.");
if(pDMLiberado[playerid] == false && sCAdmin[playerid] < 5)
{
if(VeiculoID == 520 || VeiculoID == 432 || VeiculoID == 592 || VeiculoID == 425 ||
VeiculoID == 464 || VeiculoID == 406 || VeiculoID == 476 || VeiculoID == 447) return pMensagem(playerid, Vermelho, "| ERRO | Esse veнculo nгo й permitido neste mundo.");
}
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
CriarVeiculo(playerid, VeiculoID, X, Y, Z+1, Angle, Cor, Cor2, 0);
return 1;
}
if (dialogid == cMundos)
{
if(response)
{
if(listitem == 0)
{
SetPlayerVirtualWorld(playerid, 0);
if(sCar[playerid] != 0) DestroyVehicle(sCar[playerid]);
ResetPlayerWeapons(playerid);
pDMLiberado[playerid] = false;
EmArenaDM[playerid] = false;
PlayerTextDrawHide(playerid, Veloci[playerid]);
pMensagem(playerid, -1, "{E2B227}| INFO |{F8F8FF} Mundo Principal{E2B227} selecionado.");
KillTimer(pTempoDM[playerid]);
PlayerTextDrawHide(playerid, PontosDM[playerid]);
}
stock CriarVeiculo(playerid, modelid, Float:posX, Float:posY, Float:posZ, Float:angle, Colour1, Colour2, respawn_delay)
{
new world = GetPlayerVirtualWorld(playerid);
new interior = GetPlayerInterior(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(sCar[playerid]) DestroyVehicle(sCar[playerid]);
GetPlayerPos(playerid, posX, posY, posZ);
GetPlayerFacingAngle(playerid, angle);
sCar[playerid] = CreateVehicle(modelid, posX, posY, posZ, angle, Colour1, Colour2, respawn_delay);
LinkVehicleToInterior(sCar[playerid], interior);
SetVehicleVirtualWorld(sCar[playerid], world);
SetVehicleZAngle(sCar[playerid], angle);
PutPlayerInVehicle(playerid, sCar[playerid], 0);
SetPlayerInterior(playerid, interior);
sCar[MAX_PLAYERS], |
stock CriarVeiculo(playerid, modelid, Float:posX, Float:posY, Float:posZ, Float:angle, Colour1, Colour2, respawn_delay)
{
new world = GetPlayerVirtualWorld(playerid);
new interior = GetPlayerInterior(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(sCar[playerid]) DestroyVehicle(sCar[playerid]);
GetPlayerPos(playerid, posX, posY, posZ);
GetPlayerFacingAngle(playerid, angle);
sCar[playerid] = CreateVehicle(modelid, posX, posY, posZ, angle, Colour1, Colour2, respawn_delay);
LinkVehicleToInterior(sCar[playerid], interior);
SetVehicleVirtualWorld(sCar[playerid], world);
SetVehicleZAngle(sCar[playerid], angle);
PutPlayerInVehicle(playerid, sCar[playerid], 0);
SetPlayerInterior(playerid, interior);
}