Albert_Stelmach
Умник
Так называемый "Телевизор" [BETA]
Подходит для RSL и Samp-Rp модов
Ищем строки, там где показывает "Мои Команды":
В начало:
После них добавляем
Идём в OnPlayerCommandText
Ищем команду "/int"
После этой команды мне лично удобно вставлять свои. Хотя не важно после какой, главное НЕ В НАЧАЛО
Вставляем:
В OnPlayerText:
Идея зародилась, когда на своём сервере создавал Blast TV вместо LV NEWS
> Update Май 2013
Дополнение:
ProхDetector:
Подходит для RSL и Samp-Rp модов
Ищем строки, там где показывает "Мои Команды":
PHP:
else if (PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
PHP:
new gTV[MAX_PLAYERS];
new gProxTV[MAX_PLAYERS];
PHP:
SendClientMessage(playerid, COLOR_YELLOW2, "channel - Запустить передачу по TV (с 2-го ранга). /seetv - Смотреть передачу (для всех)");
Ищем команду "/int"
После этой команды мне лично удобно вставлять свои. Хотя не важно после какой, главное НЕ В НАЧАЛО
Вставляем:
PHP:
else if(strcmp(cmd, "/channel", true) == 0)
{
if(PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pRank] >= 2)
{
SendClientMessage(playerid, COLOR_OOC, "Вы начали телепередачу. Место размещения камеры: LS NEWS");
SendClientMessageToAll(COLOR_NEWS, "LS NEWS: Началась передача! (( /seetv ))");
SendFamilyMessage(9, COLOR_NEWS, "У офиса LS NEWS начинается телепередача!");
SetPlayerPos(playerid, 1737.80, -1633, 20.22);
gTv[playerid] = 1;
}
}
else if(strcmp(Cmd, "/unchannel", true) == 0)
{
SpawnPlayer(playerid);
gTv[playerid] = 0;
}
else if(strcmp(cmd, "/seetv", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
SetPlayerCameraPos(playerid, 1724, -1631, 20.21);
SetPlayerCameraLookAt(playerid, 1737.80, -1633, 20.22);
SendClientMessage(playerid, COLOR_OOC, "Чтобы выключить телевизор, введите /offtv");
SetPlayerChatBubble(playerid, "достаёт КПК и запускает МиниТелевизор",COLOR_PURPLE,30.0,10000);
gProxTV[playerid] = 1;
}
else { SendClientMessage(playerid, COLOR_RED, "Вы не в транспорте!") }
else if(strcmp(cmd, "/offtv", true) == 0)
{
SetCameraBehindPlayer(playerid);
SetPlayerChatBubble(playerid, "отключает МиниТелевизор",COLOR_PURPLE,30.0,10000);
gProxTV[playerid] = 0;
}
PHP:
if(gTv[playerid] == 1)
{
for(new f; f < GetMaxPlayers(); f++)
{
if(gProxTV[f] == 1) continue;
new string[70];
format(string, 70, "%s: %s", sendername(playerid), text);
SendClientMessage(f, COLOR_GREEN, string);
}
}
> Update Май 2013
Дополнение:
ProхDetector:
PHP:
stock ProxDetector(Float:radi, playerid, str[],col1,col2,col3,col4,col5)
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i) || PlayerLogged[i] == 0) continue;
if(!BigEar[i])
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) SendClientMessage(i, col1, str);
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SendClientMessage(i, col2, str);
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SendClientMessage(i, col3, str);
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SendClientMessage(i, col4, str);
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SendClientMessage(i, col5, str);
}
else SendClientMessage(i, col1, str);
}
return true;
}
Последнее редактирование:
