SA-MP Forums Archive
Door and Keypad. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Door and Keypad. (/showthread.php?tid=283976)



Door and Keypad. - Sting. - 17.09.2011

Now I need help from someone who has a object or map editor to help me with this.I want to create a door here.The picture.I need the door to be in the entrance and have keypads.But only admins can access it, not players.I want someone to show me in gamemode pawn the suitable door and all pawn codes for creating this.


Re: Door and Keypad. - =WoR=Varth - 17.09.2011

Should be in Request Section.


Re: Door and Keypad. - Sting. - 17.09.2011

But just If you know it, please help me out.


Re: Door and Keypad. - Pasa - 17.09.2011

Have you some admin system?


Re: Door and Keypad. - Pasa - 17.09.2011

something like this ~if(isplayeradmin)~


sry for dublepost :S


Re: Door and Keypad. - Sting. - 17.09.2011

Yes.I'm creating it for a Admin Class.A Office for admins.So I want a area closed so only Admins can go in.


Re: Door and Keypad. - Pasa - 17.09.2011

you add the door and use this code

PHP код:
new door;
Public 
OnPlayerModeInit
{
door CreateObject(here the cordinates of the closed door);
}

public 
OnPlayerCommandText(playeridcmdtext[])
{

    if (
strcmp("/open"cmdtexttrue10) == 0)
    {
                If(
isplayeradmin//here put what you using on your admin system!
                
{
        
MoveObject(door,here the coordinates of the opened door,here the speed of moving exp5.0);
        return 
1;
            }   
        }
        if (
strcmp("/close"cmdtexttrue10) == 0)
    {
                If(
isplayeradmin//here put what you using on your admin system!
                
{
        
MoveObject(door,here the coordinates of the closeddoor,here the speed of moving exp5.0);
        return 
1;
            }   
        }
        return 
0;




Re: Door and Keypad. - Sting. - 17.09.2011

Thanks Pasa


Re: Door and Keypad. - Pasa - 17.09.2011

No problem