`SAMP`标签下的文章

游戏

SAMP-LS中心医院围栏+自动门

20170206148636277144832.png
下面是围栏的创建,写入main()或者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(966, 1209.32813, -1384.90000, 12.24180,   0.00000, 0.00000, 0.00000);//障碍底座
CreateObject(967, 1210.39294, -1384.90000, 12.24560, 0.00000, 0.00000, -90.00000);//看守台
CreateObject(970, 1187.95776, -1384.87561, 12.78820, 0.00000, 0.00000, 0.00000);//前面大门围栏
CreateObject(970, 1200.26697, -1384.90002, 12.78820, 0.00000, 0.00000, 0.00000);//前面大门围栏
CreateObject(970, 1192.11816, -1384.90002, 12.78820, 0.00000, 0.00000, 0.00000);//前面大门围栏
CreateObject(970, 1196.20007, -1384.90002, 12.78820, 0.00000, 0.00000, 0.00000);//前面大门围栏
CreateObject(1411, 1210.96069, -1383.11963, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1377.84949, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1372.57935, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1367.30921, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1362.03907, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1356.76893, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1351.49879, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1346.22865, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1340.95851, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1335.68837, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1330.41823, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1325.14809, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1319.87795, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1314.60781, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1309.33767, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1304.06753, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1298.79739, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(1411, 1210.96069, -1293.52725, 13.86000, 0.00000, 0.00000, 90.00000);//侧面围栏
CreateObject(978, 1206.48462, -1290.66870, 13.21470, 0.00000, 0.00000, 0.00000);//后面障碍
CreateObject(978, 1197.15100, -1290.66504, 13.21470, 0.00000, 0.00000, 0.00000);//后面障碍
CreateObject(978, 1187.76526, -1290.66870, 13.21470, 0.00000, 0.00000, 0.00000);//后面障碍

新建障碍门变量:

1
2
new hospitalgate1;//门关
new hospitalgate2;//门开

1
2
//写入OnGameModeInit()函数
hospitalgate1 = CreateObject(968, 1209.4478, -1384.9000, 13.0276, 0.00000, -90.00000, 0.00000);
1
2
3
4
5
6
7
public GateCloseHspt()
{
DestroyObject( hospitalgate2 );
hospitalgate1 = CreateObject(968, 1209.4478, -1384.9000, 13.0276, 0.00000, -90.00000, 0.00000);
lshospital = 0;
return 1;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//此段代码在输入指令/go(开门的指令)相关代码里面加入
else if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//医院
{
if (IsPlayerInRangeOfPoint(playerid, 15,1209.4478,-1384.9000,12.9476))
{
if(lshospital == 1) { SendClientMessage(playerid, COLOR_GREY, "** 医院大门已经打开了"); return 1; }
DestroyObject( hospitalgate1 );
hospitalgate2 = CreateObject(968, 1209.4478, -1384.9000, 13.0276, 0.00000, 0.00000, 0.00000);
//MoveObject(hospitalgate1,1209.44775,-1385.21558,12.94760,2,0.00000,0.00000,0.0000);
SetTimer("GateCloseHspt", 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);
lshospital = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* 你附近没有可以打开的门!.");
return 1;
}
}

阅读剩下更多

默认配图
游戏

SAMP-地图-新鞋停车场围栏Obj

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;
}

阅读剩下更多

默认配图
返回顶部