Jump to content

KariiiM

Members
  • Posts

    1,312
  • Joined

  • Last visited

Everything posted by KariiiM

  1. Try something and we'll help, i see like you want a full code, like that you'll not learn
  2. Here you go, i did this part for you it will get the player's team if the resource stopped , now you have to get the element data to your code function saveTeam() for index, vTeam in pairs(getElementsByType("player")) do if (getPlayerTeam(vTeam)) then local aTeam = getTeamName(getPlayerTeam(vTeam)) setElementData(vTeam,"setTeam",tostring(aTeam)) end end end addEventHandler("onResourceStop", getRootElement(),saveTeam)
  3. There's a resource named server is not running ,run it or remove it from the script if it's not important
  4. In client side no need to add double targets, just one target and it's the localPlayer
  5. KariiiM

    Killed by

    It's server sided ,be sure you added it as server side in the meta
  6. Learn the basic of LUA and read more about these functions by reading the examples in the wiki, that's only if you want to learn something
  7. KariiiM

    Killed by

    It should works, it will tell you that you dead if you killed yourself by yourself, or be sure some one is killed you as JR10 said
  8. Great to hear that, also do what i told you in my 2nd post it, to check after killing the bot if he exist then destroy it to avoid bugs
  9. KariiiM

    Killed by

    Be sure next time before post the code it will be great
  10. KariiiM

    Killed by

    Fist, what you did is gonna send erros plus will not output the message to the player who dead and who killed Here is the right way to do this killed by script function outPutKillerName( _, killer) if ( killer and getElementType ( killer ) == "player" and killer ~= source ) then outputChatBox( getPlayerName(source).." died from hands of "..getPlayerName(killer) ) else outputChatBox ( getPlayerName(source).." died." ) end end addEventHandler( "onPlayerWasted", root, outPutKillerName )
  11. Put the part where the error exist
  12. You need to add access in the ACL.xml
  13. It's not possible i tried it too, to be sure ask some MTA developers
  14. What you gave him have no sense, also ss is not defined in your code and if you want to check if the user of an cmd is in the ACL or not with more than group, simply do like that, be sure the group name is in the ACL or you'll get a Warning on the debugscript. addCommandHandler("commandName", function (player) if ( getElementType ( player ) == "player" ) then --Checking for the player who used the cmd is a player or not. local accountName = getAccountName(account) --Using the logical "or" exept of elseif IN this situation no need for elseif if ( isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "SuperModerator" ) ) or isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) ) then --Your code end end end)
  15. Thanks for the reply, that's what i want to hear !
  16. Hey guys, I have a simple question , i just want to be sure of it The question is, if i make a window "Relative" no need to get the screen resolution in this case? -Example: guiCreateWindow(0.37, 0.32, 0.22, 0.33, "", true) ~Thanks in advance Regards, KariM
  17. You ask for help, and after you get it, you just remove the topic so if someone has the same problem, he can't look for help? That's the worst behaviour you can do. I'm sorry, If you keep doing like that, next time people will not help you i hope you can understand
  18. You're welcome, i just help for help not for being something and glad to hear that from you
  19. KariiiM

    Problem

    function timer () newValue = + 0.05 local settime = setElementData(source, "Rep", newValue) setTimer(settime ,60000, 0) end
  20. It's possible, So you mean by saying "password" in this case, to do a custom words / numbers like an captcha it output in the chat the time you hit the pickup for example,if you typed it right then you'll use the skin if not then you will not wear the skin?
  21. You want to use the addCommandHandler event,Oks but what do you mean by password some skins? Like letting them only for Staffs/ VIP players or someone else? About your first question, yes there's a way, if i understood you well, you want when you hit the pickup it don't set the skin automaticly but by an command? and you've to be inside this pickup to let the command working if not ,then explain more well !
  22. Hey Rands, As i promised you to solve this , so yeah tonight i was with free time and i focused on your problem, i remade the whole of the code as i cleaned it from bugs. what you post last time was totally messy and with alot of bugs ,i made a FULL code with all the features that you want and what you need so you have just to edit the names and the custom price of sell event in server side it works like 2k for each rocket, so now the code is with 0 ERROR and safe plus features, i hope that i helped you. --Copy the code, carefully! --Client side: local sx, sy = guiGetScreenSize() local client = getLocalPlayer() local window = guiCreateWindow((sx-344)/ 2, (sy-191)/ 2, 344, 191, "RPG dealer", false) guiSetVisible (window, false) guiWindowSetSizable(window,false) local memo = guiCreateMemo(9, 18, 326, 77, "Welcome to RPG dealer, here you can buy and sell RPGs, press at the button buy to buy rockets and sell to sell rockets and you'll get money for each rocket you sold to the dealer.", false, window) local buyrpg = guiCreateButton(9, 152, 139, 25, "Buy RPG (50Rockets)", false, window) local sellrpg = guiCreateButton(9, 123, 139, 25, "Sell RPG", false, window) local closewin = guiCreateButton(160, 123, 168, 55, "Close window", false, window) local label = guiCreateLabel(14, 97, 117, 20, "100 RPGs for: $100,000", false, window) guiSetFont(label, "default-bold-small") guiLabelSetColor(label, 254, 254, 254) addEvent("dealerGUI",true) addEventHandler("dealerGUI",root, function () if ( not guiGetVisible(window)) then guiSetVisible(window,true) showCursor(true) end end) addEventHandler ("onClientGUIClick", root, function () if (source == closewin) then guiSetVisible(window,false) showCursor(false) elseif (source == buyrpg) then guiSetVisible(window,false) showCursor(false) triggerServerEvent("dealer_buy_rpg",client,client) elseif (source == sellrpg) then guiSetVisible(window,false) showCursor(false) triggerServerEvent("dealer_sell_rpg",client,client) end end) addEventHandler("onClientPedDamage",getRootElement(), function () if getElementData(source,"myped") then cancelEvent() end end) --Server side: local myTable = { --skinID, x, y, z, rotation, weapons {113, -2151.9, -136.9, 36.5, 280, 31}, } addEventHandler("onResourceStart", resourceRoot, function () for index, v in pairs(myTable) do local theMarker = createMarker(v[2], v[3], v[4]-1, "cylinder", 1.5, 255, 255, 255, 50) local ped = createPed (v[1], v[2], v[3], v[4], v[5]) local blip = createBlip( v[2], v[3], v[4], 34, 2, 0, 0, 255 ) setElementVisibleTo(blip, root, true) setElementData(ped, "myped", true) giveWeapon( ped, v[6], 9999, true ) setElementFrozen ( ped, true ) --setTimer(setPedAnimation, 3000, 0, ped,"ped", "WOMAN_walknorm") addEventHandler("onMarkerHit",theMarker,MarkerHitS) end end) function MarkerHitS(player, matchingDim) if (player and matchingDim and getElementType(player) == "player" and not isPedInVehicle(player)) then triggerClientEvent(player,"dealerGUI",player) end end --Buy RPG addEvent( "dealer_buy_rpg", true ) addEventHandler("dealer_buy_rpg", getRootElement(), function (client) local money = getPlayerMoney (client) if ( money < 100000 ) then outputChatBox("RPG Dealer: You need $100,000 to buy RPGs from the dealer.", client, 255,0,0) else takePlayerMoney( client, 100000) giveWeapon(client, 35, 50 ) outputChatBox("RPG Dealer: Successfully you bought 50 rockets of RPG.", client, 255,0,0) end end) --Sell RPG addEvent( "dealer_sell_rpg", true ) addEventHandler("dealer_sell_rpg", getRootElement(), function () local totalammo = getPedTotalAmmo ( source ) local weaponPrice = 2000 local price = tonumber(totalammo)*tonumber(weaponPrice) if ( totalammo >= 50) then setPedWeaponSlot ( source, 35, true ) givePlayerMoney(source, tonumber(price)) takeWeapon (source, 35, tonumber(totalammo)) outputChatBox("RPG Dealer: Successfully i've bought "..tonumber(totalammo).." Rockets from you for $"..tonumber(price).." ,Thank you!", source, 0, 255, 0) else outputChatBox("RPG Dealer: Show your RPGs if you want to sell them.",source,255,0,0) end end) -Regards, KariM
  23. You can design or use an public pictures not leaked ones then you're welcome
×
×
  • Create New...