Jump to content

خطأ


Recommended Posts

Posted

السلام عليكم

عاوز الكود ده يظهر للسيرفر كله

لانه يظهر فقط للي يضغط علي البطن

outputChatBox('[C.Console]: Chat has been enabled by ' ..getPlayerName(localPlayer),255, 255, 0, true ) 

Posted

outputChatBox ( "[C.Console]: Chat has been enabled by ".. getPlayerName ( localPlayer ) .."", root, 255, 255, 0, true ) 
Posted

outputChatBox("#ffff00[C.Console]: Chat has been enabled "..getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", "").." ", 255, 0, 0, true) 
Posted
outputChatBox("#ffff00[C.Console]: Chat has been enabled "..getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", "").." ", 255, 0, 0, true) 

ده يظهر للسيرفر كلو ؟

Posted
function  gui () 
  
if sourrce == btn then  
  
local Nameplayer = getPlayerName(localPlayer) 
  
outputChatBox ( "[C.Console]: Chat has been enabled by "..Nameplayer.."", root, 255, 255, 0, true ) 
  
  
  
  
end 
  
  
  
  
end 
addEventHandler("onClientGUIClick",root,gui) 

Posted

كلنت

addEventHandler("onClientGUIClick",button,function() 
triggerServerEvent("send;All",localPlayer) 
end, false) 

سيرفر

addEvent("send;All",true) 
addEventHandler("send;All",root,function()  
outputChatBox('[C.Console]: Chat has been enabled by ' ..getPlayerName(source),root,255, 255, 0, true ) 
end) 
Posted
كلنت

addEventHandler("onClientGUIClick",button,function() 
triggerServerEvent("send;All",localPlayer) 
end, false) 

سيرفر

addEvent("send;All",true) 
addEventHandler("send;All",root,function()  
outputChatBox('[C.Console]: Chat has been enabled by ' ..getPlayerName(source),root,255, 255, 0, true ) 
end) 

ما اشتغل

كلنت

  
addEventHandler("onClientGUIClick",GUIEditor.button[1],function() 
triggerServerEvent("openChat",localPlayer) 
end, false) 
  
  
  
  
  
addEventHandler("onClientGUIClick",GUIEditor.button[2],function() 
triggerServerEvent("LoockChat",localPlayer) 
end, false) 
  
  
  
  
addEventHandler("onClientGUIClick",GUIEditor.button[4],function() 
triggerServerEvent("LoockLocal",localPlayer) 
end, false) 
  
  
  
  
  
addEventHandler("onClientGUIClick",GUIEditor.button[3],function() 
triggerServerEvent("openLocal",localPlayer) 
end, false) 
  

سيرفر

  
addEvent("openChat",true) 
addEventHandler("openChat",root,function() 
outputChatBox('[C.Console]: Chat has been enabled by ' ..getPlayerName(source),root,255, 255, 0, true ) 
end) 
  
  
  
  
addEvent("LockChat",true) 
addEventHandler("LockChat",root,function() 
outputChatBox('[C.Console]: Chat has been Locked by ' ..getPlayerName(source),root,255, 0, 0, true ) 
end) 
  
  
  
addEvent("openLocal",true) 
addEventHandler("openLocal",root,function() 
outputChatBox('[C.Console]: LocalChat has been enabled by ' ..getPlayerName(source),root,255, 255, 0, true ) 
end) 
  
  
  
  
addEvent("LoockLocal",true) 
addEventHandler("LoockLocal",root,function() 
outputChatBox('[C.Console]: LocalChat has been Locked by ' ..getPlayerName(source),root,255, 0, 0, true ) 
end) 

Posted

جرب

GUIEditor = {button = {},window = {}} 
GUIEditor.window[1] = guiCreateWindow(0.35, 0.35, 0.26, 0.19, "", true) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.button[1] = guiCreateButton(0.04, 0.19, 0.44, 0.34, "open chat", true, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(0.04, 0.56, 0.44, 0.34, "close chat", true, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(0.52, 0.19, 0.44, 0.34, "open Local chat", true, GUIEditor.window[1]) 
GUIEditor.button[4] = guiCreateButton(0.52, 0.56, 0.44, 0.34, "close Local chat", true, GUIEditor.window[1]) 
------- 
function Msg(Msg) 
triggerServerEvent("send;All",localPlayer,Msg) 
end 
addEventHandler("onClientGUIClick",root,function() 
if ( source == GUIEditor.button[1] ) then 
Msg('[C.Console]: Chat has been enabled by') 
elseif ( source == GUIEditor.button[2] ) then 
Msg('[C.Console]: Chat has been Locked by') 
elseif ( source == GUIEditor.button[3] ) then 
Msg('[C.Console]: LocalChat has been enabled by') 
elseif ( source == GUIEditor.button[4] ) then 
Msg('[C.Console]: LocalChat has been Locked by') 
end 
end) 

addEvent("send;All",true) 
addEventHandler("send;All",root,function(Msg)  
outputChatBox(Msg ..' ' ..getPlayerName(source),root,255, 255, 0, true ) 
end) 
Posted

تمام اخي

شكرا

دلوقتي

عاوز كود لما العب يكون في تيم يقدر يتكلم من غ

و لو مش في تيم ما يقدر يتكلم

و الكلام ما حد يقدر يشوفو غير الي في التيم

Posted
تمام اخي

شكرا

دلوقتي

عاوز كود لما العب يكون في تيم يقدر يتكلم من غ

و لو مش في تيم ما يقدر يتكلم

و الكلام ما حد يقدر يشوفو غير الي في التيم

طلبك ذا موجود اساسا باللعبة

جرب سوي تيم من لوحة الأدمنية وضيف نفسك فيه وبتقدر تتكلم من حرف غ

getPlayersInTeam 

الفانكشن ذا ماله اي علاقه بطلبه

Posted

كور كلامك صحيح

بس لما اضيف نفسي في تيم من لوحة الادمن و اجي اتكلم الكلام يجي

في الشات العام ما يجي كده مثلا

(Team)SaedAmer: كور

Posted (edited)

هذا مثال سويته لك تعلم منه

انا سويت تيم من اللوحه وسميته بإسمي

CoR's Team

وعملت تحقق إذا كان اللاعب موجود داخل تيمي

وإذا كان يتكلم داخل شات التيمات

يكتب له اسم تيمي قبل كلامة

-- MTA Forum / Ar -- 
-- Mr.CoR -- 
-- 24 / 5 / 2016 -- 
  
function isPlayerInTeam(player, team) 
    assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") 
    assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") 
    return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) 
end 
  
  
addEventHandler( "onPlayerChat",root, 
    function (message,messageType)  
        if messageType == 2 then 
            if isPlayerInTeam ( source , "CoR's Team" ) then 
              outputChatBox ( "#ffff00( CoR'sTeam ) " .. getPlayerName( source ).. " : " ..message.." " ,root, 255, 255, 255, true ) 
            end 
        end 
    end 
) 
bindKey ( player ,"y", "down") 

طبعاً إستخدمت يوزفل فانكشن الي هو

isPlayerInTeam 

صفحة الفانكشن

https://wiki.multitheftauto.com/wiki/IsPlayerInTeam

وفي مشكلة واجهتني في الـ

bindKey 

ماضبط معي تحديد اللاعب , ياليت الي عنده خبره اوسع من خبرتي يحل المشكلة

Edited by Guest
Posted

ابي اسوي له بند كي على شان مابيه يختلط مع الزر الأساسي حق شات التيمات

لان شوف الحين لو جربت الكود وكتبت من حرف

y

رح يتكرر كلامك مرتين

المره الاولى فيه اسمك واسم تيمك

والمره الثانيه يكون كذا

( TEAM ) -- وهذي من اللعبه الأساسية

Posted

addEventHandler( "onPlayerChat",root,function (message,messageType) 
if  messageType == 2  then  
local PTeam = getPlayerTeam(source) 
local PName = getPlayerName( source ):gsub ( '#%x%x%x%x%x%x', '' ) 
if PName then 
local r,g,b = getTeamColor(PTeam) 
local TeamColor = string.format("#%.2X%.2X%.2X",r,g,b) 
local TeamName = getTeamName(PTeam) 
outputChatBox ( "#ffff00( CoR'sTeam ) "..TeamColor.." "..TeamName.." " ..PName.. " : " ..message.." " ,root, 255, 255, 255, true ) 
cancelEvent() 
end 
end 
end) 
Posted

انا مش فاهم شئ :arrowup::arrowup:

--------------------

انا عاوز كود الي في التيم

يقدر يتكلم من غ

و الي مش في التيم

الرسالة بتاعتو ما تترسل

Posted

مساعده

---------------

دلوقتي في العبة الاساسية

لما اضيف نفسي في تيم

و اجي اتكلم

الكلام مش بيظهر للتيم

بيظهر في العام

انا عاوز اخليه يظهر في التيم

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...