e xin lệnh đồ sát không lên điểm PK. e đang làm cái BHTA Hoa Sơn. đến phần mở misson qua Long Tuyền Thôn đs ko lên pk nhưng e mở rồi qua đó đs vẫn lên pk. dù đã set time đúng theo giờ hoạt động nhưng vẫn ko được ạ
script/online/jpz_event/first_tong/[COLOR=#0000ff][B]first_tong_trigger.lua[/B][/COLOR]
e cảm ơn bác. cảm ơn bác đã giải ngố cho e 3 4 hôm nay. muốn lú với nó luôn. tiện bác có thể Hướng Dẫn e cách Set cái hiệu quả trên lên 1 Map khác được ko ạ
--Map PK--
dosat_map = [B]1[/B]; --Bật chức năng [B]1[/B] -- Tắt chức năng [B]0[/B]
-------------------------------------------------------------------------------------------------------
function EnterMap()
if dosat_map == 0 then
return
end
tao_map_pk();
if check_time() == 1 and check_place() == 1 then
SetDeathPunish(0);
Msg2Player("Từ 19: 00 đến 23: 00 Đồ sát thả ga - Không sợ bị PK.");
end;
end;
-------------------------------------------------------------------------------------------------------
function LeaveMap()
SetDeathPunish(1);
if dosat_map == 0 then
return
end
tao_map_pk();
end;
-------------------------------------------------------------------------------------------------------
function tao_map_pk()
if GetTrigger([B][COLOR=#0000ff]3024[/COLOR][/B]) == 0 then
if CreateTrigger(2,[COLOR=#0000ff][B]3024[/B][/COLOR],[B][COLOR=#0000ff]3024[/COLOR][/B]) == 0 then --3024 lối ra Map tạo trong settings/trigger/rect.txt
WriteLog(g_LogTitle.."[Account: "..GetAccount().."][Role Name:"..GetName().."] CreateTrigger(2,[COLOR=#0000ff]3024[/COLOR],[COLOR=#0000ff]3024[/COLOR]) Failed. ")
end
end;
if GetTrigger([COLOR=#0000ff][B]3025[/B][/COLOR]) == 0 then
if CreateTrigger(2,[B][COLOR=#0000ff]3025[/COLOR][/B],[B][COLOR=#0000ff]3025[/COLOR][/B]) == 0 then --3025 lối vào Map tạo trong settings/trigger/rect.txt
WriteLog(g_LogTitle.."[Account: "..GetAccount().."][Role Name:"..GetName().."] CreateTrigger(2,[COLOR=#0000ff]3025[/COLOR],[COLOR=#0000ff]3025[/COLOR]) Failed. ")
end
end;
end;
-------------------------------------------------------------------------------------------------------
function check_time()
local nHour = tonumber(date("%H"));
if nHour >= [COLOR=#0000ff][B]19[/B][/COLOR] and nHour <= [COLOR=#0000ff][B]23[/B][/COLOR] then -- từ 19 đến 23 giờ
return 1;
else
return 0;
end;
end;
-------------------------------------------------------------------------------------------------------
function check_place()
local nMapID = GetWorldPos();
if nMapID == [COLOR=#0000ff][B]404[/B][/COLOR] then -- 404 : Map Thúy yên
return 1;
else
return 0;
end;
end;
gs/script/global/playerloginin.lua --Một trong những file khi nhân vật đăng nhập vào game nó sẽ load các điều kiện kèm theo
Include("\\script\\mappk.lua") --1
function main(ExchangeComing)
......
tao_map_pk(); --2
......
end
Chủ topic có làm được qua 1 map mặc định bật Đồ Sát không chuyển luyện công đc ko bro như Long Tuyền Thôn bác làm ấy.
Mình set cho nó Đồ Sát lúc vào map nhưng gamer vẫn chuyển về luyện công đc sau 3p.
?gm ds ForbidChangePK(1)
..........
function EnterMap()
if dosat_map == 0 then
return
end
tao_map_pk();
if check_time() == 1 and check_place() == 1 then
SetDeathPunish(0);
SetPKFlag(2,1); --Bật đồ sát
ForbidChangePK(1); ---không cho thay đổi trạng thái pk
Msg2Player("Tõ 19: 00 ®Õn 23: 00 §å s¸t th¶ ga - Kh«ng sî bÞ PK.");
end;
end;
-------------------------------------------------------------------------------------------------------
function LeaveMap()
SetDeathPunish(1);
ForbidChangePK(0); --Cho thay đổi trạng thái PK
if dosat_map == 0 then
return
end
tao_map_pk();
end;
..........
Phá lệ cho bạn 1 lần vì nó thuộc vấn đề nâng cao . Bạn chú ý làm theo mình chắc chắn 99,99% thành công... Minh họa: Map Thúy Yên, thao tác trên WinSCP
Bước 1: Chép file mẫu của mình vào GS. Sau khi chép xong file nó nằm ở gs/script/mappk.lua. Thao tác trên 3 file nhưng file mappk.lua là file chính
https://www.mediafire.com/file/x39grseurdn4xbq/jx2_tao_map_pk.rar/file
Mã:--Map PK-- dosat_map = [B]1[/B]; --Bật chức năng [B]1[/B] -- Tắt chức năng [B]0[/B] ------------------------------------------------------------------------------------------------------- function EnterMap() if dosat_map == 0 then return end tao_map_pk(); if check_time() == 1 and check_place() == 1 then SetDeathPunish(0); Msg2Player("Từ 19: 00 đến 23: 00 Đồ sát thả ga - Không sợ bị PK."); end; end; ------------------------------------------------------------------------------------------------------- function LeaveMap() SetDeathPunish(1); if dosat_map == 0 then return end tao_map_pk(); end; ------------------------------------------------------------------------------------------------------- function tao_map_pk() if GetTrigger([B][COLOR=#0000ff]3024[/COLOR][/B]) == 0 then if CreateTrigger(2,[COLOR=#0000ff][B]3024[/B][/COLOR],[B][COLOR=#0000ff]3024[/COLOR][/B]) == 0 then --3024 lối ra Map tạo trong settings/trigger/rect.txt WriteLog(g_LogTitle.."[Account: "..GetAccount().."][Role Name:"..GetName().."] CreateTrigger(2,[COLOR=#0000ff]3024[/COLOR],[COLOR=#0000ff]3024[/COLOR]) Failed. ") end end; if GetTrigger([COLOR=#0000ff][B]3025[/B][/COLOR]) == 0 then if CreateTrigger(2,[B][COLOR=#0000ff]3025[/COLOR][/B],[B][COLOR=#0000ff]3025[/COLOR][/B]) == 0 then --3025 lối vào Map tạo trong settings/trigger/rect.txt WriteLog(g_LogTitle.."[Account: "..GetAccount().."][Role Name:"..GetName().."] CreateTrigger(2,[COLOR=#0000ff]3025[/COLOR],[COLOR=#0000ff]3025[/COLOR]) Failed. ") end end; end; ------------------------------------------------------------------------------------------------------- function check_time() local nHour = tonumber(date("%H")); if nHour >= [COLOR=#0000ff][B]19[/B][/COLOR] and nHour <= [COLOR=#0000ff][B]23[/B][/COLOR] then -- từ 19 đến 23 giờ return 1; else return 0; end; end; ------------------------------------------------------------------------------------------------------- function check_place() local nMapID = GetWorldPos(); if nMapID == [COLOR=#0000ff][B]404[/B][/COLOR] then -- 404 : Map Thúy yên return 1; else return 0; end; end;
chú ý: 3024, 3025 là số ID nhiệm vụ tiếp theo trong rect.txt. Bạn không được đặt trùng với ID đã có
Bước 2: Bạn vào trong gs/settings/trigger/rect.txt copy 2 dòng (như hình), sau đó Enter dòng cuối và paste vào. Sửa lại thông số như hình bên dưới, Save lại
You must be registered for see images
You must be registered for see images
Bước 3: Tạo nhiệm vụ cho nhân vật (Nhân vật phải nhận nhiệm vụ này thì mới có hiệu lực). Có rất nhiều phương án nhưng mình chọn playerloginin.lua
Mã:gs/script/global/playerloginin.lua --Một trong những file khi nhân vật đăng nhập vào game nó sẽ load các điều kiện kèm theo
Tại đây bạn sẽ thao tác 2 cái như hình
Mã:Include("\\script\\mappk.lua") --1 function main(ExchangeComing) ...... tao_map_pk(); --2 ...... end
You must be registered for see images
You must be registered for see images
Save lại. (Cần quan sát và đặt đúng vị trí .....kỹ năng...)
Bước 4: Vào game test kq
You must be registered for see images
sợ luôn... còn có cái vụ không cho đổi pk nữa hả
You must be registered for see images
Lệnh dùng nóng
Mã:?gm ds ForbidChangePK(1)
Tóm lại thêm vào như sau
Mã:.......... function EnterMap() if dosat_map == 0 then return end tao_map_pk(); if check_time() == 1 and check_place() == 1 then SetDeathPunish(0); SetPKFlag(2,1); --Bật đồ sát ForbidChangePK(1); ---không cho thay đổi trạng thái pk Msg2Player("Tõ 19: 00 ®Õn 23: 00 §å s¸t th¶ ga - Kh«ng sî bÞ PK."); end; end; ------------------------------------------------------------------------------------------------------- function LeaveMap() SetDeathPunish(1); ForbidChangePK(0); --Cho thay đổi trạng thái PK if dosat_map == 0 then return end tao_map_pk(); end; ..........
3001 3 106 \script\online\jpz_event\first_tong\first_tong_trigger.lua LeaveMap
3002 0 106 \script\online\jpz_event\first_tong\first_tong_trigger.lua EnterMap
3003 3 404 \script\\mappk.lua LeaveMap
3004 0 404 \script\\mappk.lua EnterMap
--Map PK--dosat_map = 1; --BËt chøc n¨ng 1 -- T¾t chøc n¨ng 0
-------------------------------------------------------------------------------------------------------
function EnterMap()
Msg2Player("1111111111111111")
if dosat_map == 0 then
return
end
tao_map_pk();
if check_time() == 1 and check_place() == 1 then
SetDeathPunish(0);
SetPKFlag(2,1); --B?t d? sát
ForbidChangePK(1); ---không cho thay d?i tr?ng thái pk
Msg2Player("Tõ 19: 00 ®Õn 23: 00 §å s¸t th¶ ga - Kh«ng sî bÞ PK.");
end;
end;
-------------------------------------------------------------------------------------------------------
function LeaveMap()
Msg2Player("22222222222")
SetDeathPunish(1);
ForbidChangePK(0); --Cho thay d?i tr?ng thái PK
if dosat_map == 0 then
return
end
tao_map_pk();
end;
-------------------------------------------------------------------------------------------------------
function tao_map_pk()
Msg2Player("hello")
if GetTrigger(3003) == 0 then
if CreateTrigger(2,3024,3024) == 0 then --3024 lèi ra Map t¹o trong settings/trigger/rect.txt
WriteLog(g_LogTitle.."[Account: "..GetAccount().."][Role Name:"..GetName().."] CreateTrigger(2,3024,3024) Failed. ")
end
end;
if GetTrigger(3004) == 0 then
if CreateTrigger(2,3025,3025) == 0 then --3025 lèi vµo Map t¹o trong settings/trigger/rect.txt
WriteLog(g_LogTitle.."[Account: "..GetAccount().."][Role Name:"..GetName().."] CreateTrigger(2,3025,3025) Failed. ")
end
end;
end;
-------------------------------------------------------------------------------------------------------
function check_time()
local nHour = tonumber(date("%H"));
if nHour >= 19 and nHour <= 23 then -- Tõ 19 ®Õn 23 giê
return 1;
else
return 0;
end;
end;
-------------------------------------------------------------------------------------------------------
function check_place()
local nMapID = GetWorldPos();
if nMapID == 404 then -- 404 : Thóy Yªn
return 1;
else
return 0;
end;
end;
function main(ExchangeComing) local nPlayerRoute = GetPlayerRoute();
--NOTE: it MUST be the 1st one calling for resetting things by SunZhuoshi
--< Added by SunZhuoshi
DR_OnPlayerLogin();
PLT_OnPlayerLogin();
local nNation =GetGlbValue(GLB_TSK_SERVER_ID)
Msg2Player("SV ID: "..nNation)
--PLC_OnPlayerLogin();
-->
-- SB_OnPlayerLogin();
FG_OnPlayerLogin();
-->
-- if IsPlayerDeath() == 1 then
-- CastState("state_physical_parmor_poi_add", 25, 7760000);
-- CastState("state_magic_parmor_poi_add", 25, 7760000);
-- else
-- CastState("state_physical_parmor_poi_add", 25, 7760000);
-- CastState("state_magic_parmor_poi_add", 25, 7760000);
-- end
tao_map_pk();
[COLOR=#333333][I]3003 3 404 \script[/I][/COLOR][B][COLOR=#ff0000][I]\\[/I][/COLOR][/B][COLOR=#333333][I]mappk.lua LeaveMap[/I][/COLOR]
[COLOR=#333333][I]3004 0 404 \script[/I][/COLOR][B][COLOR=#ff0000][I]\\[/I][/COLOR][/B][COLOR=#333333][I]mappk.lua EnterMap[/I][/COLOR]