#include <a_samp>
#include <AutoMove>
#define FILTERSCRIPT
public OnFilterScriptInit()
{
CreateAutoObject(0, 971, 551.22101, 1659.31995, 9.59222, 0.00000, 0.00000, 304.77103, -1, -1, 75.0, 15.0, 557.70056, 1650.47827, 9.59222, 0.00000, 0.00000, 304.77103, 3); //Cars only.
CreateAutoObject(1, 971, 532.47937, 1688.40173, 10.33070, 0.00000, 0.00000, 26.49157, -1, -1, 95.0, 20.0, 532.47937, 1688.40173, 6.19246, 0.00000, 0.00000, 26.49157, 2); //Players only.
CreateAutoObject(2, 971, -62.40447, 1341.03003, 9.79037, 0.00000, 0.00000, 0.00000, -1, -1, 100.5, 10.0, -59.96775, 1344.00391, 9.79037, 0.00000, 0.00000, 300.6515, 2.5); //Cars and Players.
return 1;
}
public OnAutoObjectOpen(playerid, auto_objectid)
{
switch(auto_objectid)
{
case 0: //object id 0, can enter only while in vehicle
{
if(IsPlayerInAnyVehicle(playerid)) //if player enter with vehicle open
{
SendClientMessage(playerid, 0xFFFF00FF, "Welcome");
}
else //if player enter on foot dont open
{
CloseAutoObject(0); //were using the close function because it automaticly opens, so if we want the object to stay and not move we have to use that function
SendClientMessage(playerid, 0xFF0000FF, "You have to be in a vehicle");
}
}
case 1:
{
if(!IsPlayerInAnyVehicle(playerid)) //opposite of id 0
{
SendClientMessage(playerid, 0xFFFF00FF, "Welcome");
}
else
{
CloseAutoObject(1);
SendClientMessage(playerid, 0xFF0000FF, "Vehicles are not allowed");
}
}
case 2: //opens not matter on foot or in vehicle
{
SendClientMessage(playerid, 0xFFFF00FF, "Welcome");
}
}
return 1;
}
2119.89111328,1916.40917969,10.59587479,179.99993896,-1,-1,900
#include <a_samp>
#include <AutoMove> //make sure that you have YSI
#define FILTERSCRIPT
public OnFilterScriptInit()
{
CreateAutoObject(0, 971, 2127.21655, 1913.26990, 13.35634, 0.00000, 0.00000, 4.02577, -1, -1, 100.0, 15.0, 2116.99609, 1912.27893, 13.35634, 0.00000, 0.00000, 4.02577, 3);
//usage CreateAutoObject(id, modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, Float:stream_distance, Float:move_distance, Float:tox, Float:toy, Float:toz, Float:torx, Float:tory, Float:torz, Float:move_speed);
return 1;
}
public OnAutoObjectOpen(playerid, auto_objectid)
{
new name[24];
switch(auto_objectid)
{
case 0: //checking if the auto object id is 0
{
GetPlayerName(playerid, name, sizeof(name)); //getting player name
if(strcmp(name, "seyed", true) != 0) return CloseAutoObject(0); //if doesnt match close gate if match gates will open
}
}
return 1;
}
PHP код:
|