Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- forward OnPlayerInArea();
- new bool:parea[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- SetTimer("OnPlayerInArea", 300, 1);
- return 1;
- }
- public OnPlayerInArea()
- {
- for(new i = 0; i < 100; i++)
- {
- if(PlayerInArea(i, -1416.8, 688.6, -1073.8, 842.3))
- {
- if(!parea[i])
- {
- //pra aparecer a mensagem somente 1 vez depois que ele entrar na área
- //se não tivesse isso, a mensagem iria aparecer umas 3,333~ vezes por segundo pra ele
- SendClientMessage(i, 1010580650, "Oi, parabéns, o FS funcionou! =D");
- parea[i] = true;
- }
- } else {
- parea[i] = false;
- }
- }
- return 1;
- }
- stock PlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- return X >= MinX && Y >= MinY && X <= MaxX && Y <= MaxY;
- }
Add Comment
Please, Sign In to add comment