diguo小说源码
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/23 06:32:37 体裁作文
篇一:帝国都市服务器脚本源码
#include
static szGameModeName[128] = "帝国都市";//服务器名字
static szGameModeAuthorName[128] = "hcyx";//服务器作者
#define COLOR_GREY 0xAFAFAFAA//服务器脚本颜色代码
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_JOIN 0x74E80099
#define INACTIVE_PLAYER_ID 255
#define PI 3.1415926535897932384626433832795
#define MAX_WEAPONS 61
enum playerInfo
{
SkinID,
}
enum playerfight{
Float:fightx,
Float:fighty,
Float:fightz,
Float:fightangel,
}
new RandomPlayerfight[ ][playerfight] =
{
{335.570099,-233.904694,29.646601,164.184799},//服务器随机出生地点
{-540.355713,806.634583,97.510399,222.869095},
{-1037.172729,80.577003,11.579200,87.457100},
{327.972198,-222.016098,35.881302,157.274796},
{-758.352966,-1584.810913,18.566093,332.000000},
{-746.899353,-1589.474365,18.566097,342.200012},
{-995.121887,185.130905,12.434000,5.948400},
{-1013.162109,-858.580383,17.954100,157.357300},
{-597.619446,653.861145,11.071777,13.400000},
{-539.271362,696.654358,11.084653,247.699997},
{80.921997,-1456.618530,11.606800,247.754898},
{63.919201,-1450.336914,10.565500,353.467896},
{72.817001,-1445.638916,11.312300,53.248798},
{-696.673706,941.201782,11.084600,217.990601},
{492.094208,697.811829,12.103300,55.821301},
{429.153687,607.471375,12.716100,9.417500},
{-1191.747559,76.524002,11.128100,318.114197},
{-410.094330,-585.276733,11.628822,323.700012},
{-379.328278,-593.527954,10.362345,187.699997},
{-638.065308,-1463.110229,12.598000,265.781799},
{-595.983215,-1493.943604,8.039500,294.864807},
{-621.978088,-1471.491699,15.548600,157.052994},
{-627.675903,-1469.366211,15.548600,160.162903},
{375.835999,-484.967194,13.817200,242.417206},
{-657.076294,762.287720,11.599755,130.699997},
{-874.322998,-683.454102,11.290915,326.799988},
{-870.946533,-685.190857,11.212971,334.600006},
{-1191.673096,-1351.587402,11.430400,156.740707}
};
new wep_init = 0;
new pInfo[MAX_PLAYERS][playerInfo];
new gWeapons[MAX_WEAPONS][64];
new gPlayers[MAX_PLAYERS][MAX_PLAYER_NAME+1];
new bool: IsCountdownStarted;
new CountdownTimer, cd;
new RandomGMName[][] =
{
"ec.hcyxsb.cn",//服务器动态文字模式
"增加!stats/!admins/进服提示",
"DM/特技/混战 v1.9.5_r2"
};
forward SendGMName();
//------------------------------------------------------------------------------------------------------
main()
{
print("\n ----------------------------------\n");
printf(" %s\n",szGameModeName);
printf(" \tby %s\n",szGameModeAuthorName);
print(" ----------------------------------\n");
}
//------------------------------------------------------------------------------------------------------
public OnPlayerConnect(playerid)//服务器相关属性设置
{
SetWaterLevel(6.0);
SetGamespeed(100);
SetGravity(100);
EnableStuntBike(255,1);
Taxiboostjump(1);
FastSwitch(1);
Jumpswitch(1);
SetPlayerDriveOnWater(1);
EnableShootInAir(255,1);
SendClientMessage(playerid, COLOR_YELLOW, "For a list of commands,type !commands");
SendClientMessage(playerid, COLOR_YELLOW, "To join fight zone type !fight");
SendClientMessage(playerid, COLOR_YELLOW, "Forum:ec.hcyxsb.cn Version:1.9.5_r2 update Time:2014-6-23");
return 1;
}
forward SendXMS();
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new szMsg[256];
new idx, newvar;
cmd = strtok(cmdtext, idx);//服务器管理员指令
if (strcmp(cmd, "ann", true) == 0) {
if (IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /c ann
[Message]");
} else {
new string[256];
format(string, 256, "%s", cmdtext[4]);
GameTextForAll(string);
}
} else {
SendClientMessage(playerid, COLOR_GREEN, " You have not access to use the command!");
}
return 1;
}
else if (strcmp(cmd, "wep", true) == 0)
{
tmp = strtok(cmdtext, idx);
new len = strlen(tmp);
if (!len) { format(szMsg,sizeof(szMsg),"Usage: /c
newvar = FindWepIDFromString(tmp);
if (newvar != 0) { SetPlayerWeapon(playerid,newvar,200); }
return 1;
}
return 0;
}
//------------------------------------------------------------------------------------------------------
public OnPlayerText(playerid, cmdtext[])
{
new cmd[256];
new tmp[256];
new szMsg[256];
new idx, newvar;
new Float:x, Float:y, Float:z;
cmd = strtok(cmdtext, idx);
if (strcmp(cmd, "!goto", true) == 0)//服务器玩家指令
{
tmp = strtok(cmdtext, idx);
new len = strlen(tmp);
if (!len) { format(szMsg,sizeof(szMsg),"Usage: !goto
SendClientMessage(playerid, COLOR_GREY, szMsg);return 1;}
newvar = FindPlayerIDFromString(tmp);
if (newvar != INACTIVE_PLAYER_ID) {
GetPlayerPos(newvar,x,y,z);
SetPlayerPos(playerid,x,y + 1.0,z,0,0);
format(szMsg,sizeof(szMsg),"Taking [%i] %s
[%i] %s.",playerid,gPlayers[playerid],newvar,gPlayers[newvar]);
SendClientMessageToAll(COLOR_GREEN, szMsg);
}
return 1;
}
else if (strcmp(cmd, "!wep", true) == 0)
{
tmp = strtok(cmdtext, idx);
new len = strlen(tmp);
if (!len) { format(szMsg,sizeof(szMsg),"Usage: wep to !wep
newvar = FindWepIDFromString(tmp);
if (newvar != 0) { SetPlayerWeapon(playerid,newvar,200); }
return 1;
}
else if (strcmp(cmd, "!skin", true) == 0) {
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN,"[Syntax] - The correct use: !skin
else {
SetPlayerSkin(playerid,strval(tmp));
}
return 1;
}
else if (strcmp(cmd, "!count", true) == 0) {
if (IsCountdownStarted == true) SendClientMessage(playerid,COLOR_GREEN,"[Error] - Already active countdown.");else if (IsCountdownStarted == false) {
cd = 3;
CountdownTimer = SetTimer("CountDown", 1000, 1);
IsCountdownStarted = true;
}
return 1;
}
else if (strcmp(cmd, "!heal", true) == 0)
{
SetPlayerHealth(newvar,99.0);
SendClientMessage(playerid, COLOR_YELLOW, "You have been healed!");
return 1;
}
else if (strcmp(cmd, "!fix", true) == 0)
{
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) { newvar = playerid; }
else { newvar = FindPlayerIDFromString(tmp); }
if (newvar == INACTIVE_PLAYER_ID) { return 1; }
if (IsPlayerInAnyVehicle(newvar)) {
SetVehicleHealth(GetPlayerVehicleID(newvar),1000.0);
SetVehicleTyre(GetPlayerVehicleID(newvar),1);
}
return 1;
}
else if (strcmp(cmd, "!commands", true) == 0){
篇二:帝国CMS安装流程
帝国后台安装步骤:
一、获取MySQL数据库用户名和密码
由于帝国CMS的运行需要MySQL数据库的支持,因此在安装帝国CMS之前我们要先获取MySQL数据库帐号信息。
在华夏名网虚拟主机管理页面中,点击“查看数据库”,打开数据库信息查看页面:
下图是MySQL数据库信息页面,其中“数据库名”和“数据库用户名”是一样的,我们记录数据库帐号信息,以备后续使用:
二、将帝国CMS上传到虚拟主机空间
在将帝国CMS上传到虚拟主机空间之前,我们先从官网(/retype/zoom/d7f18287b9d528ea81c779b8?pn=2&x=0&y=21&raww=554&rawh=460&o=png_6_0_0_135_241_623_518_892.979_1262.879&type=pic&aimh=398.5559566787004&md5sum=9ded0a6d5f92bdfa278504bf3610c7b1&sign=4b393365bb&zoom=&png=37380-156660&jpg=0-0" target="_blank">点此查看
安装程序会自动检测运行环境,检测通过后点击“下一步”:
下一步安装程序会检测目录权限,检测通过后点击“下一步”:
来到数据库信息配置页面。输入之前获得的MySQL数据库帐号信息,如果是和其他网站系统安装到同一个数据库中,注意数据表前缀不要相同;选择是否内置初始数据,然后点击“下一步”:
设置管理员用户名和密码,建议同时设置后台登录认证码,以加强系统安全。设置完成后点击“下一步”,安装程序会完成剩下的安装:
篇三:帝国cms采集实例教程
【转】 帝国cms采集实例教程
2011-06-26 21:13
转载自 分享
最终编辑 gongfang105 采集页面地址
每个系统模型都有自己的采集,无论是内置的还是用户自定义的系统模型,新闻系统有新闻系统采集,下载系统有下载系统采集等等。
下面讲解新闻系统模型的采集,其它系统模型采集基本雷同,用户可举一反三。 本例要采集的页面地址:/retype/zoom/2f0bdefdaef8941ea76e0514?pn=1&x=0&y=98&raww=721&rawh=313&o=png_6_0_0_0_0_0_0_892.979_1262.879&type=pic&aimh=208.377253814147&md5sum=31caf04555302e12f846cd198972db4d&sign=3ce30b61e8&zoom=&png=0-13583&jpg=0-0" target="_blank">点此查看
1、登陆后台->点击大菜单“栏目管理”>“增加采集节点”;
2、“选择要增加采集的栏目”(选择终极栏目);
3、“选择要增加采集的栏目”后进入增加节点页面;
4、打开要采集的列表页面:/retype/zoom/2f0bdefdaef8941ea76e0514?pn=2&x=0&y=0&raww=721&rawh=360&o=png_6_0_0_0_0_0_0_892.979_1262.879&type=pic&aimh=239.66712898751732&md5sum=31caf04555302e12f846cd198972db4d&sign=3ce30b61e8&zoom=&png=13584-28539&jpg=0-0" target="_blank">点此查看
点击查看“源文件”
点击查看,列表页源代码为如下:
5、开始设置采集节点及列表页正则:
(1)、输入节点名称:采集实例
(2)、采集页面地址:
/retype/zoom/2f0bdefdaef8941ea76e0514?pn=3&x=0&y=628&raww=721&rawh=59&o=png_6_0_0_0_0_0_0_892.979_1262.879&type=pic&aimh=39.27877947295423&md5sum=31caf04555302e12f846cd198972db4d&sign=3ce30b61e8&zoom=&png=28540-68103&jpg=0-0" target="_blank">点此查看
/retype/zoom/2f0bdefdaef8941ea76e0514?pn=4&x=0&y=0&raww=721&rawh=381&o=png_6_0_0_0_0_0_0_892.979_1262.879&type=pic&aimh=253.64771151178917&md5sum=31caf04555302e12f846cd198972db4d&sign=3ce30b61e8&zoom=&png=68104-107993&jpg=0-0" target="_blank">点此查看
图2:得出的信息页链接正则
6、点击采集的内容页页面并查看源文件:/retype/zoom/2f0bdefdaef8941ea76e0514?pn=4&x=0&y=559&raww=704&rawh=228&o=png_6_0_0_89_815_792_256_892.979_1262.879&type=pic&aimh=155.45454545454547&md5sum=31caf04555302e12f846cd198972db4d&sign=3ce30b61e8&zoom=&png=68104-107993&jpg=0-0" target="_blank">点此查看
图2:内容页源代码
7、设置内容页内容正则:(标题及内容正则)
(1)、标题正则:由源代码内容我们得出“新闻标题”正则为: 图1:页面源代码
图2:得出的标题正则
体裁作文