Jump to content

Chaos

Members
  • Posts

    300
  • Joined

  • Last visited

Everything posted by Chaos

  1. i think you mean something like this function onKill() timer1 = setTimer(function() setElementData(localPlayer,"peace",true) outputChatBox("peace is on !") end,3000,1) end addCommandHandler( "peace", onKill) function abortAllStealthKills(targetPlayer) if getElementData(targetPlayer,"peace") == true then cancelEvent() end end addEventHandler("onClientPlayerStealthKill", root, abortAllStealthKills)
  2. everyone have a way so i prefer my way
  3. if there are many vehicles then you have to use a table . x,y,z position of the vehicle and 519 is the car id.
  4. try this veh = createVehicle( 519, 0, 0, 3) function privateCar (thePlayer) if source == veh then local playerTeam = getPlayerTeam ( thePlayer ) local Clann = getTeamFromName ( "Your Team name" ) if ( playerTeam ) == Clann then outputChatBox ( "Welcome to your private car.", thePlayer, 0, 255, 0 ) else cancelEvent () outputChatBox ( "This this a private car.", thePlayer, 255, 0, 0 ) end end end addEventHandler ( "onVehicleStartEnter", root,privateCar )
  5. i tried this but it seems not working function onKill() timer1 = setTimer(function() addEventHandler("onClientPlayerStealthKill",root,abortAllStealthKills) end,3000,1) end addCommandHandler( "peace", onKill) function abortAllStealthKills(targetPlayer) if ( targetPlayer == localPlayer ) then outputChatBox("should now no one can kill you with a knife") cancelEvent() end end
  6. Castillo but i need it abort stealthkill only for me that's mean others can get kill by knife
  7. hey, i have a question why this won't abort knife kill when some one trying to kill me ? function onKill() timer1 = setTimer(function() addEventHandler("onClientPlayerStealthKill",localPlayer,abortAllStealthKills) end,20000,1) end addCommandHandler( "peace", onKill) function abortAllStealthKills(targetPlayer) cancelEvent() end
  8. Chaos

    Memo

    hey, i want to get all accounts in memo but its load only one account function printAmountOfAccounts ( thePlayer ) local accountTable = getAccounts () -- return the table over accounts if #accountTable == 0 then -- if the table is empty outputChatBox( "There are no accounts.", thePlayer ) else -- table isn't empty for i,v in ipairs(accountTable) do account = getAccountName (v ) outputChatBox(account, thePlayer ) end end end addCommandHandler( "accountcount", printAmountOfAccounts ) -- add a command handler for command 'accountcount' guiSetText(memo,account)
  9. Chaos

    vehicles table

    IIYAMA i beg you can you see my pm.
  10. Chaos

    vehicles table

    carsTable = {} addEvent ("carShopCarBuy", true) addEventHandler ("carShopCarBuy", getRootElement(), function(id, cost, name) if (getPlayerMoney (source) >= tonumber(cost)) then table.insert ( carsTable, id ) setAccountData (getPlayerAccount(source), "cu",toJSON (carsTable)) outputChatBox ("Press F3 To Spawn your Vehicle.", source, 0, 255, 0, true) takePlayerMoney (source, tonumber (cost)) else outputChatBox ("You don't have enough money!", source, 255, 0, 0, false) end end) addEventHandler ("onPlayerLogin",root, function ( ) local Account = getPlayerAccount(source) if (Account) then local nData = getAccountData ( Account, 'cu' ) if ( nData ) then nData = fromJSON(nData ) carsTable = nData triggerClientEvent ( source, 'movetable', source, nData ) end end end ) same and this is the save script and you can see here when i restart the resource and buy vehicle logout and login
  11. Chaos

    vehicles table

    server: function onLogin(lastAccount, currentAccount) local data = getAccountData(currentAccount, "cu") if data then data = fromJSON(data) --[[THIS IS YOUR VEHICLE TABLE]] carsTable = data triggerClientEvent(source,"movetable",source,data) end end addEventHandler ("onPlayerLogin", getRootElement(),onLogin) client: ------------------------------------------- addEvent ("movetable", true) function shownamesss (data) for i,v in ipairs (data) do local carName1 = getVehicleNameFromModel (v) -- local row = guiGridListAddRow (carGridList1) -- guiGridListSetItemText (carGridList1, row, 1, carName1, false, true) outputChatBox(carName1) end end addEventHandler ("movetable", getRootElement(), shownamesss) --------------------------------------------- vehicles again gone
  12. Chaos

    vehicles table

    i get tired of sorting table Server : addEvent ("carShopCarBuy", true) addEventHandler ("carShopCarBuy", getRootElement(), function(id, cost, name) if (getPlayerMoney (source) >= tonumber(cost)) then table.insert ( carsTable, id ) setAccountData (getPlayerAccount(source), "cu",toJSON (carsTable)) outputChatBox ("Press F3 To Spawn your Vehicle.", source, 0, 255, 0, true) takePlayerMoney (source, tonumber (cost)) else outputChatBox ("You don't have enough money!", source, 255, 0, 0, false) end end) function onJoin(player) local data = getAccountData (getPlayerAccount(player), "cu") if data then local info = fromJSON ( data ) table.insert ( carsTable, info ) triggerClientEvent(player,"movetable",player,info ) end end addCommandHandler("getinfo",onJoin) Client: addEvent ("movetable", true) function shownamesss (info ) for i,v in ipairs (info ) do local carName1 = getVehicleNameFromModel (v) -- local row = guiGridListAddRow (carGridList1) -- guiGridListSetItemText (carGridList1, row, 1, carName1, false, true) outputChatBox(carName1) end end addEventHandler ("movetable", getRootElement(), shownamesss) --------------------------------------------- the problem is when i restart resource and buy new car all saved cars will gone how to save table and load it after resource restarted ?
  13. Chaos

    vehicles table

    Ok got it but now i need to make it step by step so take it easy with me
  14. Chaos

    vehicles table

    One question if i bought car and another player also bought car it will save same table that i used it to save my vehicles?
  15. Chaos

    vehicles table

    ok i did it function onJoin() local data = getAccountData (getPlayerAccount(source), "saveCVehicle") if data then table.insert ( carsTable, data ) end end addEventHandler ("onPlayerLogin", getRootElement(),onJoin) but i got un sorted table like that [ [ "[ [ 471, 471, 534, 582, 543 ] ]", 462 ] ] function test (player) local data = getAccountData (getPlayerAccount(player), "saveCVehicle") if data then outputChatBox (data, player) end end addCommandHandler("getinfo",test)
  16. Chaos

    vehicles table

    when i restart resource table will get nil ?
  17. Chaos

    vehicles table

    hey, i have a problem on vehicle shop when i try to buy many cars it will saves but when i restart the resource and buy new car all saved cars will be gone any help ? Server: carsTable = {} addEvent ("onBuyVehicle", true) addEventHandler ("onBuyVehicle", getRootElement(), function(id, cost, name) if (getPlayerMoney (source) >= tonumber(cost)) then table.insert ( carsTable, id ) setAccountData (getPlayerAccount(source), "saveCVehicle",toJSON (carsTable)) outputChatBox ("Press F3 To Spawn your Vehicle.", source, 0, 255, 0, true) takePlayerMoney (source, tonumber (cost)) else outputChatBox ("You don't have enough money!", source, 255, 0, 0, false) end end)
  18. Chaos

    scoreboard

    i changed it but it goes outside of column
  19. Chaos

    scoreboard

    it's worked thanks you are the best but can i change image size ? it's too small
  20. Chaos

    scoreboard

    i changed only this and got meta:
  21. Chaos

    scoreboard

    well, i downloaded scoreboard in resource page it's also same as my idea but still doesn't work. https://community.multitheftauto.com/in ... ls&id=4019
  22. Chaos

    scoreboard

    exports.scoreboard:addScoreboardColumn('Rank') function ranks (killer) local zombiekills = getElementData(killer,"Zombie kills") if (zombiekills == 9) then setElementData(killer,"Rank","ranks/first.png") end end addEvent( "onZombieWasted", true ) addEventHandler( "onZombieWasted", getRootElement(), ranks ) i'm trying to put image in scoreboard but it's doesn't work any help ?
  23. Chaos

    onplayerban

    function announceUnban( theBan, responsibleElement ) account = getPlayerAccount(theBan) if account then if getAccountData(account,"AccountBanned") == true then setAccountData(account,"AccountBanned",false) end end end addEventHandler( "onUnban", root, announceUnban ) --Adds the event handler for 'onUnban' thanks a lot but anything wrong here ?
×
×
  • Create New...