Jump to content

مساعده


Recommended Posts

Posted

هلا شباب كيفكم انشاء الله بخير

كنت ابي حد يساعدني في سكريبت يخلي لو شخص كتب كلمه مثلا زي

هلا 

تتكتب في المين شات ب اسم تاني يعني 

لما الاعب يكتب هلا في الشات 

يتنكت هاي

بدي اسويها في عدم نشر 

و مشكورين

Posted
16 minutes ago, Hakan said:

string.gsub

ممكن تعطيني مثال ؟ شفت الامثله الي موجوده علي الويكي كلها و ما فهمت منها شيئ

Posted
13 minutes ago, jakson said:

ممكن تعطيني مثال ؟ شفت الامثله الي موجوده علي الويكي كلها و ما فهمت منها شيئ

addEventHandler('onPlayerChat',root,
function ( Msg )
    if Msg == "هلا" then
    cancelEvent()
    outputChatBox(" *#ff0000[Security]: عذراً , لا يمكنك كتابة هذه الكلمة !!", source , 0 , 0 , 255 , true)
    end
end
)

 

Posted
18 minutes ago, #x8a[H]eRhm<3 said:

addEventHandler('onPlayerChat',root,
function ( Msg )
    if Msg == "هلا" then
    cancelEvent()
    outputChatBox(" *#ff0000[Security]: عذراً , لا يمكنك كتابة هذه الكلمة !!", source , 0 , 0 , 255 , true)
    end
end
)

 

مشكور اخلي علي محاولتك لمساعدتي لاكن ما قصدي علي هذا الشيئ هذا امرها سهل

 لاكن انا ابي اذا الشخص كتب هلا مثلا

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

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

فهمت علي؟

 

Posted
addEventHandler('onPlayerChat',root,
function ( Msg )
    if Msg == "هلا" then
    cancelEvent()
    outputChatBox(""..getPlayerName(source).." #ffffff : #ff0000 هاي", root , 0 , 0 , 255 , true)
    end
end
)

هاذي لما يكتب هلا , يجي اسمه للكل مثلاً

لو أنت كتبت هلا بتجي

jackson: هاي

Posted
15 minutes ago, #x8a[H]eRhm<3 said:

 

رجاءا اعد قراءة طلبه :D

.

34 minutes ago, jakson said:

ممكن تعطيني مثال ؟ شفت الامثله الي موجوده علي الويكي كلها و ما فهمت منها شيئ

وظيفتها إستبدال نص بنص اللي تبيه أو على حسب النمط الموظف فيها. بالعديد الى إستخدمات كثيرة ومتقدمة . مثال

text = "My name is Nono"

string.gsub(text, "Nono", "Nini") 
-- or
text:gsub(text, "Nono", "Nini")

--> My name is Nini

. اذا وصلت الفكرة حاول تسويه ماهو صعب فقط يبحث عن الكلمة ويستبدلها

 

Posted
1 minute ago, #BrosS said:

رجاءا اعد قراءة طلبه :D

.

وظيفتها إستبدال نص بنص اللي تبيه أو على حسب النمط الموظف فيها. بالعديد الى إستخدمات كثيرة ومتقدمة . مثال


text = "My name is Nono"

string.gsub(text, "Nono", "Nini") 
-- or
text:gsub(text, "Nono", "Nini")

--> My name is Nini

. اذا وصلت الفكرة حاول تسويه ماهو صعب فقط يبحث عن الكلمة ويستبدلها

 

مشكور على تفهمك, حسب ما فهمت يبي يقلد مود حق وزارة إذا نشرت بتجي

****

=\ وحبيت اساعدهه ..

 

Posted
1 minute ago, #x8a[H]eRhm<3 said:

مشكور على تفهمك, حسب ما فهمت يبي يقلد مود حق وزارة إذا نشرت بتجي

****

=\ وحبيت اساعدهه ..

 

string.find نعم وكودك ناقص هذا فقط اذا الرسالة كانت سب يعني اذا كتب معها شي ثاني ماتشتغل لازم

Posted (edited)
local words={
  	--[[
  		word1 = الكلمه
  		replace1 = البديل
  	]]--
	["word1"]="replace1",
  	["word2"]="replace2",
};


addEventHandler("onPlayerChat",root,
	function(Message)
		for word, replaces in pairs(words) do
			if Message:gsub("#%x%x%x%x%x%x",""):find(word) then
				cancelEvent();
				outputChatBox(getPlayerName(source).." : "..Message:gsub(word," ")..replaces,root,255,255,255,true);
			end
		end
	end
end

 

Edited by NX_CI
Posted
42 minutes ago, NX_CI said:

local words={
  	--[[
  		word1 = الكلمه
  		replace1 = البديل
  	]]--
	["word1"]="replace1",
  	["word2"]="replace2",
};


addEventHandler("onPlayerChat",root,
	function(Message)
		for word, replaces in pairs(words) do
			if Message:gsub("#%x%x%x%x%x%x",""):find(word) then
				cancelEvent();
				outputChatBox(getPlayerName(source).." : "..Message:gsub(word," ")..replaces,root,255,255,255,true);
			end
		end
	end
end


 

الي مسويه خطأ

اول خطأ هو انك حطيت ال cancelEvent في اللوب

ثاني شي حاط ال outputChatBox في اللوب

و عندك اخطاء في  السطر 16

و في اند زيادة و قوس ناقص

Posted
2 minutes ago, #,xiRocKyz said:

الي مسويه خطأ

اول خطأ هو انك حطيت ال cancelEvent في اللوب

ثاني شي حاط ال outputChatBox في اللوب

و عندك اخطاء في  السطر 16

و في اند زيادة و قوس ناقص

ليه ماعدلت عليه طيب

local words={
  	--[[
  		word1 = الكلمه
  		replace1 = البديل
  	]]--
	["word1"]="replace1",
  	["word2"]="replace2",
};


addEventHandler("onPlayerChat",root,
	function(Message)
		for word, replaces in pairs(words) do
			if Message:gsub("#%x%x%x%x%x%x",""):find(word) then
				cancelEvent();
				outputChatBox(getPlayerName(source).." : "..Message:gsub(word," ")..replaces,root,255,255,255,true);
        		break
			end
		end
	end
)

 

Posted
3 minutes ago, NX_CI said:

ليه ماعدلت عليه طيب


local words={
  	--[[
  		word1 = الكلمه
  		replace1 = البديل
  	]]--
	["word1"]="replace1",
  	["word2"]="replace2",
};


addEventHandler("onPlayerChat",root,
	function(Message)
		for word, replaces in pairs(words) do
			if Message:gsub("#%x%x%x%x%x%x",""):find(word) then
				cancelEvent();
				outputChatBox(getPlayerName(source).." : "..Message:gsub(word," ")..replaces,root,255,255,255,true);
        		break
			end
		end
	end
)

 

للحين عندك اخطاء ..

  • N3xT locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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