Some Issues
#1

I'm currently trying to make a system; When you are near the gate it should print a Message " Please Shout The Secret Word " and if the word he shouts is correct the door opens

Pretty much the code compiles fine but when I test it in game and I go near the gate it spams in my screen the message " Please Shout The Secret Word ". Also the gate does not rotate smoothly. It rotates instantly instead.

pawn Code:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 2, 266.60000610,-1331.40002441,52.20000076))
    {
        ProxDetector(2, playerid, "Please shout the secret word to access in the house (( House Security System ))" , -1);
        Answering[playerid]=1;
    }
    return 1;
}

public OnPlayerText(playerid, text[])
{
    if( Answering[playerid] == 1 )
    {
        new Answer;
        Answer = strval(text);
        if( Answer == 555555 )
        {
            MoveObject(Barrier, 266.60000610,-1331.40002441,53.09999847, 8, 0.00000000,0.25021362,34.00000000);
            SetTimer("CloseGate", 2000, false);
        }
    }
    return 0;
}

public CloseGate()
{
    MoveObject(Barrier, 266.60000610,-1331.40002441,53.09999847, 8,0.00000000,268.24990845,34.00000000);
}
Reply
#2

Bump
Reply
#3

it's spammed because OnPlayerUpdate is Called 1000 in one sec (i think)....
Reply
#4

Quote:
Originally Posted by Rudy_
View Post
it's spammed because OnPlayerUpdate is Called 1000 in one sec (i think)....
Well OnPlayerUpdate Callback is pretty much the most logical callback to use since it's the only looping callback for players, along with OnPlayerStateChange.

Although I used OnPlayerUpdate since I want it to work in any case.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)