PDA

View Full Version : [JX] Cách cộng điểm tiềm năng trực tiếp vào nhân vật



Anh2SiTinh
23-06-19, 10:36 AM
Mấy bác cho mình hỏi cách cộng điểm tiềm năng trực tiếp vào nhân vật với.
Lâu quá không đụng tới jx giờ quên gần hết :((

trilap2004
23-06-19, 10:58 AM
Mấy bác cho mình hỏi cách cộng điểm tiềm năng trực tiếp vào nhân vật với.
Lâu quá không đụng tới jx giờ quên gần hết :((

Thêm câu đối thoại ở 1 con NPC nào đó, liên kết với function add_prop. Cấu trúc function:

function add_prop()
local tbOpt =
{
{"T¨ng søc m¹nh.", add_prop_str},
{"T¨ng th©n ph¸p.", add_prop_dex},
{"T¨ng sinh khÝ.", add_prop_vit},
{"T¨ng néi c«ng.", add_prop_eng},
{"Tho¸t."}
}
CreateNewSayEx("<npc>Xin mêi chän ti?m n¨ng cÇn t¨ng!", tbOpt)
end

function add_prop_str()
AskClientForNumber("enter_str_num", 0, GetProp(), "Mêi nhËp chØ sè søc m¹nh: ");
end
function add_prop_dex()
AskClientForNumber("enter_dex_num", 0, GetProp(), "Mêi nhËp chØ sè th©n ph¸p: ");
end
function add_prop_vit()
AskClientForNumber("enter_vit_num", 0, GetProp(), "Mêi nhËp chØ sè sinh kh?:");
end
function add_prop_eng()
AskClientForNumber("enter_eng_num", 0, GetProp(), "Mêi nhËp chØ sè néi c«ng: ");
end

function enter_str_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddStrg(n_key);
end
function enter_dex_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddDex(n_key);
end
function enter_vit_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddVit(n_key);
end
function enter_eng_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddEng(n_key);
end

Nguồn: thu thập của các pro dev..

Anh2SiTinh
23-06-19, 11:53 AM
Thêm câu đối thoại ở 1 con NPC nào đó, liên kết với function add_prop. Cấu trúc function:

function add_prop()
local tbOpt =
{
{"T¨ng søc m¹nh.", add_prop_str},
{"T¨ng th©n ph¸p.", add_prop_dex},
{"T¨ng sinh khÝ.", add_prop_vit},
{"T¨ng néi c«ng.", add_prop_eng},
{"Tho¸t."}
}
CreateNewSayEx("<npc>Xin mêi chän ti?m n¨ng cÇn t¨ng!", tbOpt)
end

function add_prop_str()
AskClientForNumber("enter_str_num", 0, GetProp(), "Mêi nhËp chØ sè søc m¹nh: ");
end
function add_prop_dex()
AskClientForNumber("enter_dex_num", 0, GetProp(), "Mêi nhËp chØ sè th©n ph¸p: ");
end
function add_prop_vit()
AskClientForNumber("enter_vit_num", 0, GetProp(), "Mêi nhËp chØ sè sinh kh?:");
end
function add_prop_eng()
AskClientForNumber("enter_eng_num", 0, GetProp(), "Mêi nhËp chØ sè néi c«ng: ");
end

function enter_str_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddStrg(n_key);
end
function enter_dex_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddDex(n_key);
end
function enter_vit_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddVit(n_key);
end
function enter_eng_num(n_key)
if (n_key < 0 or n_key > GetProp()) then
return
end
AddEng(n_key);
end

Nguồn: thu thập của các pro dev..


Thanks Bro nhiều ...............................................