-
Posts
1,546 -
Joined
-
Last visited
Everything posted by Dimos7
-
i want create a live music put name of song and play it from youtube i know need but how i will make it have sound only createBrowser() setBrowserVolume() loadBrowserURL()
-
just change it and will be done
-
i make it so if other player is police don't die from him too because i first he not die from same teams
-
addEventHandler("onClientPlayerDamage", root, function() local team = getTeamName(getPlayerTeam(source)) if (team == "Unempolyed") or (team == "Off Duty Workers") or (team=="Emergency") then if getElementData(source, "team") then cancelEvent() end end end) addEventHandler("onClientPlayerDamage", root, function(attacker) if isElement(attacker) and getElementType(attacker) == "player" and attacker ~= source then local aLocalTeam = getPlayerTeam(source) local aAttackerTeam = getPlayerTeam(attacker) if aLocalTeam and aAttackerTeam then if aLocalTeam == getTeamFromName("Unempolyed") and aAttackerTeam == getTeamFromName("Police") then cancelEvent() end end end end)
-
for that post your mysql code
-
remove that and after will not have that error
-
can you show me the part of load modules of your server mta please
-
function sound003() local sound = playSound("Sirens/Sound_003.wav") setSoundVolume(sound, 0.3) if sound then stopSound(sound) end end addCommandHandler("sound003", sound003) bindKey("num_1", "down", "sound003") function sound012() local sound = playSound("Sirens/Sound_012.wav") setSoundVolume(sound, 0.3) if sound then stopSound(sound) end end addCommandHandler("sound012", sound012) bindKey("n", "down", "sound012") Second way: function sound003() local sound = playSound("Sirens/Sound_003.wav") setSoundVolume(sound, 0.3) if getSoundVolume(sound)== 0.3 then setSoundVolume(sound, 0.0) end end addCommandHandler("sound003", sound003) bindKey("num_1", "down", "sound003") function sound012() local sound = playSound("Sirens/Sound_012.wav") setSoundVolume(sound, 0.3) if getSoundVolume(sound) == 0.3 then setSoundVolume(sound, 0.0) end end addCommandHandler("sound012", sound012) bindKey("n", "down", "sound012")
-
are you try load the libmysql?
-
make sure you have it and in server folder and in modules file
-
post it here
- 1 reply
-
- 1
-
door = createObject ( 3089, 2004.5 , -1280 , 36.900001525879 , 0, 0, 0 ) marker = createMarker ( 2005.5 , -1280 , 35.900001525879 , 'cylinder', 1, 0, 0, 0, 255 ) -- after creating function openForProMax(thePlayer) local account = getPlayerAccount(thePlayer) if ( getElementType ( thePlayer ) == "player" ) then if getAccountName(account) == "promax" then moveObject ( door,2000, 2004.5 , -1280 , 30.900001525879, 0, 0, 0 ) else return end end end addEventHandler ( 'onMarkerHit', marker, openForProMax ) function closeAfterProMax() moveObject ( door,2000, 2004.5 , -1280 , 36.900001525879, 0, 0, 0 ) end addEventHandler ( 'onMarkerLeave', marker, closeAfterProMax ) yes i forget that sorry fast type mistake
-
door = createObject ( 3089, 2004.5 , -1280 , 36.900001525879 , 0, 0, 0 ) marker = createMarker ( 2005.5 , -1280 , 35.900001525879 , 'cylinder', 1, 0, 0, 0, 255 ) -- after creating function openForProMax(thePlayer) local account = getPlayerAccount(thePlayer) if ( getElementType ( thePlayer ) == "player" ) then if account == "promax" then moveObject ( door,2000, 2004.5 , -1280 , 30.900001525879, 0, 0, 0 ) else return end end end addEventHandler ( 'onMarkerHit', marker, openForProMax ) function closeAfterProMax() moveObject ( door,2000, 2004.5 , -1280 , 36.900001525879, 0, 0, 0 ) end addEventHandler ( 'onMarkerLeave', marker, closeAfterProMax )
-
Object = createObject(968, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) Marker = createMarker(1551.0999755859, -1627.3000488281, 12.5, "cylinder", 2, 100, 0, 12.5, 100) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 0, 90) end addEventHandler("onMarkerHit",Marker,gateo) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) end addEventHandler("onMarkerLeave",Marker,gateo)
-
for dx i think is addEventHandler("onClientRender", root, dxgui)
-
can help me please make it work correctly?
-
it warning that guiSetText at argument 2 get boolen because i guess there try take them without even saved
-
check the script because they have ysql module in ther server
-
setCameraMatrix(-2065.0327148438, 1021.1545410156, 66.882278442383, -2117.1064453125, 1106.4571533203, 70.316734313965) setPlayerHudComponentVisible("all", false) local wLogin, lUser, lPass, eUser, ePass, bLogin, bRegister, cRemeber = nil local wPass, lPass, lRpass, ePasw, eRpass, bPass, bCancel = nil function createPasswordWindow() local screenWidth, screenHeight = guiGetScreenSize() local windowWidth , windowHeiht = 458, 347 local left , top = screenWidth/2 - windowWidth/2, screenHeight/2 - windowHeiht/2 wPass = guiCreateWindow(left, top, windowWidth, windowHeiht, "Change Password", false) guiWindowSetMovable(wPass, false) guiWindowSetSizable(wPass, false) lPass = guiCreateLabel(23, 46, 96, 18, "Password:", false, wPass) guiLabelSetHorizontalAlign(lPass, "left") guiLabelSetVerticalAlign(lPass, "top") ePasw = guiCreateEdit(137, 46, 287, 33, "", false, wPass) guiEditSetMasked(ePasw, true) lRpass = guiCreateLabel(23, 132, 96, 18, "Repeat Password:", false, wPass) guiLabelSetHorizontalAlign(lRpass, "left") guiLabelSetVerticalAlign(lPass, "top") eRpass = guiCreateEdit(137, 132, 287, 33, "", false, wPass) guiEditSetMasked(eRpass, true) bPass = guiCreateButton(42, 273, 128, 37, "Change", false, wPass) bCancel = guiCreateButton(253, 273, 128, 37, "Cancel", false, wPass) guiSetVisible(wPass, false) addEventHandler("onClientGUIClick", bPass, onClientSubmitChangePw) addEventHandler("onClientGUIClick", bCancel, hidePasswordWindow) end function createLoginWindow() local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeiht = 458, 347 local left, top = screenWidth/2 - windowWidth/2, screenHeight/2 - windowHeiht/2 wLogin = guiCreateWindow(left, top, windowWidth, windowHeiht, "Login Panel", false) guiWindowSetMovable(wLogin, false) guiWindowSetSizable(wLogin, false) lUser = guiCreateLabel(23, 46, 96, 18, "Username:", false, wLogin) guiLabelSetHorizontalAlign(lUser, "left") guiLabelSetVerticalAlign(lUser, "top") eUser = guiCreateEdit(137, 46, 287, 33, "", false, wLogin) lPass = guiCreateLabel(23, 132, 96, 18, "Password:", false, wLogin) guiLabelSetHorizontalAlign(lPass, "left") guiLabelSetVerticalAlign(lPass, "top") ePass = guiCreateEdit(137, 132, 287, 33, "", false, wLogin) guiEditSetMasked(ePass, true) bLogin = guiCreateButton(42, 273, 128, 37, "Login", false, wLogin) bRegister = guiCreateButton(253, 273, 128, 37, "Register", false, wLogin) cRemeber = guiCreateCheckBox(23, 215, 100, 15, "Remember me", false, false, wLogin) addEventHandler("onClientGUIClick", cRemeber, onClientSaveInfo) addEventHandler("onClientGUIClick", bLogin, onClientSubmitLogin) addEventHandler("onClientGUIClick", bRegister, onClientSubmitRegister) end function resourceStart() createLoginWindow() if wLogin ~= nil then guiSetVisible(wLogin, true) else outputChatBox("Error: An error has been occupied!", 255, 0, 0) end guiSetInputEnabled(true) showCursor(true) end function onClientSubmitChangePw(button , state) if button == "left" and state == "up" then local password = guiGetText(ePasw) local rpassword= guiGetText(eRpass) if password ~= "" and rpassword ~= "" then triggerServerEvent("submitChangepw", root, localPlayer, password, rpassword) else outputChatBox("Error: Enter password and Repeat it!", 255, 0, 0) end end end function onClientSubmitLogin(button, state) if button == "left" and state == "up" then local username = guiGetText(eUser) local password = guiGetText(ePass) if username ~= "" and password ~= "" then triggerServerEvent("submitLogin", root, localPlayer, username, password) else outputChatBox("Error: Enter username and password!", 255, 0, 0) end end end function onClientSubmitRegister(button, state) if button == "left" and state == "up" then local username = guiGetText(eUser) local password = guiGetText(ePass) if username ~= "" and password ~= "" then triggerServerEvent("submitRegister", root, localPlayer, username, password) else outputChatBox("Error: Enter username and password!", 255, 0, 0) end end end function onClientSaveInfo(button, state) if button == "left" and state == "up" then if guiCheckBoxGetSelected(cRemeber) then guiCheckBoxSetSelected(cRemeber, true) if triggerServerEvent("submitLogin") then if guiCheckBoxGetSelected(cRemeber) == true then username = getElementData(localPlayer, "account:username") password = getElementData(localPlayer, "account:password") guiSetText(eUser, username) guiSetText(ePass, password) end end else guiCheckBoxSetSelected(cRemeber, false) end end end function changepw() createPasswordWindow() guiSetVisible(wPass, true) showCursor(true) guiSetInputEnabled(true) end function hidePasswordWindow() guiSetVisible(wPass, false) showCursor(false) guiSetInputEnabled(false) setCameraTarget(localPlayer) setPlayerHudComponentVisible("all", true) end function hideLoginWindow() guiSetVisible(wLogin, false) guiSetInputEnabled(false) showCursor(false) setCameraTarget(localPlayer) setPlayerHudComponentVisible("all", true) end addEvent("hidePasswordWindow", true) addEvent("hideLoginWindow", true) addEventHandler("hidePasswordWindow", root, hidePasswordWindow) addEventHandler("hideLoginWindow", root, hideLoginWindow) addEventHandler("onClientResourceStart", resourceRoot, resourceStart) addCommandHandler("chagepass", changepw) addEventHandler("onResourceStart", resourceRoot, function() handler = mysql_connect("127.0.0.1", "root", "9852174563", "mtarace") end) function passwordHandler(thePlayer, password, rpassword) local account = getPlayerAccount(thePlayer) if account then if isGuestAccount(account) then outputChatBox("Error: You must be logged in to change password!", thePlayer, 255, 0, 0) end if password == rpassword then if string.len(password) >=5 then setAccountPassword(account, password) mysql_query(handler, "UPDATE accounts SET password='"..mysql_escape_string(password).."' WHERE username='"..mysql_escape_string(account).."'") triggerClientEvent(thePlayer, "hidePasswordWindow", root) else outputChatBox("Error: You new password must be at least 5 character long!", thePlayer, 255, 0, 0) end else outputChatBox("Error: Your passwords aren't the same!", thePlayer, 255, 0, 0) end end end function loginHandler(thePlayer, username, password) local account = getAccount(username, password) local pname = mysql_escape_string(handler, username) local ppw = mysql_escape_string(handler, password) local query = "SELECT * FROM accounts WHERE username='"..pname.."' and password='"..ppw.."'" local result = mysql_query(handler, query) local query2 = "SELECT * FROM ban;" local result2 = mysql_query(handler, query2) if result2 and mysql_num_rows(result2) >0 then row2 = mysql_fetch_assoc(result2) if result and mysql_num_rows(result) >0 then row = mysql_fetch_assoc(result) if account ~= false and result and mysql_num_rows(result) > 0 then if (logIn(thePlayer, account, password) == true) then triggerClientEvent(thePlayer, "hideLoginWindow", root) outputChatBox("INFO: Welcome ".. getPlayerName(thePlayer).." you successfully logged in!", thePlayer, 0, 255, 0) setElementData(thePlayer, "account:username", username) setElementData(thePlayer, "account:password", password) else outputChatBox("Error: someone else is logged in", thePlayer, 255, 0, 0) end else outputChatBox("Error: Username or password are incorrect!", thePlayer, 255, 0, 0) end end end end function registerHandler(thePlayer, username, password) local account = getAccount(username, password) local query = "SELECT * FROM accounts WHERE username='"..username.."'" local result = mysql_query(handler, query) if account ~= false and result and mysql_num_rows(result) > 0 then outputChatBox("Error: Username already exist!", thePlayer, 255, 0, 0) else account = addAccount(username, password) outputChatBox("INFO: you successfully register!", thePlayer, 0, 255, 0) local name = mysql_escape_string(handler, username) local pw = mysql_escape_string(handler, password) local time = getRealTime() local years = time.year local months = time.month local monthdays = time.monthday local hours = time.hour local minutes = time.minute local seconds = time.second local years2 = years+1900 local months2 = months+1 local alltogether = years2.."-"..months2.."-"..monthdays.." "..hours..":"..minutes..":"..seconds local query = "INSERT INTO accounts SET username='"..name.."',password='"..pw.."', ip='"..getPlayerIP(thePlayer).."', serial='"..getPlayerSerial(thePlayer).."', registerDate='"..alltogether.."'" local result = mysql_query(handler, query) end if not account and result and mysql_num_rows(result) > 0 then addAccount(username, password) outputChatBox("INFO: you successfully register!", thePlayer, 0, 255, 0) end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler) i tried make a remember but can't make it work all i do is that and get warning on guiSetText at argument 2 is boolen can you help me that i want to do is when a player login the username and password save and if checkbox is true put the username and password take from there
-
addEventHandler("onResourceStart", resourceRoot, function() handler = dbConnect("mysql", "dbname=mtarace; host=127.0.0.1", "root", "9852174563") end) function passwordHandler(thePlayer, password, rpassword) local account = getPlayerAccount(thePlayer) if account then if isGuestAccount(account) then outputChatBox("Error: You must be logged in to change password!", thePlayer, 255, 0, 0) end if password == rpassword then if string.len(password) >=5 then setAccountPassword(account, password) dbExec(handler, "UPDATE accounts SET password='"..tostring(password).."' WHERE username='"..tostring(account).."'") triggerClientEvent(thePlayer, "hidePasswordWindow", root) else outputChatBox("Error: You new password must be at least 5 character long!", thePlayer, 255, 0, 0) end else outputChatBox("Error: Your passwords aren't the same!", thePlayer, 255, 0, 0) end end end function loginHandler(thePlayer, username, password) local account = getAccount(username, password) local pname = tostring(username) local ppw = tostring (password) local query = dbQuery(handler, "SELECT * FROM accounts WHERE username='"..pname.."' and password='"..ppw.."'") local result = dbPoll(query, - 1) if account ~= false and result > 0 then if (logIn(thePlayer, account, password) == true) then triggerClientEvent(thePlayer, "hideLoginPassword", root) outputChatBox("INFO: Welcome ".. getPlayerName(thePlayer) " you successfully logged in!", thePlayer, 0, 255, 0) else outputChatBox("Error: please report it to forum!", thePlayer, 255, 0, 0) end else outputChatBox("Error: Username or password are incorrect!", thePlayer, 255, 0, 0) end end function registerHandler(thePlayer, username, password) local account = getAccount(username, password) local query = dbQuery(handler,"SELECT * FROM accounts WHERE username='"..username.."' and password='"..password.."'") local result = dbPoll(query, -1) if account ~= false and result > 0 then outputChatBox("Error: Username already exist!", thePlayer, 255, 0, 0) else account = addAccount(username, password) outputChatBox("INFO: you successfully register!", thePlayer, 0, 255, 0) local name = tostring(username) local pw = tostring(password) local time = getRealTime() local years = time.year local months = time.month local monthdays = time.monthday local hours = time.hour local minutes = time.minute local seconds = time.second local years2 = years+1900 local months2 = months+1 local alltogether = years2.."-"..months2.."-"..monthdays.." "..hours..":"..minutes..":"..seconds dbExec(handler, "INSERT INTO accounts (username, password, ip, serial, registerDate) VALUES(username='"..name.."',password='"..pw.."', ip='"..getPlayerIP(thePlayer).."', serial='"..getPlayerSerial(thePlayer).."', registerDate='"..alltogether.."')") end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler) warning line 65 dbExec failed 1054 unknown column username http://imgur.com/V2MvZnJ
-
at /debugscript 3 not apear errors or warnings so you say put so see if execute? outputDebugString
-
addEventHandler("onResourceStart", resourceRoot, function() handler = mysql_connect("127.0.0.1", "root", "9852174563", "mtarace") end) function passwordHandler(thePlayer, password, rpassword) local account = getPlayerAccount(thePlayer) if account then if isGuestAccount(account) then outputChatBox("Error: You must be logged in to change password!", thePlayer, 255, 0, 0) end if password == rpassword then if string.len(password) >=5 then setAccountPassword(account, password) mysql_query(handler, "UPDATE accounts SET password='"..mysql_escape_string(password).."' WHERE username='"..mysql_escape_string(account).."'") triggerClientEvent(thePlayer, "hidePasswordWindow", root) else outputChatBox("Error: You new password must be at least 5 character long!", thePlayer, 255, 0, 0) end else outputChatBox("Error: Your passwords aren't the same!", thePlayer, 255, 0, 0) end end end function loginHandler(thePlayer, username, password) local account = getAccount(username, password) local pname = mysql_escape_string(handler, username) local ppw = mysql_escape_string(handler, password) local query = "SELECT * FROM accounts WHERE username='"..pname.."\' and password='"..ppw.."'" local result = mysql_query(handler, query) if account ~= false and result and mysql_num_rows(result) > 0 then if (logIn(thePlayer, account, password) == true) then triggerClientEvent(thePlayer, "hideLoginPassword", root) outputChatBox("INFO: Welcome ".. getPlayerName(thePlayer) " you successfully logged in!", thePlayer, 0, 255, 0) else outputChatBox("Error: please report it to forum!", thePlayer, 255, 0, 0) end else outputChatBox("Error: Username or password are incorrect!", thePlayer, 255, 0, 0) end end function registerHandler(thePlayer, username, password) local account = getAccount(username, password) local query = "SELECT * FROM accounts WHERE username='"..username.."' and password='"..password.."'" local result = mysql_query(handler, query) if account ~= false and result and mysql_num_rows(result) > 0 then outputChatBox("Error: Username already exist!", thePlayer, 255, 0, 0) else account = addAccount(username, password) outputChatBox("INFO: you successfully register!", thePlayer, 0, 255, 0) local name = mysql_escape_string(handler, username) local pw = mysql_escape_string(handler, password) local time = getRealTime() local years = time.year local months = time.month local monthdays = time.monthday local hours = time.hour local minutes = time.minute local seconds = time.second local years2 = years+1900 local months2 = months+1 local alltogether = years2.."-"..months2.."-"..monthdays.." "..hours..":"..minutes..":"..seconds local query = "INSERT INTO accounts SET username='"..name.."',password='"..pw.."', ip='"..getPlayerIP(thePlayer).."', serial='"..getPlayerSerial(thePlayer).."', registerDate='"..alltogether.."'" local result = mysql_query(handler, query) end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler) why account register at acl and no register at mysql