MM if I understand right so you want a dialog that shows 2 cases on duty and off duty
You can do it like that :
First the command the pop up the dialog -
pawn Код:
COMMAND:duty(playerid, params[])
{
if(IsPlayerFED(playerid) || PlayerInfo[playerid][power] >= 10) // change it your your script "if player is a cop"
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, x,y,z) || IsPlayerInRangeOfPoint(playerid, 3.0, x,y,z))
{
ShowPlayerDialog(playerid, 8888, DIALOG_STYLE_LIST, "LSPD duty computer", "\
Go on duty\n\
Go off duty", "Select", "Select");
}
}
else return SendClientError(playerid, CANT_USE_CMD); // SMG for a player who's no cop
return 1;
}
OK now search in your script for
Under it add the dialog response of the "show dialog number 8888" we created before.
pawn Код:
if(dialogid == 8888)
{
TogglePlayerControllable(playerid, true);
switch(listitem)
{
case 0: // PD on duty // here you also must change the [copduty] to your script's varriable.
{
if(PlayerTemp[playerid][copduty] == 1) return SendClientError(playerid, "Your status is already 'ON DUTY'.");
PlayerTemp[playerid][copduty] = 1;
SetPlayerColor(playerid,COLOR_PLAYER_BLUE);
SendClientInfo(playerid, "You are on duty now, officer!");
}
case 1: // PD off duty // here you also must change the [copduty] to your script's varriable.
{
if(PlayerTemp[playerid][copduty] == 0) return SendClientError(playerid, "Your status is already 'OFF DUTY'.");
PlayerTemp[playerid][copduty] = 0;
SetPlayerColor(playerid,COLOR_PLAYER_WHITE);
SendClientInfo(playerid, "You are off duty now, officer!");
}
}
return 1;
}