Jump to content

yMassai

Members
  • Posts

    382
  • Joined

  • Last visited

Everything posted by yMassai

  1. I want it displayed on the button
  2. guiCreateButton(0.005, 0.100, 0.6, 0.130, "Veiculo :" "the name of vehicle", true, theWindow, 255, 0, 0)
  3. I edited the panel and arranged the way I wanted, how could I get the name of the player's vehicle in the panel?
  4. Gui S addEvent ("carSpawn", true) addEvent ("carDestroy", true) function carSpawn () if not (isGuestAccount (getPlayerAccount (source))) and not (isPedInVehicle(source)) then if (getElementData (source, "hisCar")) and (getElementData (source, "hisCar") ~= nil) and (getElementType(getElementData (source, "hisCar")) == "vehicle") then setElementVelocity (getElementData (source, "hisCar"), 0,0,0) local x,y,z = getElementPosition (source) setVehicleRotation (getElementData (source, "hisCar"), 0, 0, 0) setElementPosition (getElementData (source, "hisCar"), x+2,y,z +1) outputChatBox ("Car spawned.", source, 255, 0, 0) elseif not (getElementData (source, "hisCar")) then local accountData = getAccountData (getPlayerAccount (source), "funmodev2-car") if (accountData) then carID = getAccountData (getPlayerAccount (source), "funmodev2-car") x,y,z = getElementPosition (source) vehicle = createVehicle (carID, x +2, y, z +1) setElementID (vehicle, getAccountName (getPlayerAccount(source))) setElementData (source, "hisCar", vehicle) outputChatBox ("Car spawned.", source, 255, 0, 0) if (getAccountData (getPlayerAccount(source), "funmodev2-carupg")) then local upgrades = nil local upgrades = {} local upgrades = getAccountData (getPlayerAccount(source), "funmodev2-carupg") for i,v in ipairs (upgrades) do addVehicleUpgrade (vehicle, v) end end if (getAccountData (getPlayerAccount(source), "funmodev2-paintjob")) then local paintjob = getAccountData (getPlayerAccount(source), "funmodev2-paintjob") setVehiclePaintjob (vehicle, paintjob) end if (getAccountData (getPlayerAccount(source), "funmodev2-carcolor1")) and (getAccountData (getPlayerAccount(source), "funmodev2-carcolor2")) then local c1 = getAccountData (getPlayerAccount(source), "funmodev2-carcolor1") local c2 = getAccountData (getPlayerAccount(source), "funmodev2-carcolor2") setVehicleColor (vehicle, c1,c2,0,0) end else outputChatBox ("You haven't got a car.", source, 255, 0, 0) end else outputChatBox ("You're already in a car!", source, 255, 0, 0) end end end addEventHandler ("carSpawn", getRootElement(), carSpawn) function carDestroy () if not (isGuestAccount (getPlayerAccount (source))) then if (isPedInVehicle (source)) then if (getElementID(getPedOccupiedVehicle(source)) == getAccountName (getPlayerAccount(source))) then setElementHealth (getElementData (source, "hisCar"), 0) destroyElement (getPedOccupiedVehicle (source)) removeElementData (source, "hisCar") outputChatBox ("Car Destroyed.", source, 255, 0, 0) else outputChatBox ("This not your car!", source, 255, 0, 0) end elseif (not (isPedInVehicle (source))) and (getElementData (source, "hisCar")) and (getElementData (source, "hisCar") ~= nil) then setElementHealth (getElementData (source, "hisCar"), 0) outputChatBox ("Car Destroyed.", source, 255, 0, 0) removeElementData (source, "hisCar") end end end addEventHandler ("carDestroy", getRootElement(), carDestroy) addEventHandler ("onVehicleExplode", getRootElement(), function() local theOwner = getAccountName (getPlayerAccount(getPlayerFromName (getElementID (source)))) if (theOwner) then removeElementData (theOwner, "hisCar") end end) addEventHandler ("onPlayerQuit", getRootElement(), function(quitType, reason, responsibleElement) if (getElementData (source, "hisCar")) then blowVehicle (getElementData (source, "hisCar")) removeElementData (source, "hisCar") end end) addEventHandler( "onResourceStop", getResourceRootElement( getThisResource() ), function () for i,v in ipairs (getElementsByType ("player")) do if (getElementData (v, "hisCar")) then setElementHealth (getElementData (v, "hisCar"), 0) removeElementData (v, "hisCar") end end end ) function destroyOnExplode () setTimer (destroyElement, 2500, 1, source) end addEventHandler ("onVehicleExplode", getRootElement(), destroyOnExplode) gui GUIEditor_Label = {} theWindow = guiCreateWindow(600,200,200,70,"Car Features",false) guiWindowSetSizable(theWindow,false) guiSetVisible (theWindow, false) guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"default-bold-small") spawnBut = guiCreateButton(0.0604,0.320,0.4,0.6,"Spawn",true,theWindow) destroyBut = guiCreateButton(0.490,0.320,0.4,0.6,"Destroy",true,theWindow) function resourceStart () bindKey ("F3", "down", menuShow) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end addEvent ("carSpawn", true) addEvent ("carDestroy", true) function guiClick (button, state, absoluteX, absoluteY) if (source == spawnBut) then triggerServerEvent ("carSpawn", getLocalPlayer()) elseif (source == destroyBut) then triggerServerEvent ("carDestroy", getLocalPlayer()) end end addEventHandler ("onClientGUIClick", getRootElement(), guiClick) this https://community.multitheftauto.com/index.php?p=resources&s=details&id=2604 This script is basic and good. But I would like to edit some things but not know how. We can see that in the "F3", vehiculo is destroyed. I would ask someone to swap to disappear and not destroy. I also ask someone colocase button to lock and unlock the vehicle "F3", do an identification vehicle, and a button to sell the vehicle. This script has a flaw, it allows them to buy several cars and does not save the last. I would ask that only had room for three cars.
  5. yMassai

    Advertisements

    Hello I came here to post one big complaint. You can visualize the https://community.multitheftauto.com/ These new ads will certainly generate some profit for the site? apparently does not disturb anything in this announcement, but see clearly the link https://community.multitheftauto.com/index.php?p=gallery&s=show&pic=5435 These ads hinder the viewing of images. I propose to put the ads at the bottom of pages.
  6. yMassai

    Need Help

    we can use the locations x, y, z to name one example.
  7. yMassai

    Need Help

    hello someone could help me create a simple script? the script I would like to create is simple, every vehicle that is destroyed or falls into the water going into the parking lot closer. someone could help me?
  8. yMassai

    buy skin

    u go put for download this script?
  9. yMassai

    Skin take

    Omg not work! Maybe a error in create the pickup...
  10. yMassai

    Skin take

    you test online?
  11. yMassai

    Skin take

    <meta> <info author="Ninguem" name="test" version="1.0.0" type="script"/> <script src="weapon.lua" type ="server"/> </meta>
  12. the server must be detecting the same IP.
  13. yMassai

    Skin take

    lockSkins = { [287] = true, [121] = true } -- sets the lock skins function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies if ( lockSkins[getElementModel ( player )] ) and ( seat == 0 ) then local x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z local currentweapon = getPedWeapon ( source ) --get the current weapon of the dead person createPickup ( 1540.5999755859, -1660.9000244141, 13.60000038147, 2, 30, 10000, 1000 ) else outputChatBox ( "*Só militares podem pegar esta arma.", player, 255, 00, 00) --info in chatbox end end addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted Not Work
  14. yMassai

    Skin take

    function createDeathPickup ( totalammo, killer, killerweapon, bodypart ) --when a player dies x, y, z = getElementPosition ( source ) --get the position of the person who died and define it as x, y and z currentweapon = getPlayerWeapon ( source ) --get the current weapon of the dead person createPickup ( x, y, z, 2, currentweapon, 10000, totalammo ) end lockSkins = { [287] = true ; [121] = true ; } -- sets the lock skins if ( not lockSkins[getElementModel ( player )] ) and ( seat == 0 ) then utputChatBox ( "*Você não pode pegar esta arma.", player , 255, 00, 00) --info in chatbox addEventHandler ( "onPlayerWasted", getRootElement(), createDeathPickup ) --add an event handler for onPlayerWasted maybe?
  15. yMassai

    Skin take

    function pickupUse ( thePlayer ) outputChatBox ( getPlayerName ( thePlayer ) .. " picked up a pickup!" ) end addEventHandler ( "onPickupUse", getRootElement(), pickupUse ) this?
  16. yMassai

    Skin take

    I wanted to create a weapon in a certain place, I would like what only a skins can get the gun.
  17. yMassai

    Skin take

    Could anyone support me? I would like to create a weapon that can take only a few skins.
  18. yMassai

    Not Working

    where I could learn my own syntax?
  19. yMassai

    Medic Change

    I tested the script with other players. I noticed a problem. sprey can also take the life of the players, but i not know how. can anyone help me?
  20. As you know I arrecem starting to make scripts, I hope not be upset , i ask all.
  21. SetTimer (setPlayerWantedLevel, 60000, 0, PLA, 0) or SetTimer (setPlayerWantedLevel, 60000, 0, PLA, 1) ??
  22. SetTimer (setPlayerWantedLevel, 60000, 1, PLA, 0) ?
  23. g_base_col = createColCuboid ( 97.3376, 1800.0384, -32.0937, 250, 280, 120 ) g_root = getRootElement () --rocketOne = createMarker ( -2931.5136, 454.4492, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker --rocketTwo = createMarker ( -2931.5932, 487.1994, 17.3671, "corona", 9.5, 255, 0, 0, 150 ) --test marker function hit ( pla, dim ) if getElementType ( pla ) == "player" then local vehicle = getPlayerOccupiedVehicle ( pla ) if vehicle or not vehicle then local skin = getPlayerSkin ( pla ) if ( skin == 287 or skin == 286 ) then setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) outputChatBox ( "***Restricted Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getClientName(pla).." has entered Restricted Area!", g_root, 255, 0, 0 ) setPlayerWantedLevel(pla,1) setTimer ( setPlayerWantedLevel, 60000, 1, pla, 1 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) this?
×
×
  • Create New...