#define Dialog_VehSystem 12
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/vehsys", true)
{
new State=GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
ShowPlayerDialog(playerid,Dialog_VehSystem,2,"{FFFFFF}Vehicle System:","Engine \nEngine off \nLights \nLights off ","Ok","Cancel");
}else SendClientMessage(playerid,0xFFFFFFAA, "Sorry, You must be in vehicle!");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==Dialog_VehSystem)
{
new carid = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
if(response)
{
//Engine on
if(listitem == 0)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,1,lights,alarm,doors,bonnet,boot,objective);
}
//Engine off
if(listitem == 1)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,0,lights,alarm,doors,bonnet,boot,objective);
}
//Lights on
if(listitem == 2)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,1,alarm,doors,bonnet,boot,objective);
}
//Lights off
if(listitem == 3)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,0,alarm,doors,bonnet,boot,objective);
}
}
return 1;
}
return 0;
}
#define Dialog_VehSystem 12
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/vehsys", true)
{
new State=GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine && lights )
ShowPlayerDialog(playerid,Dialog_VehSystem,2,"{FFFFFF}Vehicle System:","Engine off \nLights off","Ok","Cancel");
else if(engine && !lights )
ShowPlayerDialog(playerid,Dialog_VehSystem,2,"{FFFFFF}Vehicle System:","Engine off \nLights on","Ok","Cancel");
else if(!engine && lights )
ShowPlayerDialog(playerid,Dialog_VehSystem,2,"{FFFFFF}Vehicle System:","Engine on \nLights off","Ok","Cancel");
else ShowPlayerDialog(playerid,Dialog_VehSystem,2,"{FFFFFF}Vehicle System:","Engine on \nLights on","Ok","Cancel");
}else SendClientMessage(playerid,0xFFFFFFAA, "Sorry, You must be in vehicle!");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==Dialog_VehSystem)
{
new carid = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
if(response)
{
if(listitem == 0)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == 0)
SetVehicleParamsEx(carid,1,lights,alarm,doors,bonnet,boot,objective);
else SetVehicleParamsEx(carid,0,lights,alarm,doors,bonnet,boot,objective);
}
//Engine off
if(listitem == 1)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
if(lights==0)
SetVehicleParamsEx(carid,engine,1,alarm,doors,bonnet,boot,objective);
else SetVehicleParamsEx(carid,engine,1,alarm,doors,bonnet,boot,objective);
}
}
return 1;
}
nice work does it work yet hope that you release it the the samp community as a full script with many options
|
pawn Код:
|