Code:
static gotPassword[MAXPLAYERS + 1];
Whenever some gets a Number of the Password then do
[/code]gotPassword[Client] = Password;[/code]
while Password is the Password for this Client
Then do this
Code:
public OnClientDisconnect(Client)
{
if(gotPassword[Client] != 0)
{
PrintToChatAll("The Password of the player was %d", gotPassword[Client]);
}
}
Not the best solution but something like this could work..
To make the keycode thing make this
Code:
static String:CorrectPassword[5]
add this
Code:
public OnPluginStart()
{
RegConsoleCmd("sm_unlocksaveroom",UnlockSaveroom");
}
then add this to the gotPassword function
Code:
Format(CorrectPassword, sizeof(CorrectPassword), "%s%d", CorrectPassword, Password);
Password is the new Password number
then the console command
Code:
public Action:UnlockSaveroom(Client, Args)
{
decl String:TryCode[5]
GetCmdArg(1, TryCode, 5);
if(StrEqual(TryCode, CorrectPassword))
{
AcceptEntityInput(Saveroomdoorblabla, "unlock");
}
}
Just lock the door on map start and do shits.. i wont do this for you and gave you enough code to get started ;P