Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. -.Paradox.-

    Help

    Hello, i'm asking how to draw a dx text and disappear after 3 seconds, thanks.
  2. The gui dont want to open i can see only cursor
  3. Hello, i was searching in forum about a weapon inventory, and i found this, but i don't know why it doesnt work, here is the code thanks. local player = getLocalPlayer() tab = guiCreateTabPanel(429, 151, 430, 404, true) tab_inventory = guiCreateTab("Weapon:", tab) inventory_gridlist = guiCreateGridList (0.03, 0.03, 0.46, 0.94, true, tab_inventory) weapSlots = guiGridListAddColumn(inventory_gridlist, "slots", 0.9) function weapItemInInventory ( ) if ( weapSlots ) then for slot = 1, 12 do local weapon = getPedWeapon ( localPlayer, slot ) if ( weapon > 0 ) then local row = guiGridListAddRow ( inventory_gridlist ) guiGridListSetItemText ( inventory_gridlist, row, weapSlots, getWeaponNameFromID ( weapon ), false, false ) end end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), weapItemInInventory ) setTimer ( function ( ) guiGridListClear ( inventory_gridlist ) weapItemInInventory ( ) end, 5000, 0 ) function enableInv() if guiGetVisible(tab) == false then guiSetVisible(tab, true) showCursor(true) else guiSetVisible(tab, false) showCursor(false) end end bindKey("B","down", enableInv)
  4. I don't understand what you mean with shaders? I mean how?
  5. Hello, I have a little question, how to change the parachute bar HUD and position?
  6. -.Paradox.-

    Shop

    Hello, i made this shop but it wont open nothing in debug, thanks for help. GUIEditor = { gridlist = {}, window = {}, button = {} } GUIEditor.window[2] = guiCreateWindow(527, 227, 409, 336, "Shop ", true) guiWindowSetSizable(GUIEditor.window[2], false) guiSetAlpha(GUIEditor.window[2], 1.00) GUIEditor.gridlist[1] = guiCreateGridList(12, 27, 276, 299, false, GUIEditor.window[2]) guiGridListAddColumn(GUIEditor.gridlist[1], "Shop", 0.4) guiGridListAddColumn(GUIEditor.gridlist[1], "$", 0.4) for i = 1, 8 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Health", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "$1000", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Armor", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "$1000", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "Repair Vehicle", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 2, "$1000", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "Jetpack", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 2, "$7600", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "Parachute", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 2, "$500", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "Night Vision Googles", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 2, "$750", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "Infrared Googles", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 2, "$750", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "Camera", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 2, "$2000", false, false) GUIEditor.button[1] = guiCreateButton(295, 253, 104, 63, "Close", false, GUIEditor.window[2]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") GUIEditor.button[2] = guiCreateButton(295, 174, 103, 63, "Buy", false, GUIEditor.window[2]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFFFFFF") guiSetVisible(GUIEditor.window[2], false) showCursor(false) function enableShop() if guiGetVisible(GUIEditor.window[2]) == false then guiSetVisible(GUIEditor.window[2], true) showCursor(true) else guiSetVisible(GUIEditor.window[2], false) showCursor(false) end end addCommandHandler("shops", enableShop) function closeButton() guiSetVisible(GUIEditor.window[2], false) showCursor(false) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], closeButton, false ) addEventHandler("onClientGUIClick", guiRoot, function() if source == GUIEditor.button[2] then local row = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if row == 0 then triggerServerEvent("setMyHealth", localPlayer) elseif row == 1 then triggerServerEvent("setMyArmor", localPlayer) elseif row == 2 then triggerServerEvent("repairMyCar", localPlayer) elseif row == 3 then triggerServerEvent("giveMeJetpack", localPlayer) elseif row == 4 then triggerServerEvent("giveMeParachute", localPlayer) elseif row == 5 then triggerServerEvent("giveMeNight", localPlayer) elseif row == 6 then triggerServerEvent("giveMeInfrared", localPlayer) elseif row == 7 then triggerServerEvent("giveMeCamera", localPlayer) end end end)
  7. -.Paradox.-

    Help

    Hello,i made this hud but i want to appear for all resolutions, thanks. P.S: I'm using 1366x768 resolution. addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() --Gets some elements local pHealth = math.floor (getElementHealth(localPlayer)) if pHealth > 200 then pHealth = pHealth / 2 end local armor = math.floor(getPedArmor ( getLocalPlayer() )) if armor > 100 then armor = armor / 2 end local moneycount=getPlayerMoney(getLocalPlayer()) local money= '$' ..moneycount --Draw the elements dxDrawRectangle(1184, 54, 134, 36, tocolor(0, 0, 0, 255), true) dxDrawRectangle(1185, 55, 132*(pHealth/200), 34, tocolor(255, 0, 0, 255), true) dxDrawRectangle(1184, 94, 134, 37, tocolor(0, 0, 0, 255), true) dxDrawRectangle(1185, 95, 132*(armor/100), 35, tocolor(0, 0, 255, 2555), true) dxDrawText("Armor "..armor.."%", 1229, 105, 1287, 120, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Health "..pHealth.."%", 1228, 62, 1287, 79, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(tostring (money), 1165, 28, 1350, 74, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText(tostring (money), 1165, 26, 1350, 72, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText(tostring (money), 1163, 28, 1348, 74, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText(tostring (money), 1163, 26, 1348, 72, tocolor(0, 0, 0, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) dxDrawText(tostring (money), 1164, 27, 1349, 73, tocolor(255, 255, 255, 255), 1.00, "pricedown", "left", "top", false, false, true, false, false) end )
  8. Not that, I mean with weapons slots he can carry 5 types(Melee, handgun, Sub-Machine Guns, Assault rifles and rifles) do you get what I mean?
  9. @Tete It's possible I saw it in a server, player can have only 5 weapons(knife,pistol,Uzi,m4,sniper) And @.:Hypex:. How?
  10. -.Paradox.-

    Question

    Hello, I have a question, is there a function/element that let the player can own only 5 weapon types?
  11. -.Paradox.-

    Shop

    Ah yeah thanks i forgot to add to client side
  12. -.Paradox.-

    Shop

    Hello, i made a shop panel, but i got an error, i can't find where is the error in my script, here is the code thanks ERROR: panel\client.lua:8: atempt to call global 'guiCreateWindow' (a nil value) GUIEditor = { gridlist = {}, window = {}, button = {} } GUIEditor.window[2] = guiCreateWindow(527, 227, 409, 336, "Shop ", true) guiWindowSetSizable(GUIEditor.window[2], false) guiSetAlpha(GUIEditor.window[2], 1.00) GUIEditor.gridlist[1] = guiCreateGridList(12, 27, 276, 299, false, GUIEditor.window[2]) guiGridListAddColumn(GUIEditor.gridlist[1], "Shop", 0.4) guiGridListAddColumn(GUIEditor.gridlist[1], "$", 0.4) for i = 1, 8 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Health", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "$1000", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Armor", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 2, "$1000", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "Repair Vehicle", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 2, "$1000", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "Jetpack", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 2, "$7600", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "Parachute", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 4, 2, "$500", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 1, "Night Vision Googles", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 5, 2, "$750", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 1, "Infrared Googles", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 6, 2, "$750", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 1, "Camera", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 7, 2, "$2000", false, false) GUIEditor.button[1] = guiCreateButton(295, 253, 104, 63, "Close", false, GUIEditor.window[2]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFFFFFF") GUIEditor.button[2] = guiCreateButton(295, 174, 103, 63, "Buy", false, GUIEditor.window[2]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFFFFFF") guiSetVisible(GUIEditor.window[2], false) showCursor(false) function enableShop() if guiGetVisible(GUIEditor.window[2]) == false then guiSetVisible(GUIEditor.window[2], true) showCursor(true) else guiSetVisible(GUIEditor.window[2], false) showCursor(false) end end addCommandHandler("shops", enableShop) function closeButton() guiSetVisible(GUIEditor.window[2], false) showCursor(false) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], closeButton, false ) addEventHandler("onClientGUIClick", guiRoot, function() if source == GUIEditor.button[2] then local row = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if row == 0 then triggerServerEvent("setMyHealth", localPlayer) elseif row == 1 then triggerServerEvent("setMyArmor", localPlayer) elseif row == 2 then triggerServerEvent("repairMyCar", localPlayer) elseif row == 3 then triggerServerEvent("giveMeJetpack", localPlayer) elseif row == 4 then triggerServerEvent("giveMeParachute", localPlayer) elseif row == 5 then triggerServerEvent("giveMeNight", localPlayer) elseif row == 6 then triggerServerEvent("giveMeInfrared", localPlayer) elseif row == 7 then triggerServerEvent("giveMeCamera", localPlayer) end end end)
  13. This is a simple example from my script, it will change all the hud(and blips)of youre server. Client side: local huds = { "arrow", "fist", "font1", "font2", "radardisc", "radarRingPlane", "radar_airYard", "radar_ammugun", "radar_barbers", "radar_BIGSMOKE", "radar_boatyard", "radar_bulldozer", "radar_burgerShot", "radar_cash", "radar_CATALINAPINK", "radar_centre", "radar_CESARVIAPANDO", "radar_chicken", "radar_CJ", "radar_CRASH1", "radar_dateDisco", "radar_dateDrink", "radar_dateFood", "radar_diner", "radar_emmetGun", "radar_enemyAttack", "radar_fire", "radar_Flag", "radar_gangB", "radar_gangG", "radar_gangN", "radar_gangP", "radar_gangY", "radar_girlfriend", "radar_gym", "radar_hostpital", "radar_impound", "radar_light", "radar_LocoSyndicate", "radar_MADDOG", "radar_mafiaCasino", "radar_MCSTRAP", "radar_modGarage", "radar_north", "radar_OGLOC", "radar_pizza", "radar_police", "radar_propertyG", "radar_propertyR", "radar_qmark", "radar_race", "radar_runway", "radar_RYDER", "radar_saveGame", "radar_school", "radar_spray", "radar_SWEET", "radar_tattoo", "radar_THETRUTH", "radar_TORENO", "radar_TorenoRanch", "radar_triads", "radar_triadsCasino", "radar_truck", "radar_tshirt", "radar_waypoint", "radar_WOOZIE", "radar_ZERO", "siteM16", "siterocket", "skipicon", } function replaceHuds() for key,hud in ipairs(huds) do texShader = dxCreateShader ( "shader/shader.fx" ) createdHud = dxCreateTexture("img/hud/"..hud..".png") dxSetShaderValue(texShader,"gTexture",createdHud) engineApplyShaderToWorldTexture(texShader,tostring(hud)) end end addEventHandler("onClientResourceStart", resourceRoot, replaceHuds) Shader.fx(important) texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } }
  14. Ah yeah sorry my bad, but the problem now is it dont create teams.
  15. Server triggered clientside event onLogin, but event is not added clientside Edit: Here is my login panel, if its possible, i want to dont spawn player when login until he select team, and once team is selected then he can play. thanks wdwLogin_Pannel = {} tabPannel_Main = {} tab_Login = {} blackLoginScreen = true blackScreenTime = 5 GuestEnable = true function open_log_reg_pannel() if not(isElement(wdwLogin_Pannel)) then if blackLoginScreen == true then fadeCamera(false,0,0,0,0) end local sWidth,sHeight = guiGetScreenSize() local Width,Height = 473,284 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) wdwLogin_Pannel = guiCreateWindow(X,Y,Width,Height,"Resident Evil Login",false) guiWindowSetSizable(wdwLogin_Pannel,false) tabPannel_Main = guiCreateTabPanel(9,23,455,251,false,wdwLogin_Pannel) tab_Login = guiCreateTab("Login",tabPannel_Main) lbl_Login = guiCreateLabel(103,72,42,19,"Login:",false,tab_Login) guiLabelSetVerticalAlign(lbl_Login,"center") guiLabelSetHorizontalAlign(lbl_Login,"right",false) guiSetFont(lbl_Login,"default-bold-small") edit_Login = guiCreateEdit(156,72,169,23,"",false,tab_Login) edit_password = guiCreateEdit(156,106,169,23,"",false,tab_Login) guiEditSetMaxLength ( edit_Login,22) guiEditSetMaxLength ( edit_password,22) guiEditSetMasked ( edit_password, true ) lbl_Password = guiCreateLabel(48,106,96,19,"Password:",false,tab_Login) guiLabelSetVerticalAlign(lbl_Password,"center") guiLabelSetHorizontalAlign(lbl_Password,"right",false) guiSetFont(lbl_Password,"default-bold-small") lbl_top_info = guiCreateLabel(0,0,473,35,"Please enter you're username/password ! Have fun",false,tab_Login) guiLabelSetColor(lbl_top_info,255,255,255) guiLabelSetVerticalAlign(lbl_top_info,"center") guiLabelSetHorizontalAlign(lbl_top_info,"center",false) lbl_about_legth = guiCreateLabel(142,42,184,18,"Max Length: 22 symbols",false,tab_Login) guiLabelSetColor(lbl_about_legth,255,255,255) guiLabelSetVerticalAlign(lbl_about_legth,"center") guiLabelSetHorizontalAlign(lbl_about_legth,"center",false) checkbox_save = guiCreateCheckBox(329,110,100,20,"(Save)",false,false,tab_Login) guiSetFont(checkbox_save,"default-small") btn_Login = guiCreateButton(164,162,147,41,"Login",false,tab_Login) guiSetFont(btn_Login,"default-bold-small") login_tab_error_msg = guiCreateLabel(31,131,419,25,"Error_login_tab",false,tab_Login) guiLabelSetColor(login_tab_error_msg,255,0,0) guiLabelSetVerticalAlign(login_tab_error_msg,"center") guiLabelSetHorizontalAlign(login_tab_error_msg,"center",false) guiSetFont(login_tab_error_msg,"default-bold-small") if GuestEnable == false then btnGuest = guiCreateButton(29,168,94,32,"Play as Guest",false,tab_Login) guiSetFont(btnGuest,"default-small") guiSetVisible(btnGuest,true) else if isElement(btnGuest) then guiSetVisible(btnGuest,false) end btnGuest = nil end tab_Register = guiCreateTab("Register",tabPannel_Main) lbl_account_name = guiCreateLabel(43,39,119,21,"Account Name:",false,tab_Register) guiLabelSetVerticalAlign(lbl_account_name,"center") guiLabelSetHorizontalAlign(lbl_account_name,"right",false) guiSetFont(lbl_account_name,"default-bold-small") lbl_reg_top_info = guiCreateLabel(66,5,364,31,"Please fill in all fields. Don't use any special characters.",false,tab_Register) guiLabelSetColor(lbl_reg_top_info,255,255,255) guiLabelSetVerticalAlign(lbl_reg_top_info,"center") guiLabelSetHorizontalAlign(lbl_reg_top_info,"center",false) edit_account_name = guiCreateEdit(172,40,176,23,"",false,tab_Register) guiEditSetMaxLength ( edit_account_name,25) lbl__reg_tab_password = guiCreateLabel(43,71,119,21,"Password:",false,tab_Register) guiLabelSetVerticalAlign(lbl__reg_tab_password,"center") guiLabelSetHorizontalAlign(lbl__reg_tab_password,"right",false) guiSetFont(lbl__reg_tab_password,"default-bold-small") edit__reg_tab_password = guiCreateEdit(172,71,176,23,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_password,25) edit__reg_tab_Repassword = guiCreateEdit(172,102,176,23,"",false,tab_Register) guiEditSetMaxLength ( edit__reg_tab_Repassword,25) lvl_reg_tab_Repassword = guiCreateLabel(43,102,119,21,"Repeat password:",false,tab_Register) guiLabelSetVerticalAlign(lvl_reg_tab_Repassword,"center") guiLabelSetHorizontalAlign(lvl_reg_tab_Repassword,"right",false) guiSetFont(lvl_reg_tab_Repassword,"default-bold-small") btn_reg_tab_register = guiCreateButton(153,161,174,42,"Confirm & register!",false,tab_Register) guiSetFont(btn_reg_tab_register,"default-bold-small") reg_tab_error_msg = guiCreateLabel(66,129,364,31,"Error_reg_ttab",false,tab_Register) guiLabelSetColor(reg_tab_error_msg,255,20,0) guiLabelSetVerticalAlign(reg_tab_error_msg,"center") guiLabelSetHorizontalAlign(reg_tab_error_msg,"center",false) guiSetFont(reg_tab_error_msg,"default-bold-small") guiSetVisible(wdwLogin_Pannel,true) -- guiSetInputMode("no_binds_when_editing") showCursor(true) guiSetText(reg_tab_error_msg, "") guiSetText(login_tab_error_msg, "") local username, password = loadLoginFromXML() if not( username == "" or password == "") then guiCheckBoxSetSelected ( checkbox_save, true ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) else guiCheckBoxSetSelected ( checkbox_save, false ) guiSetText ( edit_Login, tostring(username)) guiSetText ( edit_password, tostring(password)) end addEventHandler("onClientGUIClick",btn_Login,onClickBtnLogin) addEventHandler("onClientGUIClick",btn_reg_tab_register,onClickBtnRegister) if GuestEnable == true then addEventHandler("onClientGUIClick",btnGuest,onClickGuest) end -- else -- destroyElement(wdwLogin_Pannel) -- guiSetInputMode("no_binds_when_editing") -- wdwLogin_Pannel = nil -- showCursor(false) fadeCamera(source, true, 5) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) end end function start_cl_resource() open_log_reg_pannel() end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),start_cl_resource) addCommandHandler("loginpanel", start_cl_resource) function loadLoginFromXML() local xml_save_log_File = xmlLoadFile ("files/xml/userdata.xml") if not xml_save_log_File then xml_save_log_File = xmlCreateFile("files/xml/userdata.xml", "login") end local usernameNode = xmlFindChild (xml_save_log_File, "username", 0) local passwordNode = xmlFindChild (xml_save_log_File, "password", 0) if usernameNode and passwordNode then return xmlNodeGetValue(usernameNode), xmlNodeGetValue(passwordNode) else return "", ""
×
×
  • Create New...