Jump to content

0xCiBeR

MTA Team
  • Posts

    1,673
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by 0xCiBeR

  1. Well, if you do know OOP then you have a lot of points in favor if you plan on using OOP to programm. In MTA 1.4 OOP will be incorporated in the MTA engine functions. Please let me know if you need any further assistance.
  2. Es posible, pero poco probable a menos que la versión sea demasiado vieja. Siempre es recomendable forzar la utilización de la ultima versión estable de MTA para el cliente, principalmente por el tema de los hacks.
  3. I strongly recommend not to use that if you're new to lua because that is mainly OOP. Use this: function kickme() if getElementData(source,"trucker") == true then setElementData(source,"trucker",false) setPlayerTeam(source,nil) end addCommandHandler("notrucker",kickme)
  4. I meant storing the name you compare in the table like this: local cols = { {"TEAM1",110.199, 1757.300, 17, 20, 3}, {"TEAM2",110.199, 1757.300, 17, 20, 3} } And the unpack would be something like this: for _, v in ipairs(cols) do local teamname,x, y, z, rad,height = unpack ( v ) tubes = createColTube(x,y,z,rad,height) setElementData(tubes,"team",teamname) end
  5. That's because you're obtaining an element data representing if you're a trucker or not. The element data is not cleared unless you re join the server. You can also clear the element data, by using this: setElementData(hitElement,"trucker",false) You can store the data using: setAccountData Or using the SQL functions.
  6. You could store the team that it would be locked for in the table as a string.
  7. Relax man, no problem we are here to help you out
  8. I think an example would be: local cols = { {110.199, 1757.300, 17, 20, 3}, {110.199, 1757.300, 17, 20, 3} } for _, v in ipairs(cols) do local x,y,z,rad,height = unpack(v) createColTube(x,y,z,rad,height) end
  9. local workmarker = createMarker(860, -1208, 16, 'cylinder', 2.0, 0, 255, 0 , 150); trucks = createTeam("Truckers",255,0,0) function TakeJob(hitElement, matchingDimension) local element = getElementType(hitElement); if(getElementType(hitElement) == 'player') and getElementData(hitElement,"trucker") == false then setPedSkin(source, 202); setElementData(hitElement,"trucker",true); setPlayerTeam(hitElement, trucks); elseif getElementData(hitElement,"trucker") == true then outputChatBox("You are already a trucker"); end end addEventHandler("onMarkerHit", workmarker, TakeJob);
  10. loco = createTeam("TUTEAMACA",255,0,0) function setskin(yo,cmd,mod) if mod then local modelo = tonumber(mod) local team = getPlayerTeam(yo) local nombre = getTeamName(team) if nombre == "TUTEAMACA" then setElementModel(yo,modelo) end end end addCommandHandler("setskin",setskin)
  11. Yes, they work only for the client that uses it. Didn't know how you wanted to use it, tho you can use it client side this way: local marker1 = createMarker(872, -1208, 16, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) if(getElementType(hitElement) == 'player') and getElementData(hitElement,"vehicle") == false then local x,y,z = getElementPosition(hitElement) veh = createVehicle(403, x, y+1, z, 0 , 0 , 180) setElementData(hitElement,"vehicle",true) elseif getElementData(hitElement,"vehicle") == true then outputChatBox("You have got already a vehicle"); end end addEventHandler( "onMarkerHit", marker1, MarkerHit ) function delete () destroyElement(veh) setElementData(hitElement,"vehicle",false) end addCommandHandler("delete",delete) PD: Do know that this way, you can't enter the vehicle.
  12. Try this, tho i don't know if it will work, i'm from my cell local vehicles = { } local marker1 = createMarker(872, -1208, 16, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) if(getElementType(hitElement) == 'player') and getElementData(hitElement,"vehicle") == false then local x,y,z = getElementPosition(hitElement) local veh = createVehicle(403, x, y+1, z, 0 , 0 , 180) setElementData(hitElement,"vehicle",true) table.insert(vehicles,hitElement,veh) elseif getElementData(hitElement,"vehicle") == true then outputChatBox("You have got already a vehicle"); end end addEventHandler( "onMarkerHit", marker1, MarkerHit ) function delete () destroyElement(vehicles[source] table.remove(vehicles,vehicles[source]) setElementData(hitElement,"vehicle",false) end addCommandHandler("delete",delete)
  13. 0xCiBeR

    Bug

    You're Welcome.
  14. 0xCiBeR

    Bug

    radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) Maverick = createVehicle ( 487, 251.64256286621,1920.413574218817,640630722046 ) addCommandHandler ( "comprar51", function ( player ) local money = getPlayerMoney ( player ) local playerTeam = getPlayerTeam ( player ) local r, g, b = getTeamColor ( playerTeam ) local teamMates = getPlayersInTeam ( playerTeam ) if(isElementWithinMarker(player,marker2)) and ( money > 1000000 ) then takePlayerMoney ( player, 1000000 ) setRadarAreaColor ( radararea2, r, g, b, 155 ) outputChatBox ( "#FFF000 [bASE] #FF0000You buyed this base.", player, 0, 0, 0, true ) for _, v in ipairs(teamMates) do outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", v, 0, 0, 0, true ) end else outputChatBox ( "#FFF000 [bASE] #FF0000You don't have money or you are out of checkpoint", player, 0, 0, 0, true ) end end) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end ) function Vender ( player ) if(isElementWithinMarker(player,marker2)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then givePlayerMoney ( player, 1000000 ) setRadarAreaColor ( radararea2, 255, 255, 255, 155 ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang vendeu a base #00ff00 Area 51!", player, 0, 0, 0, true ) end end end addCommandHandler ( "vender", Vender ) function Car_Color ( player ) if(isElementWithinMarker(player,marker2)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) setVehicleColor( Maverick, r, g, b ) end end end addCommandHandler ( "comprar51", Car_Color )
  15. local marker1 = createMarker(872, -1208, 16, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) if(getElementType(hitElement) == 'player') and getElementData(hitElement,"vehicle") == false then local x,y,z = getElementPosition(hitElement) createVehicle(403, x, y+1, z, 0 , 0 , 180) setElementData(hitElement,"vehicle",true) elseif getElementData(hitElement,"vehicle") == true then outputChatBox("You have got already a vehicle"); end end addEventHandler( "onMarkerHit", marker1, MarkerHit )
  16. 0xCiBeR

    Bug

    radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) Maverick = createVehicle ( 487, 251.64256286621,1920.413574218817,640630722046 ) addCommandHandler ( "comprar51", function ( player ) local money = getPlayerMoney ( player ) local playerTeam = getPlayerTeam ( player ) local r, g, b = getTeamColor ( playerTeam ) if(isElementWithinMarker(player,marker2)) and ( money > 1000000 ) then takePlayerMoney ( player, 1000000 ) setRadarAreaColor ( radararea2, r, g, b, 155 ) outputChatBox ( "#FFF000 [bASE] #FF0000You buyed this base.", player, 0, 0, 0, true ) else outputChatBox ( "#FFF000 [bASE] #FF0000You don't have money or you are out of checkpoint", player, 0, 0, 0, true ) end end) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end ) function Vender ( player ) if(isElementWithinMarker(player,marker2)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then givePlayerMoney ( player, 1000000 ) setRadarAreaColor ( radararea2, 255, 255, 255, 155 ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang vendeu a base #00ff00 Area 51!", player, 0, 0, 0, true ) end end end addCommandHandler ( "vender", Vender ) function Car_Color ( player ) if(isElementWithinMarker(player,marker2)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) setVehicleColor( Maverick, r, g, b ) end end end addCommandHandler ( "comprar51", Car_Color )
  17. Sí es lo que querias no? Qué salga Vehiculo Propiedad de ....
  18. 0xCiBeR

    Bug

    radararea2 = createRadarArea( 110.91990, 1800.89435, 200, 145, 255, 255, 255, 225 ) createBlip(279.40317, 1831.25439, 7.72656,62) marker2 = createMarker(298.98865, 1815.90613, 3.71094,"cylinder",2,0,0,255,255) Maverick = createVehicle ( 487, 251.64256286621,1920.413574218817,640630722046 ) addCommandHandler ( "comprar51", function ( player ) local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) if(isElementWithinMarker(player,marker2)) then local money = getPlayerMoney ( player ) if ( money >= 1000000 ) then takePlayerMoney ( player, 1000000 ) else outputChatBox ( "#FFF000 [bASE] #FF0000 Voce não possui dinheiro suficiente para comprar a Base", player, 0, 0, 0, true ) end else outputChatBox ( "#FFF000 [bASE] #FF0000 Você não esta em uma checkpoint", player, 0, 0, 0, true ) setRadarAreaColor ( radararea2, r, g, b, 155 ) local color = getTeamColor ( playerTeam ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang comprou a base #00FF00 Area 51!", player, 0, 0, 0, true ) end end end ) addEventHandler("onMarkerHit", marker2, function (player) outputChatBox ( "#FFF000 [bASE] #FF0000 Para comprar a base digita #00FF00 /comprar51 (1000000$)", player, 0, 0, 0, true) end ) function Vender ( player ) if(isElementWithinMarker(player,marker2)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then givePlayerMoney ( player, 1000000 ) setRadarAreaColor ( radararea2, 255, 255, 255, 155 ) outputChatBox ( "#FFF000 [bASE] #FF0000 Sua gang vendeu a base #00ff00 Area 51!", player, 0, 0, 0, true ) end end end addCommandHandler ( "vender", Vender ) function Car_Color ( player ) if(isElementWithinMarker(player,marker2)) then local playerTeam = getPlayerTeam ( player ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) setVehicleColor( Maverick, r, g, b ) end end end addCommandHandler ( "comprar51", Car_Color )
  19. Tu script prohíbe cualquier versión que este en la tabla versiones. Lo que podes hacer es esto: function version ( ) local version = getPlayerVersion ( source ) if version ~= 1.3.4-9.06007.0 then kickPlayer ( source, "Actualiza Tu Mta A la Version 1.3.4" ) end end addEventHandler ( "onPlayerJoin", getRootElement(), version )
  20. chaky = createVehicle (541, -2018.904296875, -260.40234375, 34.422100067139, 0, 0, 88.747253417969) setElementData(chaky , "owner", "chaky") setVehicleDamageProof (chaky, true ) setVehicleColor ( chaky , f , f , f , f , f , f ) function onLockedVehicleEnter ( player, seat, jacked ) if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then cancelEvent() outputChatBox ( "Vehiculo propiedad de: "..tostring(getElementData(source,"owner")), player, 255, 200, 0 ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) function Lolr (thePlayer) local account = getPlayerAccount ( thePlayer ) if not isGuestAccount(account) and getAccountName(account) == "chaky" then respawnVehicle ( chaky ) else outputChatBox ( "No puedes usar este comando", thePlayer, 255, 200, 0 ) end end addCommandHandler("chaky", stre) addCommandHandler("stre",function(thePlayer) local account = getPlayerAccount ( thePlayer ) if not isGuestAccount(account) and getAccountName(account) == "chaky" then local x,y,z = getElementPosition(thePlayer) setElementPosition(chaky,x+3,y,z+3) end end )
  21. 0xCiBeR

    Bug

    stands for End Of File. So, the error is that it is expecting an End of File, and it bumped with 2 ends. Remove them, and it's fixed.
  22. Porqué no simplemente defines min_client_version en el mtaserver.conf? local versiones = { [ "1.3.0" ] = true, [ "1.3.1" ] = true, [ "1.3.2" ] = true } function version ( ) local version = getPlayerVersion ( source ) if ( versiones [ version ] ) then kickPlayer ( source, "Actualiza Tu Mta A la Version 1.3.4" ) end end addEventHandler ( "onPlayerJoin", getRootElement(), version )
×
×
  • Create New...