pawn Код:
new Locked[MAX_PLAYERS];
public OnPlayerRequestClass(playerid,classid)
{
//Either use classid or GetPlayerSkin
if(GetPlayerSkin(playerid) == 0/*SkinID, I'm using 0 (CJ)*/ && Locked[playerid] == 0)
{
ShowPlayerDialog(playerid,1000,DIALOG_STYLE_INPUT,"Unlock the skin","Enter the skin password","OK","Cancel");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1000 && response == 1 && strcmp(inputtext, "Password"/*Change Password to whatever*/)
{
Locked[playerid] = 1;
GameTextForPlayer(playerid, "~b~Skin ~y~ Unlocked", 2000, 3);
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 0/*SkinID, I'm using 0 (CJ)*/ && Locked[playerid] == 0)
{
GameTextForPlayer(playerid, "~r~Skin Locked!", 2000, 3);
ShowPlayerDialog(playerid,1000,DIALOG_STYLE_INPUT,"Unlock the skin","Enter the skin password","OK","Cancel");
return 0;
}
return 1;
}
public OnPlayerConnect(playerid)
{
Locked[playerid] = 0;
return 1;
}