need help with my gate,
#1

I was trying to make a gate that opens when I come to it at LSPD, but some thing is wrong with my script
and I don't know what, and now does I hope for help, I'm new to scripts, and my game mode is downloaded from samp forum,
Код:
#include <a_samp>


stock IsPlayerInRangeOfPoint(playerid, Float:radius, Float:X, Float:Y, Float:Z)
{
    new Float:px,Float:py,Float:pz;
    GetPlayerPos(playerid,px,py,pz);
    return ( ( ((px-X)*(px-X))+((py-Y)*(py-Y))+((pz-Z)*(pz-Z)) ) >= radius*radius );
}new mygate;
mygate = CreateObject(2920, 1544.7008056641, -1630.8284912109, 13.229135513306, 271.25009155273, 180, 180);
SetTimer("CheckGate",2000,true);
forward CheckGate();
public CheckGate()
{
    new mygate_status;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0,1544.7008056641,-1630.8284912109,13.229135513306))mygate_status=1;
    }
    if(mygate_status)MoveObject(mygate, 1544.6550292969, -1630.546875, 13.379133224487,1000);
    else MoveObject(mygate, 1544.7008056641, -1630.8284912109, 13.229135513306, 1000);
}
that was my script

Код:
 CreateObject(2920, 1544.7008056641, -1630.8284912109, 13.229135513306, 271.25009155273, 180, 180);
here is the gate closed

Код:
CreateObject(2920, 1544.6550292969, -1630.546875, 13.379133224487, 0, 0, 0);
and here is a pic of the errors I think

http://sphotos.ak.fbcdn.net/hphotos-..._3210928_n.jpg

I used this to help me https://sampwiki.blast.hk/wiki/Automatic_Gates
Reply
#2

Remove IsPlayerInRangeOfPoint completely, it already exists
Reply
#3

roflol indeed, it's default by sa-mp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)