X

由于无法提供服务器的高昂费用,博客即将迁移到github pages...

点击右上的X可以临时关闭此框并阻止跳转^_^

现在带您过去 秒后跳转...

Linux之CentOS 6.7 下无网络? 原来是网卡没启动!

    CentOS-Network-eth0
    今天用Vbox安装了CentOS 6.7 准备测试游戏服务器,需要下载一个服务端,使用wget时发现无wget命令,聪明的我马上想到使用yum install wget 来安装一个,谁知道出现了无法连接镜像列表的报错,通过查看ifconfig发现,原来是网卡没有启动,于是查看了资料:

     vi /etc/sysconfig/network-scripts/ifcfg-eth0
    

    修改开启自启:

    DEVICE=eth0
    HWADDR=00:0C:29:2E:37:F0
    TYPE=Ethernet
    UUID=69cd9740-184f-49b7-857f-e397e57f265b
    ONBOOT=yes          //修改此处
    NM_CONTROLLED=yes   //修改此处
    BOOTPROTO=dhcp
    

    然后重启网络:

    //重启网络
    /etc/init.d/network restart
    //查看IP
    

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

    hospital

    下面是围栏的创建,写入main()或者OnGameModeInit()函数即可;

    	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);//后面障碍
    

    新建障碍门变量:

    new hospitalgate1;//门关
    new hospitalgate2;//门开
    
    //写入OnGameModeInit()函数
    hospitalgate1 = CreateObject(968, 1209.4478, -1384.9000, 13.0276, 0.00000, -90.00000, 0.00000);
    
    public GateCloseHspt()
    {
          DestroyObject( hospitalgate2 );
          hospitalgate1 = CreateObject(968, 1209.4478, -1384.9000, 13.0276, 0.00000, -90.00000, 0.00000);
          lshospital = 0;
          return 1;
    }
    
    //此段代码在输入指令/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;
    			}
    		}