SA-MP Forums Archive
LSPD skin selection problem - 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 skin selection problem (/showthread.php?tid=452194)



LSPD skin selection problem - Edward2013 - 20.07.2013

Hello. I have a problem with LSPD skin selection. I don't have a code. I want to make a police skin selection at LSPD lockers, so when the players enter the command, they will be able to choose a police skin, but I don't know how to do it. (I am a little new in scripting). Somene have any ideas?


Re: LSPD skin selection problem - JimmyCh - 20.07.2013

You will need to make a dialog when they are near the locker, let's say something like this:
pawn Code:
// the command to be performed
CMD:locker(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == LSPD)// u would of course have to put the cmd for cops only so change this to whatever suits your script
    {
        if(!IsPlayerInRangeOfPoint(playerid, 5, x,y,z) return SendClientMessage(playerid, -1, "You are not at the closet, nigga!");// u put the coordinates of the locker
        else
        {
        ShowPlayerDialog(playerid, 69, DIALOG_STYLE_LIST, "Choose a skin!", "Skin1\nSkin2\nSkin3", "Choose", "Close!");
        }
    else return SendClientMessage(playerid, -1, "You need to be in the LSPD to use this!");
return 1;
}


//now on dialog response
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 999)
{
    if(listitem == 0)
    {
    SetPlayerSkin(playerid, SkinID1);
    SendClientMessage(playerid, -1, "Enjoy your new uniform!");
    }
    if(listitem == 1)
    {
    SetPlayerSkin(playerid, SkinID2);
    SendClientMessage(playerid, -1, "Enjoy your new uniform!");
    }
    if(listitem == 2)
    {
    SetPlayerSkin(playerid, SkinID3);
    SendClientMessage(playerid, -1, "Enjoy your new uniform!");
    }
}
I made this for you really simple, so I hope it helps you, and edit it to what your script looks like


Re: LSPD skin selection problem - Edward2013 - 20.07.2013

Quote:
Originally Posted by JimmyCh
View Post
You will need to make a dialog when they are near the locker, let's say something like this:
pawn Code:
// the command to be performed
CMD:locker(playerid, params[])
{
    if(PlayerInfo[playerid][pMember] == LSPD)// u would of course have to put the cmd for cops only so change this to whatever suits your script
    {
        if(!IsPlayerInRangeOfPoint(playerid, 5, x,y,z) return SendClientMessage(playerid, -1, "You are not at the closet, nigga!");// u put the coordinates of the locker
        else
        {
        ShowPlayerDialog(playerid, 69, DIALOG_STYLE_LIST, "Choose a skin!", "Skin1\nSkin2\nSkin3", "Choose", "Close!");
        }
    else return SendClientMessage(playerid, -1, "You need to be in the LSPD to use this!");
return 1;
}


//now on dialog response
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 999)
{
    if(listitem == 0)
    {
    SetPlayerSkin(playerid, SkinID1);
    SendClientMessage(playerid, -1, "Enjoy your new uniform!");
    }
    if(listitem == 1)
    {
    SetPlayerSkin(playerid, SkinID2);
    SendClientMessage(playerid, -1, "Enjoy your new uniform!");
    }
    if(listitem == 2)
    {
    SetPlayerSkin(playerid, SkinID3);
    SendClientMessage(playerid, -1, "Enjoy your new uniform!");
    }
}
I made this for you really simple, so I hope it helps you, and edit it to what your script looks like
Thanks, it works.


Re: LSPD skin selection problem - JimmyCh - 20.07.2013

No problem