ne stavo facendo uno per la mia gm, ovviamente vedi di non spacciarlo per tuo, quindi non rimuovere i crediti xD Lo script ha solo le funzioni basiliari, senza messaggi del tipo "Tizio accende il motore" e senza script per cambiare la targa. Poi te lo modifichi come vuoi tu.
L' indentazione viene sfasata :/ che palle
In cima alla gm:
Codice:
#define MENUV 4567
#define COLORE_ERRORE 0xFF444499
In OnPlayerCommandText:
Codice:
if(!strcmp(cmdtext, "/menu", true))
{
new stato;
stato = GetPlayerState(playerid);
new elic;
elic = GetPlayerVehicleID(playerid);
if(stato != PLAYER_STATE_DRIVER)return SendClientMessage(playerid, COLORE_ERRORE, "[ERRORE] Non sei in un veicolo.");
if(elic == 487)return SendClientMessage(playerid, COLORE_ERRORE, "[ERRORE] Menù non disponibile per gli elicotteri.");
ShowPlayerDialog(playerid, MENUV, DIALOG_STYLE_LIST, "Menù veicolo by Francesco_Ronaldo", "Accendi/Spegni motore\nAccendi/Spegni luci\nApri/Chiudi cofano\nApri/Chiudi bagagliaio\nBlocca/Sblocca porte\nAttiva/Disattiva allarme", "Scegli", "Indietro");
return 1;
}
In OnDIalogResponse:
Codice:
if(dialogid == MENUV)
{
new vid, motore, luci, allarme, porte, cofano, bagagliaio, objective;
GetVehicleParamsEx(vid, motore, luci, allarme, porte, cofano, bagagliaio, objective);
vid = GetPlayerVehicleID(playerid);
if(response)
{
// Listitem 0
if(listitem == 0)
{
if(motore == 0)
{
SetVehicleParamsEx(vid, 1, luci, allarme, porte, cofano, bagagliaio, objective);
}
else if(motore == 1)
{
SetVehicleParamsEx(vid, 0, 0, 0, porte, cofano, bagagliaio, objective);
}
}
// Listitem 1
if(listitem == 1)
{
if(motore != 1)return SendClientMessage(playerid, COLORE_ERRORE, "[ERRORE] Accendi prima il motore.");
{
if(luci == 0)
{
SetVehicleParamsEx(vid, motore, 1, allarme, porte, cofano, bagagliaio, objective);
}
else if (luci == 1)
{
SetVehicleParamsEx(vid, motore, 0, allarme, porte, cofano, bagagliaio, objective);
}
}
}
// Listitem 2
if(listitem == 2)
{
if (cofano == 0)
{
SetVehicleParamsEx(vid, motore, luci, allarme, porte, 1, bagagliaio, objective);
}
else if(cofano == 1)
{
SetVehicleParamsEx(vid, motore, luci, allarme, porte, 0, bagagliaio, objective);
}
}
// Listitem 3
if(listitem == 3)
{
if (bagagliaio == 0)
{
SetVehicleParamsEx(vid, motore, luci, allarme, porte, cofano, 1, objective);
}
else if(bagagliaio == 1)
{
SetVehicleParamsEx(vid, motore, luci, allarme, porte, cofano, 0, objective);
}
}
// Listitem 4
if(listitem == 4)
{
if (porte == 0)
{
SetVehicleParamsEx(vid, motore, luci, allarme, 1, cofano, bagagliaio, objective);
}
else if(porte == 1)
{
SetVehicleParamsEx(vid, motore, luci, allarme, 0, cofano, bagagliaio, objective);
}
// Listitem 5
if(listitem == 5)
{
if(motore != 1)return SendClientMessage(playerid, COLORE_ERRORE, "[ERRORE] Accendi prima il motore.");
{
if (allarme == 0)
{
SetVehicleParamsEx(vid, motore, luci, 1, porte, cofano, bagagliaio, objective);
}
else if(allarme == 1)
{
SetVehicleParamsEx(vid, motore, luci, 0, porte, cofano, bagagliaio, objective);
}
}
}
}
}
return 1;
}