Chaos
Members-
Posts
300 -
Joined
-
Last visited
Everything posted by Chaos
-
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)
-
everyone have a way so i prefer my way
-
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.
-
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 )
-
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
-
Castillo but i need it abort stealthkill only for me that's mean others can get kill by knife
-
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
-
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)
-
IIYAMA i beg you can you see my pm.
-
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
-
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
-
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 ?
-
Ok got it but now i need to make it step by step so take it easy with me
-
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?
-
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)
-
when i restart resource table will get nil ?
-
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)
-
i changed it but it goes outside of column
-
it's worked thanks you are the best but can i change image size ? it's too small
-
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
-
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 ?
-
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 ?
