Button Activated Gates That Only Open For A Certain Player Name
#4

pawn Code:
new IsGateOpen;



public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   
    if (newkeys && SECONDARY_FIRE)
    {
        new name[24];
        GetPlayerName(playerid, name,sizeof(name));
        if (strcmp(name, "Your name",true) == 0)
        {
            if (IsGateOpen == 0)
            {
            //MoveObject(....); //when you want to open the gate
            IsGateOpen = 1;
            return 1;
            }
            if (IsGateOpen == 1)
            {
            //MoveObject(....); //when you want to close the gate
            IsGateOpen = 0;
            return 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)