Need help
#1

Hi. I've seen server, where my gate open/close automatically if i've bought a house, which have gate. And gate opens only for house owner and house renters. So can someone help me? I need to make gate moving automatically if i own this house. But not for others.
Also it can be command , what only this house owner/renter can use.
Well. I'm new scripter, but i know how to make gate with command. But then can everyone use this command :/ .

----
Thanks.
Franklyn.
Reply
#2

Well, if you have written the owners name into a variable, you can do it this way (this would be for 'house 1'

pawn Код:
if(!strcmp("/opengate", cmdtext, true))
    {
        if(!strcmp(Ownername[House1],Playername,true))
        {
            SetTimer("OnGateMoveBack",4000,false); // setting a timer to move the gate back
            MoveObject(blablabla); // Put your info here to move the gate to
            MoveGateBack[playerid] = 1; // Do not forget to define this.
        }
        return 1;
    }
pawn Код:
forward OnGateMoveBack();
public OnGateMoveBack()
{
    if(MoveGateBack[playerid] == 1)
    {
        MoveObject(blabla); // move the object back
        MoveGateBack[playerid] = 0;
    }
    return 1;
}
Please note that I have not done something good now by writing almost the whole code. try making it yourself next time and learn these function, and the 'Related Functions'. They're really useful.
Reply
#3

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Well, if you have written the owners name into a variable, you can do it this way (this would be for 'house 1'

pawn Код:
if(!strcmp("/opengate", cmdtext, true))
    {
        if(!strcmp(Ownername[House1],Playername,true))
        {
            SetTimer("OnGateMoveBack",4000,false); // setting a timer to move the gate back
            MoveObject(blablabla); // Put your info here to move the gate to
            MoveGateBack[playerid] = 1; // Do not forget to define this.
        }
        return 1;
    }
pawn Код:
forward OnGateMoveBack();
public OnGateMoveBack()
{
    if(MoveGateBack[playerid] == 1)
    {
        MoveObject(blabla); // move the object back
        MoveGateBack[playerid] = 0;
    }
    return 1;
}
Please note that I have not done something good now by writing almost the whole code. try making it yourself next time and learn these function, and the 'Related Functions'. They're really useful.

Thanks i will try it. Thing is , that i've been scripting only week : ).

---
Thanks.
Franklyn.
Reply
#4

No problem, new scripters are always welcome ^^ but learn these functions. They're useful. ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)