2017020614863629785667.png

下面是围栏的创建,写入OnGameModeInit()函数即可;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
	CreateObject(985, 1407.17517, -2267.35474, 12.53770,   0.00000, 0.00000, 180.00000);
CreateObject(985, 1415.00610, -2267.35474, 12.53770, 0.00000, 0.00000, 180.00000);
CreateObject(985, 1399.33862, -2267.35474, 12.53770, 0.00000, 0.00000, 180.00000);
CreateObject(985, 1399.33862, -2267.35474, 12.53770, 0.00000, 0.00000, 180.00000);
CreateObject(985, 1391.50842, -2267.35474, 12.53770, 0.00000, 0.00000, 180.00000);
CreateObject(985, 1383.69531, -2267.35474, 12.53770, 0.00000, 0.00000, 180.00000);
CreateObject(985, 1371.91162, -2263.42041, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1371.91162, -2255.59082, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1371.91162, -2247.79932, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1371.91162, -2240.01318, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1371.91162, -2232.20728, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1371.91162, -2224.41846, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1371.91162, -2216.63135, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1371.91162, -2208.81470, 12.53770, 0.00000, 0.00000, 90.00000);
CreateObject(985, 1383.63245, -2204.85791, 12.53770, 0.00000, 0.00000, 0.00000);
CreateObject(985, 1391.45520, -2204.85791, 12.53770, 0.00000, 0.00000, 0.00000);
CreateObject(985, 1399.27893, -2204.85791, 12.53770, 0.00000, 0.00000, 0.00000);
CreateObject(985, 1407.10815, -2204.85791, 12.53770, 0.00000, 0.00000, 0.00000);
CreateObject(985, 1418.95215, -2263.45361, 12.53770, 0.00000, 0.00000, -90.00000);
CreateObject(985, 1418.95215, -2255.62061, 12.53770, 0.00000, 0.00000, -90.00000);
CreateObject(985, 1418.95215, -2247.78955, 12.53770, 0.00000, 0.00000, -90.00000);
CreateObject(985, 1418.95215, -2239.96265, 12.53770, 0.00000, 0.00000, -90.00000);
CreateObject(985, 1418.95215, -2224.43652, 12.53770, 0.00000, 0.00000, -90.00000);
CreateObject(985, 1418.95215, -2208.79883, 12.53770, 0.00000, 0.00000, -90.00000);
CreateObject(985, 1418.95215, -2216.62427, 12.53770, 0.00000, 0.00000, -90.00000);
CreateObject(985, 1375.85364, -2267.35474, 12.53770, 0.00000, 0.00000, 180.00000);
CreateObject(985, 1375.78442, -2204.85791, 12.53770, 0.00000, 0.00000, 180.00000);

接下来是遥控门的代码:(左右打开的门)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* 首先声明两个门的变量: */
new xxgate1;
new xxgate2;

/* 一个函数: */
forward GateCloseXx();

/* 初始化动态对象 写在public OnGameModeInit()函数体里面 */
xxgate1 = CreateObject(988,1419.0482,-2235.0635,13.5822,0.00000,0.00000,90.00000);
xxgate2 = CreateObject(988,1419.0477,-2229.5605,13.5822,0.00000,0.00000,90.00000);

/* 函数代码实例: */
public GateCloseXx()
{
//DestroyDynamicObject( xxgate2 );
MoveObject(xxgate1,1419.0482,-2235.0635,13.5822,2,0.00000,0.00000,90.0000);
MoveObject(xxgate2,1419.0477,-2229.5605,13.5822,2,0.00000,0.00000,90.0000);
lsxinxie = 0;
return 1;
}

/* 开门指令: */
/* 找到下面的代码 */
if(!strcmp(cmdtext, "/go", true)) // By CuervO_NegrO
{
if(IsAPDMember(playerid) || IsAFreecop(playerid))
{
.......
}
...
...
...
/* 下面是新增的 */
else if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
{
if (IsPlayerInRangeOfPoint(playerid, 15,1419.3103,-2232.0325,12.8972))
{
if(lsxinxie == 1) { SendClientMessage(playerid, COLOR_GREY, "** 新鞋停车场门已经打开了"); return 1; }
MoveObject(xxgate1,1419.0482,-2238.0635,13.5822,2,0.00000,0.00000,90.0000);
MoveObject(xxgate2,1419.0477,-2225.5605,13.5822,2,0.00000,0.00000,90.0000);
SetTimer("GateCloseXx", 6000, 0);
SendClientMessage(playerid, COLOR_BLUE,"新鞋停场大门打开了并将在6秒后关闭.");

format(string, sizeof(string), "* %s 打开了 新鞋停车场大门.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
lsxinxie = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* 你附近没有可以打开的门 新鞋!.");
return 1;
}
}
/* 上面是新增的 */
/* 下面是已经有的 */
else
{
SendClientMessage(playerid, COLOR_GREY,"* 你没有开门的遥控器.");
}
return 1;
}