Jump to content

AMARANT

Members
  • Posts

    748
  • Joined

  • Last visited

Everything posted by AMARANT

  1. function checkBalance(thePlayer) local account = getPlayerAccount ( thePlayer ) local bankMoney = getAccountData ( account, "bankcash" ) if ( bankMoney==false ) then -- getAccountData returns false not nil, so check if false setAccountData ( account, "bankCash", 0 ) bankMoney=0 else outputChatBox ( "EagleBot: " .. getPlayerName(thePlayer) .. " has $" .. bankMoney .. " in his bank!" ) end end addCommandHandler ( "bank" , checkBalance )
  2. Ах да точно) Я и забыл что парню с телепортом проблему надо было решить...
  3. It's written on MTA wikia: I wanted to know if this issue was fixed or not
  4. Solidsnake14 is right and you didn't do enough like I told you. Your problem is wrong argument 'playerSource'. Try this: addEvent("givePoint", true) function givePoint( ) -- playerJobLocation[ source ] = { }; -- playerJobLocation[ source ] = { ["x"]=x, ["y"]=y, ["z"]=z }; local numLocations = #truckerLocations repeat local x,y,z = getElementPosition(source) local dropOffPoint = math.random(numLocations) dropOffx = truckerLocations[dropOffPoint]["x"] dropOffy = truckerLocations[dropOffPoint]["y"] dropOffz = truckerLocations[dropOffPoint]["z"] local jobDistance = getDistanceBetweenPoints3D ( x, y, z, dropOffx, dropOffy, dropOffz ) until jobDistance > 1000 and jobDistance < 35000 local dropOffBlip = createBlip ( dropOffx, dropOffy, dropOffz, 41, 2, 255, 0, 0, 255, 1, 99999.0, source) playerBlips[ source ] = { }; table.insert( playerBlips[ source ], dropOffBlip ); pedMarker = createMarker ( dropOffx, dropOffy, 0, cylinder, 6.5, 255, 255, 0, 150, source) playerCols[ source ] = { }; table.insert( playerCols[ source ], pedMarker ); addEventHandler( "onMarkerHit", pedMarker, arriveDropOff ) outputChatBox ( "Drive your products to the destination marker.", source ); end addEventHandler("givePoint", getRootElement(), givePoint)
  5. Try to change 'playerSource' in the 'givepoint' function to just 'source'. And you don't pass any arguments to that function from client, so remove it from the function arguments too.
  6. AMARANT

    Spawn

    You can add the function to unfreeze a player into your code.
  7. Well... Actually we don't know about your system. Why don't you provide us with the full code and then we could try to help you?
  8. You should make it like this: Client side: function setextClient ( data ) outputChatBox(tostring(data).." received!") guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", getLocalPlayer(), setextClient ) Server side: function settextServer (thePlayer) local accn = getPlayerAccount ( thePlayer ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( "setextClient", thePlayer, accdata ) end addCommandHandler ( "text", settextServer )
  9. Of course it won't. Your two functions trigger each other but there's no event that call at least one of them.
  10. А у меня наоборот был обратный процесс Я первым делом столкнулся с МТА годика 2 назад и мне он очень понравился. Потом я решил посмотреть САМП. Не могу сказать что он полное УГ, хотя с точки зрения функционала все-таки могу... Но атмосфера на РП-серверах мне показалась несколько интересней, но тем не менее все очень убого там реализовано на фоне МТА, поэтому я все равно считаю SAMP шлакоблоком. Кстати, я наверное вообще позже всех тут столкнулся с мультиплеерами GTA:SA)) Вот такое вот непредвзятое мнение
  11. Try to create a trailer server-side. Your trailer isn't synchronized.
  12. That's what I mentioned in my comment to lua-code. Solidsnake14, don't you think he didn't even trigger that function?
  13. Try this: Server: function settextServer () -- I suppose you trigger this function from client but you didn't mention it or there will be no 'source' local accn = getPlayerAccount ( source ) local accdata = getAccountData ( accn, "owner" ) triggerClientEvent ( "setextClient", source, accdata ) end addEvent ( "settextServer", true ) addEventHandler ( "settextServer", root, settextServer ) Client: function setextClient ( data ) guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) end addEvent ( "setextClient", true ) addEventHandler ( "setextClient", getLocalPlayer(), setextClient )
  14. ElMota, Lonely4's code should work because I messed up account with player in my example. That's what happens if you're trying to edit someone's code not in-game And that's why I asked you to show your server log. Change this line: spawnPlayer(source,247.04785, 1860.30615, 14.08401,0,282,0,0,getPlayerTeam(theTeam)) To this: spawnPlayer(source,247.04785, 1860.30615, 14.08401,0,282,0,0,theTeam)
  15. You code is not enough. Try this one: ----SPAWN-System-By-ElMota--- createTeam("Admin",180,0,0) createTeam("Todos",0,180,0) addEventHandler("onPlayerLogin",root,function() local acc = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup ("user."..acc, aclGetGroup ( "Admin" ) ) then local posX = getAccountData(source,"PosX") local posY = getAccountData(source,"PosY") local posZ = getAccountData(source,"PosZ") local Skin = getAccountData(source,"Skin") local dim = getAccountData(source,"Dimension") local int = getAccountData(source,"Int") local theTeam = getTeamFromName("Admin") if not posX and not posY and not posZ and not Skin and not dim and not int then spawnPlayer(source,247.04785, 1860.30615, 14.08401,0,282,0,0,getPlayerTeam(theTeam)) elseif posX and posY and posZ and Skin and dim and int then spawnPlayer(source,posX,posY,posZ,0,Skin,dim,int,theTeam) end elseif not isObjectInACLGroup ("user."..acc, aclGetGroup ( "Admin" ) ) then local theTeamE = getTeamFromName("Todos") if not posX and not posY and not posZ and not Skin and not dim and not int then spawnPlayer(source,-342.89999389648,1541.8000488281,74.900001525879,0,16,0,0,theTeamE) elseif posX and posY and posZ and Skin and dim and int then spawnPlayer(source,posX,posY,posZ,0,Skin,dim,int,theTeamE) end end end ) addEventHandler("onPlayerQuit",root,function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local posX,PosY,PosZ = getElementPosition(source) setAccountData(source,"PosX",posX) setAccountData(source,"PosY",posY) setAccountData(source,"PosZ",posZ) local skin = getElementModel(source) setAccountData(source,"Skin",skin) local dim = getElementDimension(source) setAccountData(source,"Dimension",dim) local int = getElementInterior(source) setAccountData(source,"Int",int) end end )
  16. What is the console saying? Any errors? Warnings? Your variable thePlayer in the first function is not declared too. I suppose that the error is because of trying to get the account from some variable 'thePlayer' which is not declared like I said. If you want to spawn player upon his connecting to the server then you should use 'onPlayerJoin' or 'onPlayerLogin' events instead of 'onResourceStart'. But if you want to spawn him on your resource starts then I advice you to go through your all alive players in order to spawn them. Use lua loop for that.
  17. Where is set 'accName' variable? I only see 'acc'. Try to rename it. local acc = getAccountName(getPlayerAccount(thePlayer)) -- acc if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then --accName ????
  18. local account = getPlayerAccount (source) if getElementID(cari) == getAccountData (account, "cari") then --some code-- else outputChatBox ( "This car is not yours!" , source) setElementHealth (getElementData (source, "hiscari"), 0) destroyElement(cari) removeElementData (source, "hiscari") end But you should show the full code because I don't know what are you checking in that line which is obviously wrong: if getElementID(cari) = getPlayerAccount (source), "cari") then -- WRONG!
  19. There's no such a funciton: bindkey But there is: bindKey Look at your code - this function isn't even highlighted by lua-tag.
  20. Прикольно. Даже и не знал что там такой шлак
  21. debugscript is not the same thing as debug message. Debug message is just "outputChatBox" function. Try this code: function setCameraOnPlayerJoin() fadeCamera(source, true, 1); setCameraMatrix(source, -2135.708984375, -187.71142578125, 157.66786193848, 0, 0, 0); setTimer( bindKey, 5000, 1, source, "f", "down", herewego, source ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin); function herewego ( thePlayer ) gX, gY, gZ = getElementPosition ( thePlayer ) setCameraTarget ( thePlayer ) setElementPosition ( thePlayer, 2450.7463378906, -1659.6678466797, 13.3046875 ) fadeCamera(source, true, 1); setElementFrozen ( thePlayer, false ) unbindKey( thePlayer, "f", "down", herewego ) end
  22. Have you put in function "herewego" debug-message? What did it say? Make sure that in client-side version of this function you shouldn't set 'player' argument.
  23. hacking = createColSphere(posX, posY, posZ, 4) local cars = getElementsWithinColShape( hacking, "vehicle") for index, aVehicle in ipairs(cars) do if isVehicleLocked(aVehicle) then outputChatBox(getVehicleName(aVehicle).." is locked.") end end
  24. Actually I thought that the problem is solved
×
×
  • Create New...