Jump to content

Bean666

Members
  • Posts

    732
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Bean666

  1. setElementData(source, "Local", source) setElementData(source, "Arena") should be setElementData(source, "Local", true) setElementData(source, "Arena", true) but i think this won't work because you are not defining source into player, make sure to define source to player first. and why not use local data = getElementData(player, "Local") if data == true then try this it works ingame making show Local, no errors i got. ( im not sure if this is what you;re looking for ) function playerChat(message, messageType, player) if messageType == 0 then cancelEvent() for i,player in ipairs(getElementsByType("player")) do local data = getElementData(player, "Local") if data == true then outputChatBox("(Local)"..getPlayerName(player)..": #ffffff", player, 255, 255, 255) outputServerLog("CHAT: "..getPlayerName(player)..": "..message) end end end end addEventHandler("onPlayerChat", root, playerChat) instead of putting getElementID stuff. and don't use source atm in the function onPlayerChat because there is "player" in the parentheses.
  2. the code he wrote for you is serverside.
  3. since the isObjectWithinCityZone function is in the 1stfile. and you're calling the function "isObjectWithinCityZone" in the second file. which the function "isObjectWithinCityZone" is located in 1st file , functions aren't globally shared in resources.
  4. is isObjectWithinCityZone defined in 2ndfile?
  5. never seen a server with dff/txd protection.
  6. try making a table and math.random try this ,add more ids in the table { } make sure to add , when u add more ids! found a problem in this : warpPedIntoVehicle in argument 2 got boolean, it happens sometimes. local vehicles = {356, 411 } setTimer( function () for _, v in ipairs(getElementsByType("player")) do if (isPedInVehicle(v)) then local x, y, z = getElementPosition(v) local veh = getPedOccupiedVehicle(v) destroyElement(veh) veh = nil local randomveh = vehicles[math.random(#vehicles)] vehicle = createVehicle(randomveh, x, y, z) warpPedIntoVehicle(v, vehicle) end end end , 15000, 0 )
  7. Bean666

    sound

    making a random sound system eh... why does it keep playing even tho 4 AM(ingame time) is done? local soundtable = { "sound.mp3", "sound2.mp3"} setTimer (function() local hour, minute = getTime ( ) if hour >= 22 or hour <= 4 then sound = playSound( soundtable[ math.random( 1,#soundtable ) ], false ) if isElement(sound) then setSoundVolume(sound, 0.4) else if isElement(sound) then setSoundVolume(sound, 0) end end end end ,10000, 0 )
  8. Bean666

    question

    how can i stop a timer after killing it? do i need a loop or what? thanks in advance. EDIT: Found a way , solved!
  9. some stuff i saw thta would fit your server!, but this is an OBJECT not a vehicle but i think you can make them act like a veh!, but it looks cool tho!, check this out: http://libertycity.ru/files/gta-san-and ... bonus.html http://libertycity.ru/files/gta-san-and ... -1942.html
  10. aren't you shamont from CIT with the money group [$] haha
  11. Bean666

    create weapon

    try, if you mean by give him weapon after death here it is: local weapon = {30, 31, 34, 25, 29, 27, 24} local ammo = {200,250,300,350,400,450,500} function weapons() weapon, totalAmmo = weapon[ math.random( #weapon ) ] , ammo[math.random(#ammo)] weaponReceived = giveWeapon( source, weapon, totalAmmo, true); if weaponReceived then outputChatBox("You received a random weapon with "..totalAmmo.." ammo") end end addEventHandler("onPlayerSpawn", getRootElement(), weapons)
  12. try not tested. function triggerGui(player,state) if (player == localPlayer ) then guiSetVisible(mainWindow,state) showCursor(state) state = false end addEvent("showTheGui",true) addEventHandler("showTheGui",resourceRoot,triggerGui)
  13. hello i have 2 markers , serverside and client, whenever i step on the marker from serverside it destroys the marker in clientside, i know im using resourceRoot, because of the onClientElementDestroy.. it doesnt work when i just put bankmarker, how could i possibly avoid that? local bankmarker = createMarker( 767.0537109375, 2277.9609375, 8.8, "cylinder", 1.5, 255, 0, 0, 255 ) addEventHandler("onClientElementDestroy", resourceRoot,function () if getElementType(source) == "marker" then setTimer ( function() local bankmarker = createMarker( 767.0537109375, 2277.9609375, 8.8, "cylinder", 1.5, 255, 0, 0, 255 ) end,3000,1) end end ) function ondeliverhit() destroyElement(resourceRoot) setElementData(localPlayer, "deliver", true) end addEventHandler("onClientMarkerHit", resourceRoot, ondeliverhit)
  14. Bean666

    killer

    sorry for double post but try changing attacker to killer, i don't think it will make any changes but try function kill (killer, weapon, bodypart, loss) if (killer) then triggerClientEvent ( killer, "showGUI", killer ) end end addEventHandler ( "onPlayerWasted", getRootElement(), kill)
  15. Bean666

    killer

    u wont need to keep ur code in one side, it 's simple, i don't see anything wrong in my code, just paste the client code i sent to your client side and paste the server code i sent to your server side. do /debugscript 3 then start the resource then test it, if it dont work tell me the errors shown in the debug below. also remove this fuNCTION in client side, you wont need it : addEventHandler("onClientPlayerWasted",localPlayer, function (killer) guiSetVisible(score,true) end) end )
  16. i think you need to define the localPlayer maybe use if (player == localPlayer) then might work. but i think localPlayer is already defined in MTA. so maybe u wont need that. and just change player to localPlayer.
×
×
  • Create New...