18.08.2012, 10:39
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.
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);
}