[HELP ME] Password protect certain skin ID's
#8

Quote:
Originally Posted by [HiC
TheKiller ]
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;
}

EDIT: It's on the wiki https://sampwiki.blast.hk/wiki/How_to_pa...protect_skins.
I tried the link it didn't work for me, You added a . at the end of the link so here is the orginal link

https://sampwiki.blast.hk/wiki/How_to_pa..._protect_skins that one should work
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)