addEvent("aPlayer",true)
addEventHandler("aPlayer",root,
function(player,action,data)
if action == "setteam" then
if getElementType(data) == "team" then
outputChatBox(getPlayerName(player).." has been moved to the "..getTeamName(data).." team.",root,255,255,0)
end
end
end
)
changeGridListItemToPlayersName = function ( GridList, Column )
if GridList and Column then -- Check Parematers
if getElementType ( GridList ) == "gui-gridlist" then -- Check The Type of ' GridList '
if guiGridListClear ( GridList ) then -- Clear GridList
for i, v in next, getElementsByType ( "player" ) do -- Get Everything by Type ' player '
local Row = guiGridListAddRow ( GridList ) -- Add Row
guiGridListSetItemText ( GridList, Row, Column, string.gsub ( getPlayerName ( v ), "#%x%x%x%x%x%x", "" ), false, false ); -- Set New Values
end; -- end of ' for '
end; -- end of ' clear gridlist '
end; -- end of ' check gridlist type '
end; -- end of ' check parematers
end; -- end of ' function '
جرب كذا
addCommandHandler("killz",
function(player)
for _,ped in ipairs(getElementsByType("ped")) do
if isPedZombie(ped) then
killPed(ped,player,26,1)
end
end
end
)
الكود هذا شغال ؟
addCommandHandler("killz",
function()
for k,v in ipairs (getElementsByType('ped')) do
if isPedZombie(v) then
killPed(v,source,26,1)
end
end
end
)
اذا شغال قول وش ناقصه
addCommandHandler("example",
function(player,command,...)
message = table.concat({...}," ")
if string.find(message,"example") then
outputChatBox(message,player,0,255,0)
else
outputChatBox("There is no example",player,255,0,0)
end
end
)
انت سو الاشياء اللي تعرفها واللي ماتعرفها قولها واحنا نساعدك فيها
يعني معقوله ماتعرف ولا وظيفة من الوظائف اللي راح تستخدمها لعمل المود
ومعقوله احد يعطيك كل الوظائف ويعرف انك ماتعرف تستخدمها وفي الاخير ينصدم
إن تعبه راح باطل لذلك انت سو اللي تقدر عليه واللي ماتقدر عليه اطرحه ونساعدك إن شاء الله
عمل رائع
ولاكن يوجد بعض الاخطاء في ترتيب كود الوظيفة
الترتيب مايهم ياخوي , ليش كلكم مهتمين بالترتيب ,
الترتيب مجرد شكل لا غير , فهو غير مهم ,
هذا الي فهمته من كلامك كانك تقصد شيء ثاني مدري عنك ,
لا ما اقصد شي ثاني
والبنسبة لترتيب فهو مهم جدا
ومن اهميته يساعدنا على قراءة الكود وفهمه بشكل افضل واسرع
مثال على إدخال البيانات للجدول بالطريقه اللي انت تبيها
example = {}
addCommandHandler("example",
function(player)
if example[getPlayerSerial(player)] and example[getPlayerSerial(player)] == true then
outputChatBox("example: true",player,255,255,0)
else
example[getPlayerSerial(player)] = true
end
end
)