Player Dialog
#1

HELLO Friends




i have to make a posision to command /duty,and want when player type that spot a dialog list for set skin

and i want that pos on right side of Monitor and under hoods


what style most use?
anyone can show example?
Reply
#2

Positioning the dialog box to the right of the screen might be very hard or impossible to do (let me know if you pull it off). As for the dialog, you will want to use DIALOG_STYLE_LIST in SendPlayerDialog(). then in OnDialogResponse, the variable listitem in that callback will contain the list entry that the player entered (STARTING AT 0).

Try it yourself before asking for an entire script, you will learn more that way
Reply
#3

plz explain more thinks
im new
Reply
#4

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
pawn Код:
public OnDialogResponse
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;
    }
Reply
#5

4 case
next skin
before skin
use this skin
off duty

on skins
player choose a skin from POLICE skins
he can choose next and before skin
use skin
when player choose this her skin changed to skin he choose from list
off duty
player go of from duty
Reply
#6

You can do that easly with SetPlaySkin just add it to the cased and edit it as you wish.
Reply
#7

and about off duty and on duty?
Reply
#8

SEE
@:AdamCooper
CODE
its Perfect
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)