[Pedido] Nгo iniciar comboio sozinho
#1

bom o titulo ja diz tudo quem ajudar + REP !!
Reply
#2

Nгo, o tнtulo nгo diz tudo, pelo contrбrio.

Qual gamemode? Cadк o cуdigo do comando que inicia o comboio?
Reply
#3

Vocк tem que fazer as especificaзхes, ninguйm vai adivinhar oque vocк quer.
Reply
#4

PPC_Trucking

COMMAND:comboio(playerid, params[])
{
// Setup local variables
new ConvoyList[750], Name[24], NumMembers, ConvoyStatus[10];

// Send the command to all admins so they can see it
SendAdminText(playerid, "/comboio", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Create the list of convoys with all their data
for (new i; i < MAX_CONVOYS; i++)
{
// Check if this is an empty convoy (not created yet by a player)
if (AConvoys[i][Status] == CONVOY_EMPTY)
{
// Setup data for an empty convoy (one which hasn't been chosen yet)
NumMembers = 0;
format(Name, 24, "nenhum");
format(ConvoyStatus, 10, "vazio");
}
else
{
// Get the name of the convoy-leader
GetPlayerName(AConvoys[i][Members][0], Name, sizeof(Name));
// Calculate the members in the convoy
NumMembers = Convoy_CountMembers(i);
// Set the status of the convoy
switch (AConvoys[i][Status])
{
case CONVOY_OPEN: format(ConvoyStatus, 10, "Aberto");
case CONVOY_FULL: format(ConvoyStatus, 10, "Cheio");
case CONVOY_CLOSED: format(ConvoyStatus, 10, "Fechado");
}
}

// Put all data together to form the content of the entire dialog
format(ConvoyList, sizeof(ConvoyList), "%sLнder: {FFFF00}%s{FFFFFF}, membros: {FFFF00}%i{FFFFFF}, Status: {FFFF00}%s{FFFFFF}\n", ConvoyList, Name, NumMembers, ConvoyStatus);
}

// Show the dialog
ShowPlayerDialog(playerid, DialogSelectConvoy, DIALOG_STYLE_LIST, "Selecione o comboio:", ConvoyList, "Selecionar", "Cancelar");
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}
Reply
#5

eu quero que nao de pra iniciar comboio sozinho tipo /comboio inicia comboio ai qnd digita /t se so tiver uma pessoa no comboio aparece Voce nao pode iniciar um comboio sozinho
Reply
#6

Vocк vai precisar criar uma funзгo para verificar se tem um player prуximo a ele e se ele player faz parte do grupo a ele definido para participar disso.
graficamente falando:


Segundo a imagem a funзгo precisa satisfazer a parte 1 e 2.
desculpe se nгo foi muito didбtico.
Reply
#7

Vocк tem que adicionar essa Tal funзгo no comando que inicia o trabalho nгo no comando /comboio '-'
Reply
#8

auguem pode pasar o cod nao to conseguindo criar
Reply
#9

Poste o Comando /trabalhar
Reply
#10

COMMAND:trabalhar(playerid, params[])
{
// Send the command to all admins so they can see it
SendAdminText(playerid, "/trabalhar", params);

// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// First check if the player already has a job
if (APlayerData[playerid][JobStarted] == false)
{
// Check the player's class
switch (APlayerData[playerid][PlayerClass])
{
case ClassTruckDriver:
{
// Get the id of the convoy (if the player is in a convoy)
new Convoy = APlayerData[playerid][ConvoyID];

// Check if the player is part of a convoy AND is not the leader
if ((APlayerData[playerid][InConvoy] == true) && (AConvoys[Convoy][Members][0] != playerid))
{
// Let the player know he's not the leader of his convoy and cannot start a job
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк nгo й o lнder do comboio, por tanto nгo pode iniciar uma missгo.");
// Exit the function
return 1;
}

// A convoy-leader proceeds here, and also a normal player (no convoy-member)

// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Check if the player is inside a valid trucking vehicle
switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehicleFlatbed, VehicleDFT30, VehicleCementTruck: // Flatbed, DFT-30, CementTruck
if (APlayerData[playerid][TruckerLicense] == 1) // Check if the player has acquired a truckers license
ShowPlayerDialog(playerid, DialogTruckerJobMethod, DIALOG_STYLE_LIST, "Selecione o mйtodo:", "Configurar sua prуpria carga e rota\r\nAtribuir auto-carga", "Selecionar", "Cancelar");
else
Trucker_StartRandomJob(playerid); // Start a random job

case VehicleLineRunner, VehicleTanker, VehicleRoadTrain: // Player is driving a truck which needs a trailer
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid))) // Check if there is a trailer attached
if (APlayerData[playerid][TruckerLicense] == 1) // Check if the player has acquired a truckers license
ShowPlayerDialog(playerid, DialogTruckerJobMethod, DIALOG_STYLE_LIST, "Selecione o mйtodo:", "Configurar sua prуpria carga e rota\r\nAtribuir auto-carga", "Selecionar", "Cancelar");
else
Trucker_StartRandomJob(playerid); // Start a random job
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa de um trailer para iniciar o trabalho.");

default: SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um caminhгo para iniciar o trabalho.");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um caminhгo para iniciar o trabalho.");
}
case ClassBusDriver:
{
// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
if (GetVehicleModel(GetPlayerVehicleID(playerid)) == VehicleCoach) // Check if the player is inside a valid busdriver vehicle
if (APlayerData[playerid][BusLicense] == 1) // Check if the player has acquired a busdriver license
ShowPlayerDialog(playerid, DialogBusJobMethod, DIALOG_STYLE_LIST, "Selecione o mйtodo :", "Escolha sua prуpria rota de фnibus\r\nAtribuir auto-rota", "Selecionar", "Cancelar");
else
BusDriver_StartJob(playerid, random(sizeof(ABusRoutes))); // Start a random job
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar dirigindo um фnibus para iniciar o trabalho!");
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar dirigindo um фnibus para iniciar o trabalho!");
}
case ClassPilot:
{
// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Check if the player is inside a valid piloting vehicle
switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehicleShamal, VehicleNevada, VehicleMaverick, VehicleCargobob, VehicleAT400, VehicleAndromada, VehicleDodo: // Plane (Shamal), Plane (Nevada), helicopter (Maverick)
Pilot_StartRandomJob(playerid); // Start a random piloting job
default: SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um veнculo de voo para iniciar o trabalho.");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um veнculo de voo para iniciar o trabalho.");
}
case ClassMafia:
{
// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Check if the player is inside a valid piloting vehicle
switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehicleSandKing, VehicleMoonbeam: // Sangking, Moonbeam
Mafia_StartRandomJob(playerid); // Start a random mafia job
default: SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um veнculo da mбfia para iniciar o trabalho.");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um veнculo da mбfia para iniciar o trabalho.");
}
case ClassCourier:
{
// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Check if the player is inside a valid courier vehicle
switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehicleBurrito, VehicleFaggio, VehicleBenson: // Van (Burrito), bike (Faggio)
Courier_StartJob(playerid); // Start a random courier job
default: SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um veнculo dos Correios para iniciar o trabalho.");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um veнculo dos Correios para iniciar o trabalho.");
}
case ClassRoadWorker:
{
// Check if the player is the driver of a vehicle
if (GetPlayerVehicleSeat(playerid) == 0)
{
// Check if the player is inside a valid courier vehicle
switch (GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case VehicleUtilityVan, VehicleTowTruck: // Utility Van, Towtruck
Roadworker_StartRandomJob(playerid); // Start a random roadworker job
default: SendClientMessage(playerid, 0xFF0000FF, "Vocк precisa estar conduzindo um veнculo do DNIT para iniciar o trabalho.");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк precisa estar conduzindo um veнculo do DNIT para iniciar o trabalho.");
}
default: SendClientMessage(playerid, 0xFF0000FF, "[BST] A sua classe nгo pode fazer todos os trabalhos.");
}
}
else // Send a message to let the player know he already has a job
SendClientMessage(playerid, 0xFF0000FF, "[BST] Vocк jб estб realizando um trabalho!");
}
else
return 0;

// Let the server know that this was a valid command
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)