Jump to content

Blaawee

Members
  • Posts

    857
  • Joined

  • Last visited

Everything posted by Blaawee

  1. Blaawee

    help

    createObject moveObject
  2. yeah it's Server Side : exports.scoreboard:addScoreboardColumn('Country') -- add a column called ('Country') function showFlag () local Home = call(getResourceFromName("admin"), "getPlayerCountry", source) -- then we get the country name from the admin panel setElementData(source,"Country",Home) -- then exported to the column end addEventHandler("onPlayerJoin",getRootElement(),showFlag)
  3. o.k guys this what i did about the windows , i don't know if this right or not : GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Grid = {} Main = guiCreateStaticImage( 228,648,900,72,"Wnds.png",false ) guiSetAlpha( Main,255 ) guiSetVisible( Main, false ) car_b = guiCreateStaticImage( 34, 26, 133, 37, "butt.png", false, Main ) guiSetAlpha( car_b, 255 ) weather_b = guiCreateStaticImage( 173, 27, 133, 36, "butt.png", false, Main ) guiSetAlpha( weather_b, 255 ) Map_b = guiCreateStaticImage( 312, 27, 133, 35, "butt.png", false, Main ) guiSetAlpha( Map_b, 255 ) Weapon_b = guiCreateStaticImage( 450, 26, 133, 36, "butt.png", false, Main ) guiSetAlpha( Weapon_b, 255 ) Stats_b = guiCreateStaticImage( 590, 25, 133, 38, "butt.png", false, Main ) guiSetAlpha( Stats_b, 255 ) Skins_b = guiCreateStaticImage( 729, 25, 133, 37, "butt.png", false, Main ) guiSetAlpha( Skins_b, 255 ) car = guiCreateWindow( 267, 648, 123, 240, "Car", false ) guiWindowSetSizable( car,false ) guiSetVisible( car, false ) create = guiCreateButton( 14, 26, 92, 32, "create", false, car) repaiir = guiCreateButton( 14, 64, 92, 32, "repaiir", false, car) flip = guiCreateButton( 13, 103, 92, 32, "flip", false, car ) color = guiCreateButton( 13, 144, 92, 32, "color", false, car) upgrades = guiCreateButton( 14, 187, 90, 32, "upgrades", false,car ) Weather = guiCreateWindow(406,649,123,240,"Weather", false) guiWindowSetSizable( Weather,false ) guiSetVisible( Weather, false ) Weather_grid = guiCreateGridList(9,20,105,211,false, Weather) guiGridListSetSelectionMode( Weather_grid, 2 ) guiGridListAddColumn( Weather_grid, "Weather Type", 0.2 ) Map = guiCreateWindow(683,649,123,240,"Map",false) guiWindowSetSizable( Map, false ) guiSetVisible( Map, false ) Map = guiCreateButton(10,36,104,67,"Map",false,Map) Int = guiCreateButton(12,135,101,67,"Int",false,Map) Weapon = guiCreateWindow(823,650,123,240,"Weapon",false) guiWindowSetSizable(Weapon,false) guiSetVisible( Weapon, false ) weapon_grid = guiCreateGridList(9,20,105,211,false,Weapon) guiGridListSetSelectionMode( weapon_grid, 2 ) guiGridListAddColumn( weapon_grid, "WeaponS", 0.2 ) Stats = guiCreateWindow(963,650,123,240,"Stats",false) guiWindowSetSizable( Stats, false ) guiSetVisible( Stats, false ) Vehicles = guiCreateLabel(9,35,73,28,"Vehicles",false,Stats) Current = guiCreateLabel(9,59,93,25,"Current: on foot",false,Stats) Lightson = guiCreateCheckBox(14,102,77,25,"Lights on",false,false,Stats) Lightsoff = guiCreateCheckBox(14,133,77,25,"Lights off",false,false,Stats) Skins = guiCreateWindow(544,650,123,240,"Skins",false) guiWindowSetSizable( Skins, false ) guiSetVisible( Skins, false ) skin_grid = guiCreateGridList(10,21,104,210,false, Skins) guiGridListSetSelectionMode( skin_grid, 2 ) guiGridListAddColumn( skin_grid, "SkinS", 0.2 ) --[[ ---------------------- car = guiCreateWindow(269,425,123,240,"Car",false) Weather = guiCreateWindow(407,425,123,240,"Weather",false) Map = guiCreateWindow(682,425,123,240,"Map",false) Weapon = guiCreateWindow(822,425,123,240,"Weapon",false) Stats = guiCreateWindow(961,424,123,240,"Stats",false) Skins = guiCreateWindow(544,426,123,240,"Skins",false) ---------------------- ]]-- function slide_Caron() if ( source == car_b ) then Animation.createAndPlay(car, Animation.presets.guiMove(269, 425, 2000)) guiBringToFront ( car ) end end addEventHandler( "onClientMouseEnter", car_b, slide_Caron ) function slide_Caroff() if ( source == car_b ) then Animation.createAndPlay(car, Animation.presets.guiMove(267,648, 2000)) guiMoveToBack( car ) end end addEventHandler( "onClientMouseLeave", car_b, slide_Caroff ) function ToggleMenu () if guiGetVisible(Main) == true then guiSetVisible(Main, false) guiSetVisible(car, false) guiSetVisible(Weather, false) guiSetVisible(Map, false) guiSetVisible(Weapon, false) guiSetVisible(Stats, false) guiSetVisible(Skins, false) showCursor(false) else guiSetVisible(Main, true) showCursor(true) end end bindKey("F2", "down", ToggleMenu) i tried it and it's keep saying @ line 81 and 89 i don't know why ?
  4. actully Capy Did it , thx capy i think with the images is easy EDIT i got this login panel : client : -- Setting blackLoginScreen = true enableKickPlayer = true disallowLogout = false removeBlackScreenTime = 4 maxLoginAttempts = 5 ------------ local localPlayer = getLocalPlayer() local playerName = getPlayerName(localPlayer) local x,y = guiGetScreenSize() ------------ --main window function createLoginWindow() GUIEditor_Button = {} GUIEditor_Image = {} window = guiCreateWindow(254,200,303,307,"Login Panel",false) guiSetAlpha(window,0.60000002384186) guiWindowSetMovable(window,false) guiWindowSetSizable(window,false) logo = guiCreateStaticImage(62,23,187,38,"images/logo.png",false,window) guiSetAlpha( logo, 0.70) username_l = guiCreateLabel(7,75,289,24,"User Name",false,window) guiLabelSetColor(username_l, 255, 0, 0) guiLabelSetVerticalAlign(username_l,"top") guiLabelSetHorizontalAlign(username_l,"left",false) guiSetFont(username_l,"default-bold") username = guiCreateEdit(9,100,285,25,"",false,window) password_l = guiCreateLabel(7,140,289,24,"Password",false,window) guiLabelSetColor(password_l, 255, 0, 0) guiLabelSetVerticalAlign(password_l,"top") guiLabelSetHorizontalAlign(password_l,"left",false) guiSetFont(password_l,"default-bold") password = guiCreateEdit(9,168,285,25,"",false,window) login = guiCreateButton(9,245,143,53,"Login",false,window) register = guiCreateButton(153,245,135,53,"Register",false,window) labelInfo = guiCreateLabel(7,212,288,24," Please Register Or Login",false,window) guiLabelSetColor(labelInfo,255, 255, 0) guiLabelSetVerticalAlign(labelInfo,"top") guiLabelSetHorizontalAlign(labelInfo,"left",false) Guest = guiCreateButton(9,142,240,25,"Login As Guest",true,window) end -- change password window function PasswordWindow() GUIEditor_Button = {} GUIEditor_Image = {} windowpw = guiCreateWindow(254,137,303,307,"Change Your Password",false) guiWindowSetMovable(windowpw,false) guiWindowSetSizable(windowpw,false) username_lpw = guiCreateLabel(7,75,289,24," Old Password :",false,windowpw) guiLabelSetColor(username_lpw,255, 0, 0) guiLabelSetVerticalAlign(username_lpw,"top") guiLabelSetHorizontalAlign(username_lpw,"left",false) guiSetFont(username_lpw,"default-bold") usernamepw = guiCreateEdit(9,100,285,25,"",false,windowpw) password_lpw = guiCreateLabel(7,140,289,24," New Password :",false,windowpw) guiLabelSetColor(password_lpw, 255, 0, 0) guiLabelSetVerticalAlign(password_lpw,"top") guiLabelSetHorizontalAlign(password_lpw,"left",false) guiSetFont(password_lpw,"default-bold") passwordpw = guiCreateEdit(9,168,285,25,"",false,windowpw) chgpass = guiCreateButton(153,245,135,53,"Done",false,windowpw) errorl = guiCreateLabel(7,212,288,24,"",false,windowpw) guiLabelSetColor(errorl,255, 255, 0) guiLabelSetVerticalAlign(errorl,"top") guiLabelSetHorizontalAlign(errorl,"left",false) guiSetVisible(windowpw, false) end -- Guest mode function onClickGuest(button,state) if(button == "left" and state == "up") then if (source == Guest) then guiSetVisible(window, false) guiSetInputEnabled(false) showCursor(false) if blackLoginScreen == true then fadeCamera(true,removeBlackScreenTime) end end end end addEventHandler("onClientGUIClick", Guest, onClickGuest) function resourceStart() createLoginWindow() if (window ~= nil) then guiSetVisible(window, true) else outputChatBox("An error has occurred.", 255, 0, 0, true) end showCursor(true) guiSetInputEnabled(true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), resourceStart) -- image function image() if ( x == 800 ) and ( y == 600 ) then img = guiCreateStaticImage(0,0,800,600,"images/backgroundlogin.png",false) elseif ( x == 1280 ) and ( y == 720 ) then img = guiCreateStaticImage(0,0,1280,720,"images/backgroundlogin.png",false) guiMoveToBack( img ) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), image) function changePw() PasswordWindow() guiSetVisible(windowpw, true) showCursor(true) guiSetInputEnabled(true) end bindKey ( "F7", "down", changePw ) addCommandHandler("pass", changePw) function clientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) else guiSetText(labelInfo, "Enter username and password.") end end end addEventHandler("onClientGUIClick", login, clientSubmitLogin, false) function clientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(username) local password = guiGetText(password) if username and password then triggerServerEvent("submitRegister", getRootElement(), localPlayer, username, password) else guiSetText(labelInfo, "Enter Your Username And Password", 255, 0, 0, true) end end end addEventHandler("onClientGUIClick", register, clientSubmitRegister, false) function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(usernamepw) local newpassword = guiGetText(passwordpw) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Enter Old And New Password", 255, 0, 0, true) end end end addEventHandler("onClientGUIClick", chgpass, clientSubmitChangepw, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(window, false) showCursor(false) guiSetVisible ( img, false ) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) function hidePasswordWindow() guiSetInputEnabled(false) guiSetVisible(windowpw, false) showCursor(false) end addEvent("hidePasswordWindow", true) addEventHandler("hidePasswordWindow", getRootElement(), hidePasswordWindow) function unknownError() guiSetText(labelInfo, " Please Try To Remember Your Old Password") end addEvent("unknownError", true) addEventHandler("unknownError", getRootElement(), unknownError) function loginWrong() guiSetText(labelInfo, " Bad password") end addEvent("loginWrong", true) addEventHandler("loginWrong", getRootElement(), loginWrong) function registerTaken() guiSetText(labelInfo, " This username already exist") end addEvent("registerTaken", true) addEventHandler("registerTaken", getRootElement(), registerTaken) server : function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("You Have To Login To Change You Password", player, 255, 0, 0, true) return end local playerName = getPlayerName(player) local password_check = getAccount(playerName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 5) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("The Password Should Be More Than 5 Numbers Or Leter", player, 255, 0, 0, true) end else outputChatBox("Your Old Password Is Wrong", player, 255, 0, 0, true) end end end addEvent("submitChangepw", true) addEventHandler("submitChangepw", root, passwordHandler) function loginHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then if (logIn(player, account, password) == true) then outputChatBox("To Change Your Password Press F7", player, 255, 0, 0, true) triggerClientEvent (player, "hideLoginWindow", getRootElement()) else triggerClientEvent (player, "unknownError", getRootElement()) end else triggerClientEvent (player, "loginWrong", getRootElement()) end end addEvent("submitLogin", true) addEventHandler("submitLogin", root, loginHandler) function registerHandler(player, username, password) local account = getAccount(username, password) if (account ~= false) then triggerClientEvent(player, "registerTaken", getRootElement()) else account = addAccount(username, password) if (logIn(player, account, password) == true) then outputChatBox("To Change Your Password Press F7", player, 255, 0, 0, true) triggerClientEvent(player, "hideLoginWindow", getRootElement()) else triggerClientEvent(player, "unknownError", getRootElement()) end end end addEvent("submitRegister", true) addEventHandler("submitRegister", root, registerHandler) no error but, when i try to login or register the background dosn't despear and i cant login or register
  5. is there any way to make a window like this : and when some one put the cross on the button pop up a new slide like this :
  6. why (p) bindTheKey(p) unBindTheKey(p) to define or what
  7. this for turning On function setElementSpeed(element, unit, speed) -- only work if element is moving! if (unit == nil) then unit = 0 end if (speed == nil) then speed = 0 end speed = tonumber(speed) local acSpeed = getElementSpeed(element, unit) if (acSpeed~=false) then -- if true - element is valid, no need to check again local diff = speed/acSpeed local x,y,z = getElementVelocity(element) setElementVelocity(element,x*diff,y*diff,z*diff) return true end return false end function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return (x^2 + y^2 + z^2) ^ 0.5 * 100 else return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100 end else outputDebugString("Not an element. Can't get speed") return false end end function turn(thePlayer) if not isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ( "Admin" ) ) then return end local vehicle = getPedOccupiedVehicle(thePlayer) if (not vehicle) then return end local rX, rY, rZ = getVehicleRotation(vehicle) local Speeds = getElementSpeed(vehicle, "mph") setElementRotation(vehicle, rX, rY, rZ + 180) local Boost = 0.001 setTimer(setElementSpeed,50,1,vehicle,1,-Speeds+Boost) outputChatBox("#00FF00You turned your vehicle with #FF0000" .. tostring(Speeds) .. " mph", thePlayer) end function bindTheKey() for index, player in pairs(getElementsByType("player")) do bindKey(player, "lctrl", "down", turn) outputChatBox("#00FF00You can press #0000FF'left ctrl' #00FF00in vehicle to turn for 180 degrees!", player, 255, 255, 255, true) end end function unBindTheKey() for index, player in pairs(getElementsByType("player")) do bindKey(player, "lctrl", "down", turn) outputChatBox("#FF0000Turning disabled!", player, 255, 255, 255, true) end end addCommandHandler ( "turningON", turn )
  8. thx TAPL work fine @Wafamde : i got what he did he put this for i=1,30 do outputChatBox(" ") its keep repeat the output chat box to make the chat clean and console to and he define the player in the function and TAPL thx again
  9. hi all i have this code , all i want to do get the player name who typed that command function cc(thePlayer) if hasObjectPermissionTo ( "user."..getAccountName(getPlayerAccount(player)), "function.setPlayerMuted" ) then outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox("* #ff0000INFO:#ffff00ADMIN #00ff00".. thePlayer .." #ffff00CLEARED THE CHAT",255,12,15, true) else outputChatBox ("You are Not Admin", thePlayer, 193, 13, 13) end end addCommandHandler("cc", cc)
  10. FPSLimit = 37 FPSMax = 1 function onClientResourceStart ( resource ) if ( guiFPSLabel == nil ) then FPSLimit = 255 / FPSLimit guiFPSLabel = guiCreateLabel ( 0.03, 0.94, 0.5, 0.1, "FPS: 0", true ) guiSetFont ( guiFPSLabel, "sa-header" ) FPSCalc = 0 FPSTime = getTickCount() + 1000 addEventHandler ( "onClientRender", getRootElement (), onClientRender ) end end addEventHandler ( "onClientResourceStart", getRootElement (), onClientResourceStart ) function onClientRender ( ) if ( getTickCount() < FPSTime ) then FPSCalc = FPSCalc + 1 else if ( FPSCalc > FPSMax ) then FPSLimit = 255 / FPSCalc FPSMax = FPSCalc end guiSetText ( guiFPSLabel, "FPS: "..FPSCalc.." Max: "..FPSMax ) guiLabelSetColor ( guiFPSLabel, 255 - math.ceil ( FPSCalc * FPSLimit ), math.ceil ( FPSCalc * FPSLimit ), 0 ) FPSCalc = 0 FPSTime = getTickCount() + 1000 end end mybe this ?
  11. Blaawee

    little help

    i post the hole code
  12. Blaawee

    little help

    come on guys i realy need it
  13. Blaawee

    need help

    The comma >< thx soildsnake it's work fine
  14. Blaawee

    need help

    Bad argument at line 57
  15. https://community.multitheftauto.com/index.php?p= ... tails&id=7
  16. Blaawee

    little help

    SO? IT ALWAYS REPEAT THE SAME SOUND OR WHAT? yes it is
  17. Blaawee

    little help

    it's work but not playing a random
×
×
  • Create New...