10.05.2012, 18:45
how do i make it so the object moves when player is in point
i want it so it works off both Sides of player inpoint
pawn Код:
CreateDynamicObject(18450, 1653.9000244141, -3886.1000976563, -5.9000000953674, 0, 0, 339.2138671875);//Closed
CreateDynamicObject(18450, 1653.9000244141, -3886.1000976563, 9, 0, 0, 339.2138671875);//Open
pawn Код:
AddPlayerClass(201,1612.9235,-3870.7036,10.3205,249.1435,0,0,0,0,0,0); // LS pORT SIDE // 1ST SIDE TO WORK OFF
AddPlayerClass(201,1696.7499,-3902.6533,10.3205,73.0088,0,0,0,0,0,0); // islamabad side// OTHER SIDE
pawn Код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
#define Message_color 0xFF0000AA
new bus;
forward Tolls(playerid);
forward Close();
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("bus barriier");
print("--------------------------------------\n");
bus = CreateDynamicObject(18450, 1653.9000244141, -3886.1000976563, -5.9000000953674, 0, 0, 339.2138671875);
//-------------------------------------Objects--------------------------------------------------//
//------------------------------------------------------------------------------------------------//
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect( playerid )
{
SetTimerEx("Tolls", 1500, true, "d", playerid);
return 1;
}
public Tolls(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1653.9000244141, -3886.1000976563, -5.9000000953674))
{
MoveDynamicObject(bus, 1653.9000244141, -3886.1000976563, 9, 2.5);
SetTimerEx("Close",7000,false,"i", 0);
}
}
public Close()
{
MoveDynamicObject(bus, 1653.9000244141, -3886.1000976563, -5.9000000953674, 3.5);
return 1;
}