MR.S3D
Members-
Posts
732 -
Joined
-
Last visited
Everything posted by MR.S3D
-
Server this create team one time then just set player in team theTeam = createTeam ( "Default", 255, 255, 255 ) Team = createTeam ( "English", 255, 255, 255 ) TeamRussian = createTeam ( "Russian", 255, 255, 255 ) addEvent ('lang', true) addEventHandler ('lang', root, function (team) if team == "Default" then if theTeam then setPlayerTeam ( source, theTeam ) end elseif team == "English" then if Team then setPlayerTeam ( source, Team) end elseif team == "Russian" then if TeamRussian then setPlayerTeam ( source, TeamRussian) end end end )
-
كذا راح يكرر يفضل يكون كذا sound = nil function Sound() if (source == اسم زر تشغيل الصوت) then if sound == nil then sound = playSound("NameSound") -- إلى اسم الصوت مع صيغة الصوت NameSound غير end elseif (source == اسم زر إيقاف الصوت) then dstroyElement(sound) -- إيقاف الصوت sound = nil end end addEventHandler ("onClientGUIClick", getRootElement(), Sound)
-
function addACLGroupObject ( thePlayer, commandName, groupName) local ourGroup = aclGetGroup ( groupName ) -- if there is no previous group with this name, we need to create one if ourGroup then return warnText("this goup already exist",thePlayer) end ourGroup = aclCreateGroup ( groupName ) -- and finally let's add the object to it's group local account = getPlayerAccount(thePlayer) local accountN = getAccountName(account) aclGroupAddObject ( ourGroup, 'user.'..accountN ) setAccountData(account, "group",tostring(groupName)) setElementData(thePlayer, "group", tostring(groupName)) warnText( "Group created:"..tostring(groupName), thePlayer ) -- don't forget to save the ACL after it has been modified aclSave () end addCommandHandler ( "creategroup", addACLGroupObject )
-
+ 1
-
ماراح تلاقي احد فاضي يسويه لك من دون فلوس
-
write command with player name or account?
-
function addACLGroupObject ( thePlayer, commandName, groupName) local ourGroup = aclGetGroup ( groupName ) -- if there is no previous group with this name, we need to create one if ourGroup then return warnText("this goup already exist",thePlayer) end ourGroup = aclCreateGroup ( groupName ) -- and finally let's add the object to it's group local account = getPlayerAccount(thePlayer) local accountN = getAccountName(account) aclGroupAddObject ( ourGroup, 'user.'..accountN ) setAccountData(account, "group", ourGroup) setElementData(thePlayer, "group", ourGroup) warnText( "Group created:"..ourGroup , thePlayer ) -- don't forget to save the ACL after it has been modified aclSave () end addCommandHandler ( "creategroup", addACLGroupObject )
-
you need this for all player?
-
You should check if isElment(player) or not
-
SERVER function iii(player) local ils = getPedStat(player, 122) setPedStat( player, 122, ils+1 ) end function lll( ) local ilss = getPedStat( player, 123) setPedStat( player, 123, ilss+1 ) end function ooo(player) local il = getPedStat( player, 122) setPedStat( player, 124, il+1 ) end addEventHandler("onVehicleExplode", getRootElement(), function() local Killer = getElementData ( source, "VehicleExplode" ) if Killer and getElementType(Killer)=="player" then if (getVehicleType ( source ) == "Automobile")then iii(Killer) elseif (getVehicleType ( source ) == "Helicopter")then ooo(Killer) elseif (getVehicleType ( source ) == "Boat")then lll(Killer) end end end )
-
you add 2 Event in server side why? and then why you need destroy team?
-
try with this Client marker55 = createMarker( 1000, 1000, 47,"cylinder", 1.5, 255, 225, 0 ) GUIEditor = { window = {}, } GUIEditor.window[1] = guiCreateWindow(321, 142, 694, 532, "Stats", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) Cars = guiCreateLabel(8, 42, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Cars, "default-bold-small") Helicopters = guiCreateLabel(10, 110, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Helicopters, "default-bold-small") Boats = guiCreateLabel(10, 176, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Boats, "default-bold-small") BikeSkills = guiCreateLabel(10, 248, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(BikeSkills, "default-bold-small") CycleSkills = guiCreateLabel(10, 328, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(CycleSkills, "default-bold-small") Muscles = guiCreateLabel(10, 415, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Muscles, "default-bold-small") guiSetVisible(GUIEditor.window[1], false) showCursor(false) function MarkerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor.window[1], true) showCursor (true) end end addEventHandler ( "onClientMarkerHit", marker55, MarkerHit ) addEventHandler("onClientRender", root, function () local heli = getPedStat( localPlayer, 124) local car = getPedStat( localPlayer, 122) local boa = getPedStat( localPlayer, 123) local bike = getPedStat( localPlayer, 229) local cycle = getPedStat( localPlayer, 230) local Muss = getPedStat( localPlayer, 23) guiSetText(Cars, "Cars Destroyed: " ..car) guiSetText(Helicopters, "Helicopters Destroyed: " ..heli) guiSetText(Boats, "Boats Destroyed: " ..boa) guiSetText(BikeSkills, "Bike Skills: " ..bike) guiSetText(CycleSkills, "cycle Skills : " ..cycle) guiSetText(Muscles, "Your Muscles: " ..Muss) end ) function firing( _, _, _, _, _, _, hitElement) if hitElement and getElementType( hitElement ) == "Vehicle" then setElementData( hitElement,"VehicleExplode", getLocalPlayer(), true) end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), firing ) Server addEventHandler("onVehicleExplode", getRootElement(), function() local Killer = getElementData ( source, "VehicleExplode" ) if Killer and getElementType(Killer)=="player" then if (getVehicleType ( source ) == "Automobile")then iii(Killer) elseif (getVehicleType ( source ) == "Helicopter")then ooo(Killer) elseif (getVehicleType ( source ) == "Boat")then lll(Killer) end end setElementData( source,"VehicleExplode", nil, true) end ) function iii(player) local ils = getPedStat(player, 122) setPedStat( player, 122, ils+1 ) end function lll( ) local ilss = getPedStat( player, 123) setPedStat( player, 123, ilss+1 ) end function ooo(player) local il = getPedStat( player, 122) setPedStat( player, 124, il+1 ) end
-
Client marker55 = createMarker( 1000, 1000, 47,"cylinder", 1.5, 255, 225, 0 ) GUIEditor = { window = {}, } GUIEditor.window[1] = guiCreateWindow(321, 142, 694, 532, "Stats", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) Cars = guiCreateLabel(8, 42, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Cars, "default-bold-small") Helicopters = guiCreateLabel(10, 110, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Helicopters, "default-bold-small") Boats = guiCreateLabel(10, 176, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Boats, "default-bold-small") BikeSkills = guiCreateLabel(10, 248, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(BikeSkills, "default-bold-small") CycleSkills = guiCreateLabel(10, 328, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(CycleSkills, "default-bold-small") Muscles = guiCreateLabel(10, 415, 325, 36, "", false, GUIEditor.window[1]) guiSetFont(Muscles, "default-bold-small") guiSetVisible(GUIEditor.window[1], false) showCursor(false) function MarkerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor.window[1], true) showCursor (true) end end addEventHandler ( "onClientMarkerHit", marker55, MarkerHit ) addEventHandler("onClientRender", root, function () local heli = getPedStat( localPlayer, 124) local car = getPedStat( localPlayer, 122) local boa = getPedStat( localPlayer, 123) local bike = getPedStat( localPlayer, 229) local cycle = getPedStat( localPlayer, 230) local Muss = getPedStat( localPlayer, 23) guiSetText(Cars, "Cars Destroyed: " ..car) guiSetText(Helicopters, "Helicopters Destroyed: " ..heli) guiSetText(Boats, "Boats Destroyed: " ..boa) guiSetText(BikeSkills, "Bike Skills: " ..bike) guiSetText(CycleSkills, "cycle Skills : " ..cycle) guiSetText(Muscles, "Your Muscles: " ..Muss) end ) function firing( _, _, _, _, _, _, hitElement) if hitElement and getElementType( hitElement ) == "Vehicle" then triggerServerEvent("onFire", getRootElement(),hitElement) end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), firing ) Server function iii(player) local ils = getPedStat(player, 122) setPedStat( player, 122, ils+1 ) end function lll( ) local ilss = getPedStat( player, 123) setPedStat( player, 123, ilss+1 ) end function ooo(player) local il = getPedStat( player, 122) setPedStat( player, 124, il+1 ) end function add(vhe) if (getVehicleType ( vhe ) == "Automobile")then iii(source) elseif (getVehicleType ( vhe ) == "Helicopter")then ooo(source) elseif (getVehicleType ( vhe ) == "Boat")then lll(source) end end addEvent("onFire",true) addEventHandler("onFire", getRootElement(), add )
-
This Example theTeam = createTeam ( "Default", 255, 255, 255 ) --- element theTeam local function count(team) return countPlayersInTeam ( getTeamFromName ( team ) ) --- to get all players in team end addCommandHandler("destroyTeam", function() Players = count( "Default" ) ---return function count(teamName) if ( Players == 0 ) then destroyElement(theTeam) -- destroy elemnt theTeam theTeam = nil end end)
-
Client function firing( _, _, _, _, _, _, hitElement) if hitElement and getElementType( hitElement ) == "Vehicle" then triggerServerEvent("onFire", getRootElement()) end end addEventHandler("onClientPlayerWeaponFire", getRootElement(), firing )
-
والله مدري ماني شايف فيه شي هات الكلنت كامل
-
localPlayer not use in server side just in client side
-
addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(241,112,317,351,"",false) GUIEditor_Button[1] = guiCreateButton(332,158,97,31,"Click Here",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(330,237,97,30,"Click Here 2",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(327,321,99,34,"Click Here 3",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,405,99,33,"Click Here 4",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(262,113,176,20," Note For Admin Only",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1], false) --- اخفاء او اظهار النافذة end )
-
addEventHandler("onClientRender", root, function (localPlayer) ---and also here localPlayer not needed
-
وش المود اللي تستخدمه ورني الكود؟
-
show me all server side
-
its works i tested it Client localPlayer = getLocalPlayer() function drawGUI() guiWindow = guiCreateWindow(200,200,300,300,"ComboBox test area",false,false) comboBox = guiCreateComboBox(20, 30, 288, 200, "selected", false, guiWindow) local Default = guiComboBoxAddItem(comboBox,"Default") local English = guiComboBoxAddItem(comboBox,"English") button1 = guiCreateButton(80, 80, 100, 50, "selected", false, guiWindow) addEventHandler ("onClientGUIClick",getResourceRootElement(getThisResource()),somethingFromClickValue) guiSetVisible(guiWindow,false) end function somethingFromClickValue() if ( source == button1 ) then local item = guiComboBoxGetSelected(comboBox) local text = guiComboBoxGetItemText(comboBox,item) if text == "Default" or text == "English" then triggerServerEvent("lang",localPlayer,text) end end end function opengui() if not guiWindow then drawGUI() guiSetVisible(guiWindow,true) else guiSetVisible(guiWindow, not guiGetVisible(guiWindow)) end showCursor(not isCursorShowing()) end bindKey("F1", "down", opengui) addCommandHandler("combobox", opengui) Server theTeam = createTeam ( "Default", 255, 255, 255 ) Team = createTeam ( "English", 255, 255, 255 ) addEvent ('lang', true) addEventHandler ('lang', root, function (team) if team == "Default" then setPlayerTeam ( source, theTeam ) else setPlayerTeam ( source, Team) end end )
-
client localPlayer = getLocalPlayer() function drawGUI() guiWindow = guiCreateWindow(200,200,300,300,"ComboBox test area",false,false) comboBox = guiCreateComboBox(20, 30, 288, 200, "selected", false, guiWindow) local Default = guiComboBoxAddItem(comboBox,"Default") local English = guiComboBoxAddItem(comboBox,"English") button1 = guiCreateButton(80, 80, 100, 50, "selected", false, guiWindow) ---button addEventHandler ("onClientGUIClick",getResourceRootElement(getThisResource()),somethingFromClickValue) guiSetVisible(guiWindow,false) end function somethingFromClickValue() if ( source == button1 ) then ---When Click button1 local item = guiComboBoxGetSelected(comboBox) -- get Selected local text = guiComboBoxGetItemText(comboBox,item) --- get text if text == "Default" then triggerServerEvent("lang1",localPlayer) elseif text == "English" then triggerServerEvent("lang2",localPlayer) end end end function opengui() if not guiWindow then drawGUI() guiSetVisible(guiWindow,true) else guiSetVisible(guiWindow, not guiGetVisible(guiWindow)) end showCursor(not isCursorShowing()) end bindKey("F1", "down", opengui) addCommandHandler("combobox", opengui) Server theTeam = createTeam ( "Default", 255, 255, 255 ) -- Team = createTeam ( "English", 255, 255, 255 ) addEvent ('lang1', true) addEventHandler ('lang1', root, function () setPlayerTeam ( source, theTeam ) end ) addEvent ('lang2', true) addEventHandler ('lang2', root, function () setPlayerTeam ( source, theTeam ) end )
