Jump to content

مساعدة


Recommended Posts

شباب بدي لما أكتب /join 

و انا في ديموشن 1 يكتبلي You are already in the event

function onEventStart ( res )
	outputChatBox ( "#FB00FF• Team Deathmatch #ffffffevent started. Type ''#FB00FF/join#ffffff'' #ffffffto join this event", getRootElement(), 255, 255, 255, true)
end
addEventHandler ( "onResourceStart", getRootElement(), onEventStart )

function changedimension ( source )
            setElementDimension ( source, 1 )            -- set his dimension to 1
			setElementPosition ( source, 260.8466796875, 1851.8400878906, 8.7578125 )
	outputChatBox ( "#FB00FF• You have been joined the event", getRootElement(), 255, 255, 255, true) 
	      return
	  end 
		  if getElementDimension ( source ) == 1 then
		  outputChatBox ( "#FB00FF• You are already in the event", getRootElement(), 255, 255, 255, true)
end
addCommandHandler ( "join", changedimension )

function changedimension ( source )
            setElementDimension ( source, 0 )            -- set his dimension to 1
			setElementPosition ( source, 354.04452514648, 2532.6301269531, 16.720027923584 )
	outputChatBox ( "#FB00FF• You have been left the event", getRootElement(), 255, 255, 255, true)
			end
addCommandHandler ( "leave", changedimension )

 

Link to comment
function onEventStart ( res )
	outputChatBox ( "#FB00FF• Team Deathmatch #ffffffevent started. Type ''#FB00FF/join#ffffff'' #ffffffto join this event", getRootElement(), 255, 255, 255, true)
end
addEventHandler ( "onResourceStart", getRootElement(), onEventStart )

function changedimension ( source )
	if getElementDimension ( source ) == 1 then return outputChatBox ( "#FB00FF• You are already in the event", getRootElement(), 255, 255, 255, true);end		  
            setElementDimension ( source, 1 )            -- set his dimension to 1
			setElementPosition ( source, 260.8466796875, 1851.8400878906, 8.7578125 )
			outputChatBox ( "#FB00FF• You have been joined the event", getRootElement(), 255, 255, 255, true) 
	   return
    end 
addCommandHandler ( "join", changedimension )

function changedimension ( source )
            setElementDimension ( source, 0 )            -- set his dimension to 1
			setElementPosition ( source, 354.04452514648, 2532.6301269531, 16.720027923584 )
			outputChatBox ( "#FB00FF• You have been left the event", getRootElement(), 255, 255, 255, true)
			end
addCommandHandler ( "leave", changedimension )

 

  • Thanks 1
Link to comment

أخي بدي لما اكتب /join

بدخل في تيم 

function gimmeATeam(source, commandName, teamName)
    local newTeam = createTeam(teamName) -- create a new team with the specified name
    if newTeam then -- if it was successfully created
        setPlayerTeam(source, newTeam) -- add the player to the new team
    end
end
addCommandHandler("join", gimmeATeam)

بس مو شغال 

debug: WARNING: event/server.lua:27: Bad argument @'createTeam'[Expected string at argument 1, got nil ]

 

Link to comment
6 minutes ago, Snakegold said:

أخي بدي لما اكتب /join

بدخل في تيم 


function gimmeATeam(source, commandName, teamName)
    local newTeam = createTeam(teamName) -- create a new team with the specified name
    if newTeam then -- if it was successfully created
        setPlayerTeam(source, newTeam) -- add the player to the new team
    end
end
addCommandHandler("join", gimmeATeam)

بس مو شغال 

debug: WARNING: event/server.lua:27: Bad argument @'createTeam'[Expected string at argument 1, got nil ]

 

 

جرب ذا

function gimmeATeam(source)
local newTeam = createTeam( "TestTeam", 255, 0, 0 ) -- create a new team with the specified name
if newTeam then -- if it was successfully created
setPlayerTeam(source, newTeam) -- add the player to the new team
end
end
addCommandHandler("join", gimmeATeam)

 

  • Thanks 1
Link to comment

سويت الكود و شغال

تعرف كيف أخليه يدخل تيم من التيمات الإثنين بس عشوائي؟

Random

function createTeamsOnStart()
    Team1 = createTeam("Ballas", 155, 0, 155) -- change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB
    Team2 = createTeam("Grove Street", 0, 155, 0)
end
addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) -- we attach the function to this resource's root element
function setteam (source)
        setPlayerTeam(source, Team1)
	end
addCommandHandler ( "join", setteam )	

 

Link to comment
Team1 = createTeam("Ballas", 155, 0, 155)
Team2 = createTeam("Grove", 0, 155, 0)

addCommandHandler('join',
function(player)
setElementData(resourceRoot,"any",math.random(0,1))
local Data = getElementData(resourceRoot,"any")
if (Data == 1) then
setPlayerTeam(player,Team1)
outputChatBox('Ballas Team',player,255,0,0,true)
elseif (Data == 0) then
setPlayerTeam(player,Team2)
outputChatBox('Grove Team',player,0,255,0,true)
end
end
)

دي طريقة مش مجربها لاني علي جوال

Edited by KillerX
  • Like 1
Link to comment

أسف على الإزعاج ^^

سويت لوحة بس بدي لما يكون في ديموشن 0 ما يقدر يفتحها و اللوحة تفتح بكوماند

function OpenWindow1(source)
    if ( getElementDimension ( source ) == 0 ) then
		outputChatBox ( "#FB00FF• You can't select weapons outside the event", getRootElement(), 255, 255, 255, true) 
		return end
if removeEventHandler("onClientRender",root,Lou) then  
removeEventHandler("onClientRender",root,Lou)
guiSetVisible ( weaponWind, false )
showCursor(false) 
else
addEventHandler("onClientRender",root,Lou) 
guiSetVisible ( weaponWind, true )
showCursor(true)
    end
end
addCommandHandler ( "select", OpenWindow1 )

 

وين المشكل؟

Link to comment
50 minutes ago, Snakegold said:

أسف على الإزعاج ^^

سويت لوحة بس بدي لما يكون في ديموشن 0 ما يقدر يفتحها و اللوحة تفتح بكوماند


function OpenWindow1(source)
    if ( getElementDimension ( source ) == 0 ) then
		outputChatBox ( "#FB00FF• You can't select weapons outside the event", getRootElement(), 255, 255, 255, true) 
		return end
if removeEventHandler("onClientRender",root,Lou) then  
removeEventHandler("onClientRender",root,Lou)
guiSetVisible ( weaponWind, false )
showCursor(false) 
else
addEventHandler("onClientRender",root,Lou) 
guiSetVisible ( weaponWind, true )
showCursor(true)
    end
end
addCommandHandler ( "select", OpenWindow1 )

 

وين المشكل؟

function OpenWindow1( )
    if ( getElementDimension ( localPlayer ) == 0 ) then
		outputChatBox ( "#FB00FF• You can't select weapons outside the event", getRootElement(), 255, 255, 255, true) 
		return end
if removeEventHandler("onClientRender",root,Lou) then  
removeEventHandler("onClientRender",root,Lou)
guiSetVisible ( weaponWind, false )
showCursor(false) 
else
addEventHandler("onClientRender",root,Lou) 
guiSetVisible ( weaponWind, true )
showCursor(true)
    end
end
addCommandHandler ( "select", OpenWindow1 )


-- جرب 

 

Edited by +1HidroNex
Link to comment
1 minute ago, Snakegold said:

أين استطيع ان اجد الأحداث التي تطابقها؟

على حسب المود او السكربت الي تسويه 

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

https://forum.multitheftauto.com/forum/137-دروس-في-البرمجة/

Edited by #[K]iLLeR<3
Link to comment
1 minute ago, Snakegold said:

أين استطيع ان اجد الأحداث التي تطابقها؟

السؤال هذا انطرح  514834959621294595959520295 مره بالقسم 

دور وبتلاقي لو مكلف على نفسك وخاش قسم الشروحات بتحصل طلبك

  • Haha 1
Link to comment
7 minutes ago, Snakegold said:

شغال بس ما يكتب اي شي في الشات

بدي إسئلك كمان متى تكتب thePlayer/localPlayer/Source?

 

outputChatBox ( "#FB00FF• You can't select weapons outside the event", 255, 255, 255, true) -- عدل هاذا الصطر الى عندك

localplayer = Clinet Side 

source = على حسب الافنت الى بتستخدمه

 

Edited by +1HidroNex
  • Like 1
Link to comment
Just now, +1HidroNex said:

outputChatBox ( "#FB00FF• You can't select weapons outside the event", 255, 255, 255, true) 

localplayer = Clinet Side 

source = على حسب الافنت الى بتستخدمه

 

مشكور اخوي 

1 minute ago, Abdul KariM said:

السؤال هذا انطرح  514834959621294595959520295 مره بالقسم 

دور وبتلاقي لو مكلف على نفسك وخاش قسم الشروحات بتحصل طلبك

أعصابك  إهدى إهدى

Link to comment
2 hours ago, KillerX said:

Team1 = createTeam("Ballas", 155, 0, 155)
Team2 = createTeam("Grove", 0, 155, 0)

addCommandHandler('join',
function(player)
setElementData(resourceRoot,"any",math.random(0,1))
local Data = getElementData(resourceRoot,"any")
if (Data == 1) then
setPlayerTeam(player,Team1)
outputChatBox('Ballas Team',player,255,0,0,true)
elseif (Data == 0) then
setPlayerTeam(player,Team2)
outputChatBox('Grove Team',player,0,255,0,true)
end
end
)

دي طريقة مش مجربها لاني علي جوال

سلامات ليه مستعمل الداتا؟

سويها بمتغير وبعدين تحقق من قيمة المتغير

Link to comment

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...