Jump to content

Stranger

Members
  • Posts

    710
  • Joined

  • Last visited

Everything posted by Stranger

  1. hey guys. i just want to know if there any way to make the memo save more than 128 character ? cause i have make a save text system, which will save the texts in the memo but i have this problem that if i wrote more than 128 character and press save and close it and open it most of the word that i have wrote it , gone !!! so i wanna know if there any way to make it save more than 128 character.
  2. no , it's not work , it's save when player quit and join but when someone died his weapon disappear.
  3. the first problem solved, but the 2nd problem still. which if someone died his weapon disappear.
  4. i meant , if you bought 100 of ammo, and you quit and login your ammo become more than 100 , it's just like gonna be 200 or maybe 500 just like that, and every time you quit and login your ammo become more and more and more until no end, and if you die, your weapon disappear. i don't know where is the problem, so help.
  5. hello, i have a problem in this code: function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money") local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local playerX = getAccountData (theCurrentAccount, "funmodev2-x") local playerY = getAccountData (theCurrentAccount, "funmodev2-y") local playerZ = getAccountData (theCurrentAccount, "funmodev2-z") local playerInt = getAccountData (theCurrentAccount, "funmodev2-int") local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) setPlayerMoney (source, playerMoney) setTimer (setElementHealth, 500, 1, source, playerHealth) setTimer (setPedArmor, 500, 1, source, playerArmor) setTimer (setPlayerWantedLevel, 500, 1, source, playerWanted) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) setCameraTarget (source, source) fadeCamera(source, true, 2.0) else spawnPlayer ( source, 213.36328+math.random(1,3), 1867.44336+math.random(1,3), 13.14062, 0, 285, 0, 0) setPlayerMoney (source, 10000) setCameraTarget (source, source) fadeCamera(source, true, 2.0) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local x,y,z = getElementPosition (source) local r,g,b = getPlayerNametagColor (source) setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source))) setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source))) setAccountData (account, "funmodev2-health", tostring (getElementHealth (source))) setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source))) setAccountData (account, "funmodev2-x", x) setAccountData (account, "funmodev2-y", y) setAccountData (account, "funmodev2-z", z) setAccountData (account, "funmodev2-int", getElementInterior (source)) setAccountData (account, "funmodev2-dim", getElementDimension (source)) setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0)) setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1)) setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2)) setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3)) setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4)) setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5)) setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6)) setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7)) setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, -- s8) -->) setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9)) setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10)) setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11)) setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12)) setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, -- s8) -->) setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12)) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) addEventHandler ("onPlayerJoin", root, function () spawnPlayer(source, 213.36328+math.random(1,3), 1867.44336+math.random(1,3), 13.14062, 0, 285, 0, 0) end) addEventHandler ("onPlayerWasted", root, function () setTimer (spawnPlayer, 3000, 1, source, 213.36328+math.random(1,3), 1867.44336+math.random(1,3), 13.14062, 0, getElementModel (source), 0, 0) setTimer (setCameraTarget, 3250, 1, source, source) end) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) end ) function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end function check () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) setTimer (function () check () end, 4000, 1) end end addEventHandler ("onPlayerSpawn", root, check) which if someone bought a gun let's say 100 of ammo every time he quit and login his ammo become more than 100 so can someone help me ?
  6. Stranger

    [Question]

    I'll take your advice, and i will try. thanks any way, "TAPL", "xXMADEXx".
  7. Stranger

    [Question]

    oh, will it's hard for me, but is there any other way to do it by "accountData" ?
  8. Stranger

    [Question]

    do you mean like table.insert
  9. Stranger

    [Question]

    hey, i was wondering how to make the grid list save more than 1 car, i have make a cars shop, and it's work just fine, but there is a little problem , the problem is in the 'save' i make it if someone login, the cars that he bought before all show into the list it's work but only shows one car but i bought 3 cars, but only one shows. Server side: addEventHandler ("onPlayerLogin", root, function (thePreviousAccount, theCurrentAccount, autoLogin) if not isGuestAccount (getPlayerAccount (source)) then car = getAccountData (theCurrentAccount, "MyCar") if car then carName = getVehicleNameFromModel (car) triggerClientEvent (source, "getItBack", source, carName) end end end) Client side: addEvent ("getItBack", true) addEventHandler ("getItBack", root, function (veh) row = guiGridListAddRow (grid) guiGridListSetItemText (grid, row, 1, veh, false, false) end) So, Help.
  10. Thanks guys for the help, but i fixed, the problem was in the trigger.
  11. I know that there is a problem in this code, so I came here to find a solution here, because I do not know where the error.
  12. hello, i have a problem in this code: addEventHandler ("onClientGUIClick", root, function () if source == giv then row, co = guiGridListGetSelectedItem(pl) row2, co2 = guiGridListGetSelectedItem(ve) select = guiGridListGetItemText(pl, row, co) selectt = guiGridListGetItemText(ve, row2, co2) if select and select ~= "" and selectt ~= "" then local pla = getPlayerFromName(select) if pla then triggerServerEvent ("giveH", getVehicleModelFromName (selectt), pla) end end end end) server side: vehh = { } addEvent ("giveH", true) addEventHandler ("giveH", root, function (vehID, plr) if isElement (vehh[plr]) then destroyElement (vehh[plr]) vehh[plr] = nil end local x,y,z = getElementPosition (plr) vehh[plr] = createVehicle (vehID, x,y,z) warpPedIntoVehicle (plr, vehh[plr]) end) that when i click the button "give" the debug says: WARNING: test\server.lua:8: Bad argument @ 'createVehicle' [Expected number at argument 4, got nil] WARNING: test\server.lua:9: Bad argument @ 'warpPedIntoVehicle' so, help.
  13. hello, i need a help in this code that, i can't make it add more than one admin on the list i don't know the problem i want it If the player is logged in and the player an admin then he will be added to the list of online admin it work but not showing more than one and if he logged out his name still in the list so , help. the code client side: adm = false addEvent ("heAdmin", true) addEventHandler ("heAdmin", root, function () adm = true end) addEvent ("notAdmin", true) addEventHandler ("notAdmin", root, function () adm = false end) function as () guiSetVisible(staf,not guiGetVisible(staf)) showCursor(not isCursorShowing()) if (adm == false) then guiGridListClear (gstaf) setTimer (function () local row = guiGridListAddRow ( gstaf ) guiGridListSetItemText ( gstaf, row, co, "No admin online", false, false ) guiGridListSetItemColor(gstaf, row, co, 255, 0,0, 255) guiGridListSetItemText ( gstaf, row, co2, "Offline", false, false ) guiGridListSetItemColor(gstaf, row, co2, 255, 0,0, 255) end, 50,1) else local row = guiGridListAddRow ( gstaf ) if adm == true then for k,v in ipairs (getElementsByType ("player")) do guiGridListSetItemText ( gstaf, row, co, getPlayerName (v), false, false ) guiGridListSetItemColor(gstaf, row, co, 0, 100,255, 255) guiGridListSetItemText ( gstaf, row, co2, "Online", false, false ) guiGridListSetItemColor(gstaf, row, co2, 0, 255,0, 255) end end end end bindKey ( "F10" , "down" , function() guiGridListClear (gstaf) setTimer (function () as () end, 50,1) end ) code server side: function Admins() if hasObjectPermissionTo ( source, "command.mute", true ) then if eventName == "onPlayerLogin" then triggerClientEvent ("heAdmin", source) elseif eventName == "onPlayerLogout" then triggerClientEvent ("notAdmin", source) elseif eventName == "onPlayerQuit" then triggerClientEvent ("notAdmin", source) end end end addEventHandler( "onPlayerLogin", getRootElement(), Admins ) addEventHandler( "onPlayerLogout", getRootElement(), Admins ) addEventHandler( "onPlayerQuit", getRootElement(), Admins ) setTimer (Admins, 500, 0)
  14. Stranger

    [Question]

    i did unbind it but it still show
  15. Stranger

    [Question]

    hello, i always seen this message when i click 'j' button, i don't know where it come from does anyone knows where it come from ? Debes estar manejando un vehiculo para usar este comando. which mean You must be driving a vehicle to use this command.
  16. will, thanks for your help, but this is not what i meant,i will try to tell you what i meant in easy way , ok i meant if there is a timer ok ? and the timer not work if the player out of the car, if he enterd the car , the timer will start, but if he exit from the vehicle, the timer stop, and this i can use to make like what i said now, 'onVehicleEnter', 'onVehicleExit' setTimer .. killTimer .. ok ? but i want it if the player in the vehicle and lit's say an admin destroyed the vehicle ok ? how to make the timer stop ? if the vehicle destroyed and the player in the vehicle the timer will keep going not gonna stop until i restart the mode, so i hope that what I have said to you very clear.
  17. https://wiki.multitheftauto.com/wiki/Se ... idableWith
  18. i said, that if the player entered the vehicle, and there is a timer, the timer will work , but if he go out the vehicle the timer stop, i want it if the vehicle destroyed the timer stop. i make like that but not working: setTimer (function (source) veh = getPedOccupiedVehicle (source) if veh then if isElement (veh) and not isPedInVehicle (source) then killTimer (timer[source]) timer[source] = nil end end end, 2000, 0)
  19. will i tried, but not work: setTimer (function () local vehicle = getPedOccupiedVehicle (source) if not isElement (vehicle) and not isPedInVehicle (source) then killTimer (timer[source]) timer[source] = nil end end, 3000, 0)
  20. hey guys, i was wondering how if i was in a vehicle , and i make code that if the player enter the vehicle, the code will work if he exit not work, but how to make it if the vehicle destroyed not work ?
  21. ohhh sorry that i forgot 'root', thank you, i will try it now. ------- yesh it's work, thank you...
×
×
  • Create New...