Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 20/03/19 in all areas

  1. سكربت اكثر من رائع ,, بس كما قال الاخ تونسي حط فونت وصور عشان التصميم مهم في جلب الزوار للسيرفر بس انا مسوية بفكرة تانية عبر الشات يكتب كلمة معينة في الشات ويفوز بسااعات او فلوس على العموم استمر بطرح المودات الكفو ذي تحياتي ?
    1 point
  2. I was thinking about a situation where you have a stored BOOL inside the MySQL table and you either have its value (which can be true/false) or you don't, in which case you execute different code. I'm not in that situation yet but I was curious about this topic. I also understand that it's a very rare situation. Thanks for the answer.
    1 point
  3. Não sei ao certo, nunca mexi com isso, mas acho que uma framework daria pra fazer isso.
    1 point
  4. Recomendo fazer esse código no lado server.
    1 point
  5. Tente assim: function DeltaSCRFix () if getPedOccupiedVehicle(localPlayer) then outputChatBox ("╔═════════════════════════════════════════════════╗", 200, 50, 0) outputChatBox ("ERRO: #FFFFFFVocê usou seu Kit de Reparo com Sucesso", 200, 50, 0, true) outputChatBox ("╚═════════════════════════════════════════════════╝", 200, 50, 0) else outputChatBox ("╔═════════════════════════════════════════════════╗", 200, 50, 0) outputChatBox ("ERRO: #FFFFFFVocê precisa estar em um veículo para usar o Seguro", 200, 50, 0, true) outputChatBox ("╚═════════════════════════════════════════════════╝", 200, 50, 0) end end addCommandHandler ("seguro", DeltaSCRFix)
    1 point
  6. Existe um resource nativo no MTA que faz o player "dropar" os itens ao morrer chamado "deathpickups". E dai os itens ficam com os pickups no chão e o player que passar por ali pode pegar. Mas se vc quer mesmo criar um próprio, que não seja com pickups. Vc vai precisar de: onPlayerWasted addCommandHandler getPlayerMoney setPlayerMoney getPedWeapon giveWeapon Se você for usar um painel pra ver os itens do jogador: guiCreateWindow guiCreateGridList guiGridListAddColumn guiGridListAddRow guiCreateButton guiGridListGetSelectedItem guiGridListGetItemText onClientGUIClick Se você for mostrar os itens do jogador no chat: outputChatBox
    1 point
  7. A (local) table would probably not faster than a global variable. Because instead of doing 1 thing, you are actually doing 2 things. Requesting the local variable. Indexing in the table with a string. That is also the reason why OOP is not very fast. But as I said many times before, read-ability is also performance. If you want performance then please consider to only apply it selective at places in the code which are used a lot. (by for example a loop or onClientRender) If we look for example at the function callNextFrame: (shared: client/server) It is very well optimised. But not 100%. What would you want to improve of this code to optimise it to a 100%? local tableRemove = table.remove local serverSide = triggerClientEvent and true or false --[[ -- callNextFrame function ]] do local nextFrameCalls = {} local serverSideTimer local processing = false local function process () --[[ Do an empty check at the beginning of the function, this will make sure to make an extra run in case of heavy work load. If the timer is killed or the addEventHandler is removed, then this has to be re-attached again every frame. This is not very healthy... ]] if #nextFrameCalls == 0 then if serverSide then if serverSideTimer then if isTimer(serverSideTimer) then killTimer(serverSideTimer) end serverSideTimer = nil end else removeEventHandler("onClientRender", root, process) end processing = false return end -- In case of calling the function callNextFrame within the process, the loop type `repeat until` is required. repeat local item = nextFrameCalls[1] item.callback(unpack(item.content)) tableRemove(nextFrameCalls, 1) until #nextFrameCalls == 0 end function callNextFrame (callback, ...) if type(callback) == "function" then local newIndex = #nextFrameCalls + 1 nextFrameCalls[newIndex] = {callback = callback, content = {...}} if not processing then if serverSide then serverSideTimer = setTimer(process, 50, 0) else addEventHandler("onClientRender", root, process) end processing = true end return true end return false end end This code does: Moving a function call to the next possible frame. Example: callNextFrame(outputChatBox, "Hey next frame, I love you!")
    1 point
  8. Your code is a bit messy, I fixed a few typos that you had. Not gonna suggest SQL, it may be a bit more complex for you so for now just use accountData to save the ID. Player has to be logged in for this to work. Also added an extra function for when the player logs in, if the data was saved to their account it'll respawn on login. [[ Client ]] function finel () local item = guiGridListGetSelectedItem (myGirld) ID = guiGridListGetItemText (myGirld, item,3) body = guiGridListGetItemText (myGirld, item,4) rot = guiGridListGetItemText (myGirld, item,5) prices = guiGridListGetItemText (myGirld, item,2) triggerServerEvent( "give",localPlayer, localPlayer, prices,ID,body,rot) showCursor(false) destroyElement(window) end addEventHandler("onClientGUIClick", buying, finel) [[ Server ]] local obj = {} function maske_kaldir2(plr,pay,id,bdy,rot) local money = getPlayerMoney(plr) if (money > tonumber (pay)) then local account = getPlayerAccount(plr) if (not account) then return end setAccountData(account, "objectID", id) takePlayerMoney (plr,(pay)) obj[plr] = createObject ( id, 0, 0, 0, 0, 0, 0 ) exports.bone_attach:attachElementToBone(obj[plr],plr,1,0,0,-0.61,0,0,90) else outputChatBox ("You dont have Money" ,plr ,255,0,0) end end addEvent("give",true) addEventHandler("give", root, maske_kaldir2) addEventHandler("onPlayerLogin", root, function() if (isElement(source) and getElementType(source) == "player") then if (getPlayerAccount(source)) then local account = getPlayerAccount(source) local object = getAccountData(account, "objectID") if (object) then obj[source] = createObject ( object, 0, 0, 0, 0, 0, 0 ) exports.bone_attach:attachElementToBone(obj[source],source,1,0,0,-0.61,0,0,90) outputChatBox("Object given", source, 255, 0, 0) end end end end )
    1 point
  9. You could use the following functions/events > (Event) -> onClientClick -> Returns: you'll need to identify the clickedElement as the type of GUI you want to move button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement Instead of the above you could use: (Event) -> onClientGUIClick -> which returns the clicked GUI element rather than an element clicked -> returns: button, state, absoluteX, absoluteY (Event) -> onClientCursorMove -> Returns: use absoluteX, absoluteY as your X / Y params needed to move. cursorX, cursorY, absoluteX, absoluteY, worldX, worldY, worldZ (Function) -> guiSetPosition() -> usage: guiSetPosition(clickedElement, absoluteX, absoluteY, false) Use onClientRender/onClientPreRender to render the moving transition of the element you're moving. Not sure if this is the best way, but most simple. Goodluck
    1 point
  10. == Igual >= Maior ou igual <= Menor ou igual > Maior < Menor Acho que você quis verificar se é maior ou igual, e ali no código tá menor ou igual.
    1 point
  11. Na verdade não precisa de localPlayer no cliente pra essa função. Isto já basta: if getPlayerMoney() <= 750 then Na própria wiki tem essa informação.
    1 point
  12. Pelo cliente if getPlayerMoney (localPlayer) <= 750 then
    1 point
  13. Hopefully removing its stolen content.
    1 point
  14. Sinceramente, el panel y sus funcionalidades, igual que el diseño están MUY guapas. Gran trabajo amigo. Por poner una pega, porque soy así de gracioso, cuando le das a algún botón de comprar o añadir miembro al team o quitar o cosas asi, hasta que no le das refresh no sabes si al darle al botón te ha funcionado. Podrías crear una especie de notificación donde te lance un mensaje cuando haces alguna operación como "Has añadido a X al team" o "Has comprado X cosa", no sé, algo asi. También debajo de la hora y eso del main menu, poder ver el dinero que tienes para gastar. Pero ya te digo man, al menos a mí personalmente me ha gustado.
    1 point
  15. أ، ب، ت، ث، ج، ح، خ، د، ذ، ر، ز، س، ش، ص، ض، ط، ظ، ع، غ، ف، ق، ك، ل، م، ن، هـ، و، ي تصير لي جارية ؟
    1 point
  16. الله يباركلك تسلم يا غالي. (من علمنى حرفا صرت لهو عبدا)
    1 point
  17. QUEUE IN CHAT COMMANDS /skip - Skip current sound /queue - Show queue sounds list BINDS F10 - Open the panel F7 - Preview Sound M - Switch to sounds Price: [SELLED]
    0 points
  18. function toggleLightflash() local veh = getPedOccupiedVehicle(localPlayer); if (veh) then if not (getElementData(veh, "lightFlash:color")) then setElementData(veh, "lightFlash:color", (0, 0, 255), false); end local isLightFlashing = getElementData(veh, "lightFlash"); if (isLightFlashing) then setVehicleOverrideLights(veh, 0); local lightTimer = getElementData(veh, "lightFlash:timer"); killTimer(lightTimer); setElementData(veh, "lightFlash", false, false); setVehicleLightState(veh, 0, 0); setVehicleLightState(veh, 1, 0); setVehicleHeadLightColor(veh, 255, 255, 255); else setVehicleOverrideLights(veh, 2); setElementData(veh, "lightFlash:state", false, false); local lightFlashTimer = setTimer(function() local flashState = getElementData(veh, "lightFlash:state"); local lightColor = getElementData(veh, "lightFlash:color"); if (lightColor[1] == 255) then lightColor[1], lightColor[2], lightColor[3] = 0, 0, 255; else lightColor[1], lightColor[2], lightColor[3] = 255, 0, 0; end setVehicleHeadLightColor(veh, lightColor[1], lightColor[2], lightColor[3]); if (flashState) then setVehicleLightState(veh, 0, 0); setVehicleLightState(veh, 1, 1); else setVehicleLightState(veh, 0, 1); setVehicleLightState(veh, 1, 0); end setElementData(veh, "lightFlash:color", lightColor, false); setElementData(veh, "lightFlash:state", not flashState, false); end, 250, 0); setElementData(veh, "lightFlash:timer", lightFlashTimer, false); setElementData(veh, "lightFlash", true, false); end end end bindKey("l", "down", toggleLightflash);
    0 points
×
×
  • Create New...