Some Issues - 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: Some Issues (
/showthread.php?tid=369848)
Some Issues -
iFizzy - 18.08.2012
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);
}
Re: Some Issues -
iFizzy - 18.08.2012
Bump
Re: Some Issues -
Rudy_ - 18.08.2012
it's spammed because OnPlayerUpdate is Called 1000 in one sec (i think)....
Re: Some Issues -
iFizzy - 18.08.2012
Quote:
Originally Posted by Rudy_
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.