SA-MP Forums Archive
LSPD Locker Help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: LSPD Locker Help! (/showthread.php?tid=514471)



LSPD Locker Help! - DarknessKnight - 21.05.2014

Nvm.


Re: LSPD Locker Help! - Lynn - 21.05.2014

pawn Код:
if(listitem == 0) //
{
    new str[128];
    format(str, sizeof str, "{FFFFFF}Evening Officer {00FF22}%s\n{FFFFFF}Are you clocking {00FF22}ON {FFFFFF}or {F81414}OFF{FFFFFF}?", pName(playerid));
    ShowPlayerDialog(playerid, DIALOG_DUTY+1, DIALOG_STYLE_MSGBOX, "Select one", str, "On", "Off");// Change DIALOG_DUTY to the name of your Dialog.
}
pawn Код:
if(dialogid == DIALOG_DUTY+1)
    {
        if(response)
        {
            if(GetPVarInt(playerid, #OnDuty) == 0)
            {
                format(string, sizeof(string), "Officer %s places on his uniform and is now on-duty.", pName(playerid), playerid);
                SendLocalMessage(playerid, string, 10.0, -1, C_LBLUE);
                GivePlayerWeapon(playerid, 24, 75);
                GivePlayerWeapon(playerid, 3, 1);
                GivePlayerWeapon(playerid, 41, 1);
            }
            else {
                SendClientMessage(playerid, -1, " You are already on-duty !");
            }
        }
        else {
            if(GetPVarInt(playerid, #OnDuty) == 1)
            {
                format(string, sizeof(string), "Officer %s removes his uniform and is now off-duty.", pName(playerid), playerid);
                SendLocalMessage(playerid, string, 10.0, -1, C_LBLUE);
                ResetPlayerWeapons(playerid);
            }
            else {
                SendClientMessage(playerid, -1, " You are already off-duty !");
            }
        }
    }