-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You are using it as /push right? if you do /push it won't work.
-
It is working, I've tested it, you must be in a vehicle to be able to get pushed.
-
Firstly, this should go in the Scripting section. I only can see that you aren't pushing him up at all, so I've changed some things on it. addCommandHandler("push", function(p, c, t) local pushPlayer = findPlayer(t) if pushPlayer then local pushVehicle = getPedOccupiedVehicle(pushPlayer) if pushVehicle then local speedX, speedY, speedZ = getElementVelocity(pushVehicle) setElementVelocity(pushVehicle, speedX, speedY, speedZ+0.2) outputChatBox(getPlayerName(p).." pushes "..getPlayerName(pushPlayer).." up!") end end end ) function findPlayer(name) local name = name:lower() for i, p in ipairs(getElementsByType("player")) do local fullname = getPlayerName(p):lower() if string.find(fullname:gsub("#%x%x%x%x%x%x", ""), name, 1, true) then return p end end return false end
-
Get IMG tools and open gta3.img in GTA SA folder, if you know the name, you should be able to find it.
-
I didn't upload any stats system... I don't know what he's talking about. P.S: Maybe you got it from another topic?
-
Script does work, I've tested it with zombies by Slothman, everything worked fine, if you know how to use it of course. P.S: Copy my example again, I've fixed something. P.S2: Don't just copy & paste, try to fix something yourself.
-
Brad, I think you should start with something easier if you don't have scripting knowledge.
-
Las imagenes .gif no son soportadas en el MTA, para reproducirlas podrias hacer un script que cargue una imagen en cada render, o algo parecido.
-
estaMiGodModeActivado = false function agregarGodmode() miActualVehiculo = getPedOccupiedVehicle ( getLocalPlayer() ) if estaMiGodModeActivado then removeEventHandler ( "onClientPlayerDamage", getLocalPlayer(), cancelEvent ) outputChatBox ( "Has apagado el Godmode.", 255, 0, 0 ) if miActualVehiculo then setVehicleDamageProof ( miActualVehiculo, false ) end else outputChatBox ( "Has ensendido el Godmode.", 0, 255, 0 ) addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), cancelEvent ) if miActualVehiculo then setVehicleDamageProof ( miActualVehiculo, true ) end end end addCommandHandler ( "godmode", agregarGodmode ) Tenias un par de errores, y cambie algunas cositas.
-
JR10, if I'm right, Cbug is what TAPL posted, not flying cars, jumping high and so on.
-
Again stolen my latest exp_system: https://community.multitheftauto.com/ind ... ls&id=2688 https://community.multitheftauto.com/ind ... ls&id=2687
-
E-mail, I have uploaded a new version of the exp_system, I would download it if I was you. With the new version you can do something like this: addEventHandler("onPlayerWasted",root, function (_,killer) exports.exp_system:addPlayerEXP(killer,5) end) P.S: The killer has to be logged in.
-
I'm afraid I don't get you, what are you talking about?
-
De nada.
-
--Server Side function setRespawns () for i,v in ipairs(getElementsByType("vehicle")) do local x,y,z = getElementPosition(v) local rx, ry, rz = getElementRotation(v) setVehicleRespawnPosition(v, x, y, z, 0, 0, rz) end end addEventHandler("onResourceStart", resourceRoot, setRespawns) function respawnAllVehicles (thePlayer) for ind,veh in ipairs(getElementsByType("vehicle")) do if isEmpty( veh ) then respawnVehicle(veh) end end end addCommandHandler("respawnall", respawnAllVehicles) function isEmpty( vehicle ) local passengers = getVehicleMaxPassengers( vehicle ) if type( passengers ) == 'number' then for seat = 0, passengers do if getVehicleOccupant( vehicle, seat ) then return false end end end return true end
-
Get ped/player weapons and return a table with them
Castillo replied to Headshot4Fun's topic in Scripting
No problem. P.S: We posted at the same time, nice sync . -
No hay de que . P.S: Un ejemplito: local miTabla = { [1] = "Como andas?", [2] = "Todo bien?" } for indice, mensaje in pairs(miTabla) do outputChatBox(tostring(indice) ..": ".. tostring(mensaje)) end
-
Get ped/player weapons and return a table with them
Castillo replied to Headshot4Fun's topic in Scripting
function getPlayerWeapons(player) local weaponsTable = {} for index=0, 13 do local weapon = getPedWeapon(player,index) local ammo = getPedTotalAmmo(player,index) if ammo > 0 then table.insert(weaponsTable, {weapon, ammo}) end end return weaponsTable end Should return a table of weapons (weapon model, ammo). -
Mira, te explico, i,v no es nada, ahi pones lo que sea, ejemplo: for lol, lol2 in pairs(myTabla) do print("hola que tal") end Me entendes? no es necesario poner i, v o i, k, lo que sea, pones lo que quieras.
-
Mira, lo que tenes que hacer es guardar el nombre del equipo, no el elemento. function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData (account, "equipo", getTeamName(getPlayerTeam ( source ))) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "equipo") if (accountData) then local equipo = getAccountData (theCurrentAccount, "equipo") setPlayerTeam (source, getTeamFromName(equipo)) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin)
-
I'd the "hard" part, now you should do the easy part .
-
race_client.lua => line 25.
-
call(getResourceFromName("dxscoreboard"), "addScoreboardColumn", "wanted level") addEventHandler("onPlayerWasted",root, function (_,killer) if killer == source then return end setElementData ( killer, "wanted level", 3 ) end) Should give the killer 3 wanted stars.
