1.Название команды- /ban, /mute, /msg
2.Описание команды- /ban - забанить игрока, /mute - поставить затычку, /msg - общий чат.
Последний раз редактировалось L0ndl3m; 12.12.2013 в 20:27.
Accord (12.12.2013)
1.Название команды- /Gethere
2.Название команды- /goto
обычный
PHP код:
else if(strcmp(cmd, "/goto", true) == 0)
{
tmp = strcharsplit(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdm] >= 2) return SendClientMessage(playerid, COLOR_WHITE, " Введите: /g(oto) [id игрока]");
new Float:plocx,Float:plocy,Float:plocz;
new plo = ReturnUser(tmp);
if (!IsPlayerConnected(plo)) return SendClientMessage(playerid, COLOR_GREY, "[Ошибка] Игрок не найден!");
{
if(plo != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmInections] >= 2)
{
if(specid != INVALID_PLAYER_ID) specid = 256;
if(GetPlayerState(plo) != 1 && GetPlayerState(plo) != 2 && GetPlayerState(plo) != 3) return SendClientMessage(playerid, COLOR_GRAD1, "Игрок не вступил в игру!");
if(GetPlayerState(plo) == PLAYER_STATE_SPECTATING && gSpectateID[plo] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Админ в режиме наблюдения");
GetPlayerPos(plo, plocx, plocy, plocz);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehicleEE(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPPos(playerid,plocx,plocy+2, plocz);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(plo));
SetPlayerInterior(playerid, GetPlayerInterior(plo));
PlayerInfo[playerid][pInt] = GetPlayerInterior(plo);
}
SendClientMessage(playerid, COLOR_WHITE, "Вы были телепортированы!");
}
else { SendClientMessage(playerid, COLOR_GRAD1, "Вы не уполномочены использовать эту команду!"); }
}
}
return true;
}
//-----------------------------------------------------------------------
else if(strcmp(cmd, "/gethere", true) == 0)
{
tmp = strcharsplit(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdm] >= 2) return SendClientMessage(playerid, COLOR_WHITE, " Введите: /gethere [id игрока]");
new Float:plocx,Float:plocy,Float:plocz;
new inter = GetPlayerInterior(playerid);
new worldd = GetPlayerVirtualWorld(playerid);
new plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdm] >= 2)
{
if(GetPlayerState(plo) != 1 && GetPlayerState(plo) != 2 && GetPlayerState(plo) != 3) return SendClientMessage(playerid, COLOR_GRAD1, "Игрок не вступил в игру!");
if(PlayerInfo[playerid][pAdm] < PlayerInfo[plo][pAdm])
{
SendClientMessage(playerid,COLOR_GREY,"Нельзя телепортиповать администратора, который старше вас!");
return true;
}
GetPlayerPos(playerid, plocx, plocy, plocz);
if(PlayerInfo[playerid][pInt] > 0)
{
TeleportTime[plo] = 5;
SetPlayerInterior(plo,inter);
PlayerInfo[plo][pInt] = inter;
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
SetPlayerVirtualWorld(plo,worldd);
}
if(PlayerInfo[playerid][pInt] == 0)
{
TeleportTime[plo] = 5;
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
SetPlayerInterior(plo,inter);
SetPlayerVirtualWorld(plo,worldd);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0)
{
TeleportTime[plo] = 5;
SetPlayerInterior(plo,inter);
PlayerInfo[plo][pInt] = inter;
}
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
TeleportTime[plo] = 5;
SetPlayerInterior(plo,inter);
new tmpcar = GetPlayerVehicleID(plo);
SetPlayerVirtualWorld(plo,worldd);
SetVehicleEE(tmpcar, plocx, plocy+4, plocz);
}
else
{
TeleportTime[plo] = 5;
SetPPos(plo,plocx,plocy+2, plocz);
SetPlayerInterior(plo,inter);
SetPlayerVirtualWorld(plo,worldd);
}
SendClientMessage(plo, COLOR_WHITE, "Вы были телепортированы администратором сервера.");
}
else { return true; }
}
}
else { SendClientMessage(playerid, COLOR_GREY, "[Ошибка] Игрок не найден!"); }
return true;
}
для new pwn
1) /cmd или другая
2) писать за других игроков в любые чаты
доступ только для админов
пример: /cmd id /s ololol
буду очень признателен
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128],params[128];
sscanf(cmdtext,"s[128]s[128]",cmd,params);
if(!strcmp(cmd,"/cmd"))
{
if(!PlayerInfo[playerid][pAdmin]) return 1;
new id, cmd[50];
if(sscanf(params,"ds[50]",id,cmd)) return SendClientMessage(playerid, -1, "/cmd [id][команда]");
if(IsPlayerConnected(id)) return OnPlayerCommandText(playerid, cmd);
else return SendClientMessage(playerid, 0xA9A9A9AA, "Игрок не найден!");
}
return 0;
}
Мои работы и публикации:
КотВаська (23.07.2014)
Эту тему просматривают: 3 (пользователей: 0 , гостей: 3)