House Password?
#2

Try something like

pawn Код:
new PasswordScreen[MAX_PLAYERS]; // Top of your script

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
      if(PlayerToPoint(2, playerid, HouseX, HouseY, HouseZ); //fill your house icon co-ords in here
      {
        if(IsPlayerAdmin(playerid))
        {
          PasswordScreen[playerid] = 1;
          SendClientMessage(playerid, YourColorHere, "Press T and type in the password");
            }
        }
        return 1;
    }
    return 0;
}

public OnPlayerText(playerid, text[])
{
    if(PasswordScreen[playerid] == 1)
    {
      PasswordScreen[playerid] = 0;
      if(strcmp(text, "PutThePasswordInHere", 1) == 0) //Fill in the house password
      {
        //Password is correct
        //House stuff goes in here, SetPlayerPos, SetPlayerInterior etc etc
        }
        else SendClientMessage(playerid, YourColorHere, "Incorrect Password"); //Password is incorrect
        return 0;
    }
    return 1;
}
You will need PlayerToPoint for that, or just edit it to whatever you use for that stuff.

Note: Untested. and indentation looks horrible on the forums.
Reply


Messages In This Thread
House Password? - by TheNotorius - 06.10.2009, 03:01
Re: House Password? - by Gappy - 06.10.2009, 03:36
Re: House Password? - by TheNotorius - 06.10.2009, 08:20
Re: House Password? - by eXchainZ-FoReVeR - 06.10.2009, 10:31
Re: House Password? - by ferriswheel - 06.10.2009, 11:29
Re: House Password? - by TheNotorius - 07.10.2009, 07:30
Re: House Password? - by Gappy - 07.10.2009, 09:03

Forum Jump:


Users browsing this thread: 2 Guest(s)