PDA

View Full Version : LSPD skin selection problem


Edward2013
20/07/2013, 01:13 PM
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? :)

JimmyCh
20/07/2013, 01:31 PM
You will need to make a dialog when they are near the locker, let's say something like this:

// 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 :)

Edward2013
20/07/2013, 02:31 PM
You will need to make a dialog when they are near the locker, let's say something like this:

// 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. :)

JimmyCh
20/07/2013, 02:33 PM
No problem :)