Jump to content

TheDarkBlade

Members
  • Posts

    5
  • Joined

  • Last visited

Details

  • Gang
    NomadMC

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

TheDarkBlade's Achievements

Vic

Vic (3/54)

0

Reputation

  1. TheDarkBlade

    SQL

    how can i check in my DB if there is a name on a specific collumn . example: i want to check if in collum accounts there is an account with the name Thedarkb
  2. function nitro( source, commandName ) local team = getTeamName(getPlayerTeam( thePlayer)) if (team == "Staff") then local vehicle = isPedDrivingVehicle ( source ) addVehicleUpgrade ( vehicle , 1010 ) else outputChatBox ("You are not part of staff", source ) end end addCommandHandler ("nos", nitro) [2015-12-26 01:56:07] WARNING: WRPG_nos\nos.lua:2: Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got nil] [2015-12-26 01:56:07] WARNING: WRPG_nos\nos.lua:2: Bad argument @ 'getTeamName' [Expected team at argument 1, got boolean]
  3. exact asta vreau sa fac , daor ca nu stiu ce sa inlocuiesc cu mysql_querry ..... si etc
  4. function vehspawner( thePlayer ,commandName, ID) local x, y ,z = getElementPosition ( player ) local team = getPlayerTeam ( thePlayer ) if (team == Staff )then succes = createVehicle ( ID, x+2 , y+2 , z ) if (succes) then outputChatBox("Am spawnat masina", source) else outputChatBox("Am esuat", source) end else outputChatBox("Nu esti Staff", source) end end addCommandHandler("sv",vehspawner) my error "Bad argument @ getElementPossition [Expected element at argument 1 , got nill ]
  5. Ma poate ajuta careva varog , am un login script cu GUI care salveaza datele intr-o baza de date locala .M-ati putea ajuta sa o mut pe baza mea de date ?. (si register-ul si loginul ) -- Login handling function loginPlayer(username,password,enableKickPlayer,attemptedLogins,maxLoginAttempts) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if ( account ~= false ) then logIn (source, account, password) outputChatBox ("#0000FF* #FFFFFFYou have sucessfully logged in!",source,255,255,255,true) setTimer(outputChatBox,700,1,"#0000FF* #FFFFFFTo enable auto-login, use #ABCDEF/enableauto#FFFFFF!",source,255,255,255,true) triggerClientEvent (source,"hideLoginWindow",getRootElement()) else if enableKickPlayer == true then if (attemptedLogins >= maxLoginAttempts-1) then outputChatBox ("#0000FF* #FFFFFFError! Wrong username and/or password!",source,255,255,255,true) setTimer(outputChatBox,500,1,"#0000FF* #FFFFFFWarning! Maximum login attempts reached! [#008AFF"..attemptedLogins+1 .."/"..maxLoginAttempts.."#FFFFFF]",source,255,255,255,true) setTimer(outputChatBox,1000,1,"#0000FF* #FFFFFFYou will be kicked in #008AFF5 seconds#FFFFFF!",source,255,255,255,true) setTimer(kickPlayer,5000,1,source,"Failed to login") else outputChatBox ("#0000FF* #FFFFFFError! Wrong username and/or password!",source,255,255,255,true) setTimer(outputChatBox,500,1,"#0000FF* #FFFFFFLogin attempts: [#008AFF"..attemptedLogins+1 .."/"..maxLoginAttempts.."#FFFFFF]",source,255,255,255,true) triggerClientEvent(source,"onRequestIncreaseAttempts",source) end else outputChatBox ("#0000FF* #FFFFFFError! Wrong username and/or password!",source,255,255,255,true) end end else outputChatBox ("#0000FF* #FFFFFFError! Please enter your password!",source,255,255,255,true) end else outputChatBox ("#0000FF* #FFFFFFError! Please enter your username!",source,255,255,255,true) end end -- Registration here function registerPlayer(username,password,passwordConfirm) if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then triggerClientEvent(source,"hideRegisterWindow",getRootElement()) outputChatBox ("#0000FF* #FFFFFFYou have sucessfuly registered! [username: #ABCDEF" .. username .. " #FF0000| #FFFFFFPassword: #ABCDEF" .. password .. "#FFFFFF]",source,255,255,255,true ) setTimer(outputChatBox,800,1,"#0000FF* #FFFFFFYou can now login with your new account.",source,255,255,255,true ) else outputChatBox ("#0000FF* #FFFFFFAn unknown error has occured! Please choose a different username/password and try again.",source,255,255,255,true ) end else outputChatBox ("#0000FF* #FFFFFFError! An account with this username already exists!",source,255,255,255,true ) end else outputChatBox ("#0000FF* #FFFFFFError! Passwords do not match!",source,255,255,255,true) end else outputChatBox ("#0000FF* #FFFFFFError! Please confirm your password!",source,255,255,255,true) end else outputChatBox ("#0000FF* #FFFFFFError! Please enter a password!",source,255,255,255,true) end else outputChatBox ("#0000FF* #FFFFFFError! Please enter a username you would like to register with!",source,255,255,255,true) end end -- Auto-login handling function autologinPlayer(username,password) if not (username == "") then if not (password == "") then local account = getAccount ( username, password ) if not (account == false) then logIn (source, account, password) outputChatBox("#0000FF* #FFFFFFYou have been automatically logged in.",source,255,255,255,true) setTimer(outputChatBox,1000,1,"#0000FF* #FFFFFFTo disable auto-login, use #ABCDEF/disableauto.",source,255,255,255,true) triggerClientEvent ( source, "hideLoginWindow", getRootElement()) else outputChatBox ("#FF0000* #FFFFFFAuto-login error - Username & password do not match",source,255,255,255,true) end else outputChatBox ("#FF0000* #FFFFFFAuto-login error - Failed to retrieve password",source,255,255,255,true) end else outputChatBox ("#FF0000* #FFFFFFAuto-login error - Failed to retrieve username",source,255,255,255,true) end end -- When the player logs out, trigger the client event to check if the login panel will request them to login again function logoutHandler() triggerClientEvent(source,"onRequestDisplayPanel",source) end addEventHandler("onPlayerLogout",getRootElement(),logoutHandler) -- Get the server's name function getData() local sName = md5(getServerName()) local sName = string.sub(sName,0,15) triggerClientEvent(source,"onGetServerData",getRootElement(),sName) end addEvent("onRequestLogin",true) addEvent("onRequestRegister",true) addEvent("onRequestAutologin",true) addEvent("onClientLoginLoaded",true) addEventHandler("onRequestLogin",getRootElement(),loginPlayer) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) addEventHandler("onRequestAutologin",getRootElement(),autologinPlayer) addEventHandler("onClientLoginLoaded",getRootElement(),getData)
×
×
  • Create New...