-
Posts
10,056 -
Joined
-
Days Won
27
Everything posted by iPrestege
-
وش تبي تسوي؟ وش هالحوسة كلها؟ تبي تشيل الصورة بعد ثانية؟
-
addEventHandler ( 'onPlayerWasted',root, function ( _,attacker ) if ( attacker and getElementType ( attacker ) == 'player' ) then givePlayerMoney ( attacker,100 ) end end )
-
addEventHandler ( 'onPlayerWasted' ) givePlayerMoney
-
No i don't think you can use the way you upload scripts with like ftp or online control panel file manager.
-
So you want only register and the player manual login? Remove the login function. @Dimos7
-
For sure because line 42 after register you login the player with the new account.
-
شرح استخدام Sublime Text 3 From 50p's مساعد البرمجة
iPrestege replied to iPrestege's topic in Arabic / العربية
صحيح البرنامج غير مجاني لكن بيقعد يشتغل وتطلع لك نافذه وتغلقها وخلاص ماشي من انتهى معي تمام -
ماهو صعب ولا هو سهل لكن وش الفايدة من الحركة هذي وانت عندك ادمنية؟
-
aclGroupList table aclGroupGetName aclGroupAddObject aclGroupRemoveObject isObjectInACLGroup getPlayerAccount getAccountName isGuestAccount triggerClientEvent triggerServerEvent getElementsByType guiGridListClear guiGridListAddRow getPlayerName getPlayerFromName guiGridListSetItemText guiGridListGetSelectedItem addEventHandler ( 'onClientGUIClick' )
-
triggerLatentClientEvent هذي لية مستعملها؟ وماستعملت ترايقر كلاينت عادي؟ وش السبب؟ والخطا انك ماحطيت المود لة صلاحيات حطة في قروب ادمن
-
مدري وش قصدك بالاسل مانجر وضح طلبك أكثر؟
-
Yes because thePlayer is not a localPlayer it's edit value .
-
But you have to loop all players and check that there's no players at all in that random dimension.
-
Copy my server side i post above in this topic your server side has a lot of mistakes.
-
You can set player in a new dimension and use hide element alpha as you said.
-
Try it this way : local GUIEditor = { window = { }, label = { }, edit = { }, button= { } } function createPasswordWindow() GUIEditor.window[1] = guiCreateWindow(693, 268, 303, 307, "Change Password", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(7, 75, 289, 24, " New Password:", false, GUIEditor.window[1]) guiLabelSetVerticalAlign(GUIEditor.label[1], "top") guiLabelSetHorizontalAlign(GUIEditor.label[1], "left") guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.edit[1] = guiCreateEdit(9, 100, 285, 25, "", false, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[1], true) GUIEditor.label[2] = guiCreateLabel(7, 140, 289, 24, " Repeat Password:", false, GUIEditor.window[1]) guiLabelSetVerticalAlign(GUIEditor.label[2], "top") guiLabelSetHorizontalAlign(GUIEditor.label[2], "left") guiSetFont(GUIEditor.label[2], "clear-normal") GUIEditor.edit[2] = guiCreateEdit(9, 168, 285, 25, "", false, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[2], true) GUIEditor.button[1] = guiCreateButton(9, 254, 143, 53, "Change", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(153, 254, 143, 53, "Cancel", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], clientSubmitChangepw, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], hidePasswordWindow, false) end function createLoginWindow() GUIEditor.window[2] = guiCreateWindow(693, 268, 303, 307, "login Panel", false) guiWindowSetMovable(GUIEditor.window[2], false) guiWindowSetSizable(GUIEditor.window[2], false) GUIEditor.label[3] = guiCreateLabel(7, 75, 289, 24, " Username:", false, GUIEditor.window[2]) guiLabelSetVerticalAlign(GUIEditor.label[3], "top") guiLabelSetHorizontalAlign(GUIEditor.label[3], "left") guiSetFont(GUIEditor.label[3], "clear-normal") GUIEditor.edit[3] = guiCreateEdit(9, 100, 285, 25, "", false, GUIEditor.window[2]) GUIEditor.label[4] = guiCreateLabel(7, 140, 289, 24, " Password:", false, GUIEditor.window[2]) guiLabelSetVerticalAlign(GUIEditor.label[4], "top") guiLabelSetHorizontalAlign(GUIEditor.label[4], "left") guiSetFont(GUIEditor.label[4], "clear-normal") GUIEditor.edit[4] = guiCreateEdit(9, 168, 285, 25, "", false, GUIEditor.window[2]) guiEditSetMasked(GUIEditor.edit[4], true) GUIEditor.button[3] = guiCreateButton(9, 254, 143, 53, "Login", false, GUIEditor.window[2]) GUIEditor.button[4] = guiCreateButton(153, 254, 143, 53, "Register", false, GUIEditor.window[2]) addEventHandler("onClientGUIClick", GUIEditor.button[3], clientSubmitLogin, false) addEventHandler("onClientGUIClick", GUIEditor.button[4], clientSubmitRegister, false) end function resourceStart() createLoginWindow() if (GUIEditor.window[2] ~= nil) then guiSetVisible(GUIEditor.window[2], true) else outputChatBox("An error has occupied.") end showCursor(true) guiSetInputEnabled(true) end function changepw() createPasswordWindow() guiSetVisible(GUIEditor.window[1], true) showCursor(true) guiSetInputEnabled(true) end function clientSubmitLogin(button, state) -- if button == "left" and state == "down" then local username = guiGetText(GUIEditor.edit[3]) local password = guiGetText(GUIEditor.edit[4]) if username ~= "" and password ~= "" then triggerServerEvent("submitLogin", localPlayer, username, password) else outputChatBox("Enter username and password.", 255, 0, 0) --end end end function clientSubmitRegister(button, state) -- if button == "left" and state == "down" then local username = guiGetText(GUIEditor.edit[3]) local password = guiGetText(GUIEditor.edit[4]) if username ~= "" and password ~= "" then triggerServerEvent("submitRegister", localPlayer, username, password) else outputChatBox("Enter username and password.", 255, 0, 0) --end end end function clientSubmitChangepw(button, state) --if button == "left" and state == "down" then local password = guiGetText(GUIEditor.edit[1]) local rpassword = guiGetText(GUIEditor.edit[2]) if password ~= "" and rpassword ~= "" then triggerServerEvent("submitChangepw", localPlayer, password, rpassword) else outputChatBox("Enter new password and repeat it", 255, 0, 0) --end end end function hideLoginWindow() guiSetVisible(GUIEditor.window[2], false) showCursor(false) guiSetInputEnabled(false) end function hidePasswordWindow() guiSetVisible(GUIEditor.window[1], false) showCursor(false) guiSetInputEnabled(false) end addEvent("hideLoginWindow", true) addEvent("hidePasswordWindow", true) addEventHandler("hideLoginWindow", root, hideLoginWindow) addEventHandler("hidePasswordWindow", root, hidePasswordWindow) addEventHandler("onClientResourceStart", resourceRoot, resourceStart) addCommandHandler("changepw", changepw)
-
Try this : Client : local GUIEditor = { window = { }, label = { }, edit = { }, button= { } } function createPasswordWindow() GUIEditor.window[1] = guiCreateWindow(693, 268, 303, 307, "Change Password", false) guiWindowSetMovable(GUIEditor.window[1], false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(7, 75, 289, 24, " New Password:", false, GUIEditor.window[1]) guiLabelSetVerticalAlign(GUIEditor.label[1], "top") guiLabelSetHorizontalAlign(GUIEditor.label[1], "left") guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.edit[1] = guiCreateEdit(9, 100, 285, 25, "", false, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[1], true) GUIEditor.label[2] = guiCreateLabel(7, 140, 289, 24, " Repeat Password:", false, GUIEditor.window[1]) guiLabelSetVerticalAlign(GUIEditor.label[2], "top") guiLabelSetHorizontalAlign(GUIEditor.label[2], "left") guiSetFont(GUIEditor.label[2], "clear-normal") GUIEditor.edit[2] = guiCreateEdit(9, 168, 285, 25, "", false, GUIEditor.window[1]) guiEditSetMasked(GUIEditor.edit[2], true) GUIEditor.button[1] = guiCreateButton(9, 254, 143, 53, "Change", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(153, 254, 143, 53, "Cancel", false, GUIEditor.window[1]) guiSstVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], clientSubmitChangepw, false) addEventHandler("onClientGUIClick", GUIEditor.button[2], hidePasswordWindow, false) end function createLoginWindow() GUIEditor.window[2] = guiCreateWindow(693, 268, 303, 307, "login Panel", false) guiWindowSetMovable(GUIEditor.window[2], false) guiWindowSetSizable(GUIEditor.window[2], false) GUIEditor.label[3] = guiCreateLabel(7, 75, 289, 24, " Username:", false, GUIEditor.window[2]) guiLabelSetVerticalAlign(GUIEditor.label[3], "top") guiLabelSetHorizontalAlign(GUIEditor.label[3], "left") guiSetFont(GUIEditor.label[3], "clear-normal") GUIEditor.edit[3] = guiCreateEdit(9, 100, 285, 25, "", false, GUIEditor.window[2]) GUIEditor.label[4] = guiCreateLabel(7, 140, 289, 24, " Password:", false, GUIEditor.window[2]) guiLabelSetVerticalAlign(GUIEditor.label[4], "top") guiLabelSetHorizontalAlign(GUIEditor.label[4], "left") guiSetFont(GUIEditor.label[4], "clear-normal") GUIEditor.edit[4] = guiCreateEdit(9, 168, 285, 25, "", false, GUIEditor.window[2]) guiEditSetMasked(GUIEditor.edit[4], true) GUIEditor.button[3] = guiCreateButton(9, 254, 143, 53, "Login", false, GUIEditor.window[2]) GUIEditor.button[4] = guiCreateButton(153, 254, 143, 53, "Register", false, GUIEditor.window[2]) addEventHandler("onClientGUIClick", GUIEditor.button[3], clientSubmitLogin, false) addEventHandler("onClientGUIClick", GUIEditor.button[4], clientSubmitRegister, false) end function resourceStart() createLoginWindow() if (GUIEditor.window[2] ~= nil) then guiSetVisible(GUIEditor.window[2], true) else outputChatBox("An error has occupied.") end showCursor(true) guiSetInputEnabled(true) end function changepw() createPasswordWindow() guiSetVisible(GUIEditor.window[1], true) showCursor(true) guiSetInputEnabled(true) end function clientSubmitLogin(button, state) if button == "left" and state == "down" then local username = guiGetText(GUIEditor.edit[3]) local password = guiGetText(GUIEditor.edit[4]) if username ~= "" and password ~= "" then triggerServerEvent("submitLogin", localPlayer, username, password) else outputChatBox("Enter username and password.", 255, 0, 0) end end end function clientSubmitRegister(button, state) if button == "left" and state == "down" then local username = guiGetText(GUIEditor[3]) local password = guiGetText(GUIEditor[4]) if username ~= "" and password ~= "" then triggerServerEvent("submitRegister", localPlayer, username, password) else outputChatBox("Enter username and password.", 255, 0, 0) end end end function clientSubmitChangepw(button, state) if button == "left" and state == "down" then local password = guiGetText(GUIEditor.edit[1]) local rpassword = guiGetText(GUIEditor.edit[2]) if password ~= "" and rpassword ~= "" then triggerServerEvent("submitChangepw", localPlayer, password, rpassword) else outputChatBox("Enter new password and repeat it", 255, 0, 0) end end end function hideLoginWindow() guiSetVisible(GUIEditor.window[2], false) showCursor(false) guiSetInputEnabled(false) end function hidePasswordWindow() guiSetVisible(GUIEditor.window[1], false) showCursor(false) guiSetInputEnabled(false) end addEvent("hideLoginWindow", true) addEvent("hidePasswordWindow", true) addEventHandler("hideLoginWindow", root, hideLoginWindow) addEventHandler("hidePasswordWindow", root, hidePasswordWindow) addEventHandler("onClientResourceStart", resourceRoot, resourceStart) addCommandHandler("changepw", changepw) Server : function passwordHandler(password, rpassword) local account = getPlayerAccount(source) if account then if isGuestAccount(account) then outputChatBox("You must be logged in to change password!", source, 255, 0, 0) return end if password == rpassword then if string.len(password) >= 5 then setAccountPassword(account, password) triggerClientEvent(source, "hidePasswordWindow",source ) else outputChatBox("Your new password must be at least 5 characters long!", source, 255, 0, 0) end else outputChatBox("Your passwords aren't the same!", source, 255, 0, 0) end end end function loginHandler(username, password) local account = getAccount(username, password) if account ~= false then if (logIn(source, account, password) == true) then outputChatBox("You succefuly logged in!", source, 0, 255, 0) triggerClientEvent(source, "hideLoginWindow", source) else outputChatBox("An error please report it to forum!", source, 255, 0, 0) end else outputChatBox("Username or password are incorrect!", source, 255, 0, 0) end end function registerHandler(username, password) local account = getAccount(username, password) if account ~= false then outputChatBox("This username is already exist!", source, 255, 0, 0) else account = addAccount(username, password) outputChatBox("You succefuly registered!", source, 0, 255, 0) if (logIn(source, account, password) == true) then outputChatBox("You succefuly logged in!", source, 0, 255, 0) triggerClientEvent(source, "hideLoginWindow", source) else outputChatBox("An error please report it to forum!", source, 255, 0, 0) end end end addEvent("submitChangepw", true) addEvent("submitLogin", true) addEvent("submitRegister", true) addEventHandler("submitChangepw", root, passwordHandler) addEventHandler("submitLogin", root, loginHandler) addEventHandler("submitRegister", root, registerHandler) Please make sure to add this resource to 'Admin' Group to add accounts. Ex. resource.MyResourceName
-
ايه نعم فية مود قبل فترة شفتة بالكومنتي لـ Castillo دورتة وحصلت لك هالكود هذا المود كامل يحفظ الاسلحة : local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end ) الكود يخص Castillo - SolidSnake14 المفترض انة يشتغل تمام جربة سيرفر وشف
-
addEventHandler ( 'onPlayerWasted' ) addEventHandler ( 'onPlayerSpawn' ) getPedWeapon getPedTotalAmmo giveWeapon
-
Post the errors in the debug use /debugscript 3 to show errors warnings is there anything in there?
-
Line 75 + 99 You are missing 'r' in the ' triggerSeverEvent' so should be 'triggerServerEvent'.
-
Don't add the event handler or if you want to remove it and show it with the gui stats use a variables.
-
@Simple01 @enzopaul4 newgui.wind[1] doesn't exists it's a nil element so this will not work just replace it with GUIEditor.window[1] because that is your window and your code @enzopaul4 should work just replace the gui element with you window gui and hide your window with 'guiSetVisible' .
-
شرح استخدام Sublime Text 3 From 50p's مساعد البرمجة
iPrestege replied to iPrestege's topic in Arabic / العربية
@Dr. كويس انه اشتغل اللي ماتشتغل معه يتأكد من المسار واظهار الملفات المخفية لو ماطلع له الملف AppData @Mr.CoR بالنسبة للنوت باد هذي افضل بكثير وخصوصاً اللي جربها الوان الوظائف مثل الويكي ويعطيك ساينتكس لكل وظيفة كامل وهل هو سترنق هل هل هو رقم ..الخ ومثال هذي الصورة : هذي الصورة من البرنامج تشوف الكود بشكل ممتاز وتعرف نوع الملف او او الخ.. والساينتكس يساعد كثير ويقلل دخولك للويكي