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

Hi there ive tried some stuff and ive searched.
I have posted on script request thread but nothing...

Hey need to help me with THIS!. i need a script where i can put a password on a CERTAIN skin ID!! HELP!!!

Please guys i need a script that can put a password on a specific skin ID's that if you type the password of the skin ID on the selection screen you will be granted to that skin and be spawned!! PLEASE HELP!!
Reply
#2

Man your not giving enought information between you are not making any sence at all ? can you please be more especific
Reply
#3

I want it like this.

if i press shift or the " Spawn " button
It will ask for a password, If the password is right, It spawns them with the skin,
If its wrong, It dosent let them use it ( IT WILL SAY " Invalid Password " ),
How would i do that properly? Ive tried several ways but havent succeeded

thats how i want it sorry if i didnt made scence before
Reply
#4

Then use variables and ur skin id and make it so when player trys to spawn with it a inputdialog box appears
and if he enters the right code it will SpawnPlayer(playerid); and if else set the player to the Skin Choser Again
this might vary and might take some time to make if you dont know what your doing anyways im not a expert if im wrong dont flame tyring to help

Reply
#5

i understand but listen im a newbiee
Reply
#6

Код:
public OnPlayerRequestClass(playerid,classid)
{
  if(classid == TheSkinNumberGoesHere)
  {
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"EnterPassword","Enter your password below:","Spawn","Cancel");
  }
  return 1;
}

then on dialog response


		if(dialogid == 1)
		{
		  heregoes the function you want w.e iff they enter the right password will spawn em
          also define what that Input box we did below effect will be
		}
		else
		{
          here you define what heppens if the player enter the wrong password
          a new dialog window and a message maybe? so they have to reenter password idk
          i think this is enought help i have to go sleep later :D

		}
heres a minitutorial this will be enought information to make it anyways gtg later
Reply
#7

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_password_protect_skins
Reply
#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
#9

i got this

C:\DOCUME~1\HP_ADM~1\Desktop\SAMP-S~1\GAMEMO~1\perp.pwn(323) : error 001: expected token: ")", but found "{"

please help
Reply
#10

Goto line 323
If you see {
Goto line above it
If theres a ; on the end, Remove that and add )
If there isent a ;. Then add ) Anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)