-
Posts
169 -
Joined
-
Last visited
Everything posted by Timic
-
Hmm something wrong Look up i edit and add picture ^
-
ehmm.. How i can get reply?
-
Hey, I made a login script but i had on a problem but i dont know what's the problem And here's my code: Client-Side: LoginWin = guiCreateWindow(532,337,359,234,"LoGiN SySTeM v1.0",false) GUIEditor_Label[1] = guiCreateLabel(26,64,61,18,"Username:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[1],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Label[2] = guiCreateLabel(52,181,5,5,"",false,GUIEditor_Label[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[2],"left",false) GUIEditor_Label[3] = guiCreateLabel(26,108,61,18,"Password:",false,LoginWin) guiLabelSetColor(GUIEditor_Label[3],255,139,0) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[3],"left",false) usernameEditLogin = guiCreateEdit(92,59,228,31,"",false,LoginWin) passwordEditLogin = guiCreateEdit(92,103,228,31,"",false,LoginWin) logbtn = guiCreateButton(22,171,138,22,"Log In",false,LoginWin) regbtn = guiCreateButton(197,171,138,22,"Register",false,LoginWin) guestbtn = guiCreateButton(22,199,313,23,"Guest",false,LoginWin) GUIEditor_Label[4] = guiCreateLabel(127,28,107,16,"Log in or Register.",false,LoginWin) guiLabelSetColor(GUIEditor_Label[4],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"left",false) guiSetFont(GUIEditor_Label[4],"default-bold-small") function receiveVars( allow, email) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") if (email == "false") then guiSetVisible(LblRegisterEmail, false) guiSetVisible(EditRegisterEmail, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) guiSetText(usernameEditLogin, playername) guiSetText(usernameEditPassword, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == logbtn) then triggerServerEvent("onLogin", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", logbtn, onClickBtn, false) function onClickBtn1(button, state) if(button == "left" and state == "up") then if(source == regbtn) then triggerServerEvent("onRegister", getRootElement(), localPlayer, guiGetText(usernameEditLogin), guiGetText(usernameEditPassword)) end end end addEventHandler("onClientGUIClick", regbtn, onClickBtn, false) function onClickBtn2(button, state) if(button == "left" and state == "up") then if(source == guestbtn) then guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end end end addEventHandler("onClientGUIClick", guestbtn, onClickBtn, false) function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) showCursor(false) end addEvent("hideLoginWindow", true) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) Server-Side: function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... logOut ( player ) -- Log them out. end if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin ) function onRegister ( player, user, pass, email ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "email", email) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "onRegister", true ) addEventHandler( "onRegister", getRootElement(), onRegister ) function needVars() local allow_register = get("allow_register") local email_on_register = get("email_on_register") triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, email_on_register) end addEvent("onNeedVars", true) addEventHandler("onNeedVars", getRootElement(), needVars) EDITS: I dont know what's wrong again!:
-
Yes we can but we cant replace CJ clothes
-
Someone have video how to make database?? -.-''
-
its posiblle... because slothman.. he replaced zombies
-
There you can replace cars, helicopters etc. http://mta.dzek.eu/vehicle/
-
wiiiiie fast plizz ^^
-
IM CREATING 5 HOURS THIS FU***** DATABASE BUT I CANT!!!!! I can open phpmyadmin but i dont know how to create it
-
If you CAN'T register then get latest version of Admin System!
-
try use string.find
-
yes it is just ignore it
-
Hi, When i first joined SPG clan i see my script (I never sharing scripts from friends or my scripts) Then i say "Remove my script its stoled" then he permament ban me! Please crash that server
-
lol You need for this script .xml files server-side and client-side
-
What the.. i can't create database i have open xampp control panel application MySql running i pressed admin then i can't connect to the site!!! Link: http://localhost/phpmyadmin/ Help
-
download link is out please download to community
-
It's not stoled so i will ask friend
-
Just do like this: (its from admin system) _aclrights = {} function hasPermissionTo ( object ) if ( _aclrights[object] ) then return true end return false end addEvent ( "aPermissions", true ) addEventHandler ( "aPermissions", getLocalPlayer(), function ( table ) for id, right in ipairs ( table ) do _aclrights[right] = true if ( aAdminForm ) then guiSetEnabled ( _guiprotected[right], true ) end end end ) addEventHandler ( "onAdminInitialize", _root, function() if ( #_guiprotected == 0 ) then triggerServerEvent ( "aPermissions", getLocalPlayer() ) end end ) If im right run on client-side!
-
i do but i dont know what to fix
-
Hi, i edited from resource "AdminList" because gives me friend. This is the script: function createAdminList() level1 = { } level2 = { } level3 = { } level4 = { } level5 = { } level6 = { } level7 = { } level8 = { } level9 = { } level10 = { } for k, v in ipairs(getElementsByType("player")) do if not isGuestAccount(getPlayerAccount(v)) then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 1")) then table.insert(level1, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 2")) then table.insert(level2, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 3")) then table.insert(level3, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 4")) then table.insert(level4, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 5")) then table.insert(level5, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 6")) then table.insert(level6, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 7")) then table.insert(level7, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 8")) then table.insert(level8, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 9")) then table.insert(level9, v) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(v)), aclGetGroup("Level 10")) then table.insert(level10, v) end end end return level1, level2, level3, level4, level5, level6, level7, level8, level9, level10 end function AdminList(sourcePlayer, command) local level1, level2, level3, level4, level5, level6, level7, level8, level9, level10 = createAdminList() end for k, v in ipairs(level1) do outputChatBox("Admin Level1 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level1 > 0 or #level2 > 0 or #level3 > 0 or #level4 > 0 or #level5 > 0 or #level6 > 0 or #level7 > 0 or #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level2) do outputChatBox("Admin Level2 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level2 > 0 or #level3 > 0 or #level4 > 0 or #level5 > 0 or #level6 > 0 or #level7 > 0 or #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level3) do outputChatBox("Admin Level3 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level3 > 0 or #level4 > 0 or #level5 > 0 or #level6 > 0 or #level7 > 0 or #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level4) do outputChatBox("Admin Level4 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level4 > 0 or #level5 > 0 or #level6 > 0 or #level7 > 0 or #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level5) do outputChatBox("Admin Level5 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level5 > 0 or #level6 > 0 or #level7 > 0 or #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level6) do outputChatBox("Admin Level6 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level6 > 0 or #level7 > 0 or #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level7) do outputChatBox("Admin Level7 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level7 > 0 or #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level8) do outputChatBox("Admin Level8 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level8 > 0 or #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level9) do outputChatBox("Admin Level9 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level9 > 0 or #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end for k, v in ipairs(level10) do outputChatBox("Admin Level10 - " .. getPlayerName(v), sourcePlayer, 255, 0, 0, false) end if #level10 > 0 then outputChatBox("--------------------", sourcePlayer, 255, 0, 0, false) end addCommandHandler("admins", AdminList) Please help