Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. As I told you before, you must use the "slothbots" for this.
  2. Yo lo hice asi: -- ID del skin, nombre del archivo. local zombieSkins = { [27] = "zomb1", [51] = "zomb2", } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) for skin, model in pairs ( zombieSkins ) do if ( fileExists ( model ..".txd" ) and fileExists ( model ..".dff" ) ) then engineImportTXD( engineLoadTXD ( model ..".txd" ), tonumber ( skin ) ) engineReplaceModel( engineLoadDFF ( model ..".dff", 0 ), tonumber ( skin ) ) end end end )
  3. Castillo

    deleted

    @RiD: I agree, and as far as I've seen, they're using MTA paradise scripts too ( the messages at the bottom ).
  4. distance = getElementDistanceFromCentreOfMassToBaseOfModel(vehicle) str = getVehicleName(vehicle).." : "..distance.."\n" outputChatBox(tostring(str)) That'll output the right value.
  5. Try this: local enabled = false local files = { { name = "rims", model = 1075}, { name = "wheel_sr6", model = 1075}, { name = "wheel_sr3", model = 1075}, } local filesLoaded = { } bindKey( "m", "down", function ( ) if not enabled then for index, file in ipairs ( files ) do filesLoaded[index] = { } filesLoaded[index].txd = engineLoadTXD( file.name ..".txd", file.model ) engineImportTXD(filesLoaded[index].txd, file.model ) filesLoaded[index].dff = engineLoadDFF( file.name ..".dff", file.model ) engineReplaceModel(filesLoaded[index].dff, file.model ) end else for index, file in ipairs ( filesLoaded ) do destroyElement( file.txd ) destroyElement( file.dff ) end end enabled = not enabled end )
  6. No creo que los zombies pueden usar ese tipo de armas, para eso usa el recurso "slothbot".
  7. Proba http://gtainside.com/, ahi yo descargo mods aveces.
  8. El unico recurso que agrega mas vida a un elemento es el "extrahealth" que creo Benxamix, pero al parecer no funciona con los recursos: slothbot y zombies (ambos de Slothman).
  9. You can't cancel the death, you could always try to make a own "health" system which will not take real player health, but a fake one.
  10. De nada. Los zombies atacan cuando quieren, si no les disparas tambien, por lo menos en todos los servidores que jugue.
  11. No tenes el notepad++? para buscar lo que te dije antes.
  12. I have found the problem that caused the Stack overflow, copy my code again.
  13. Entonces mejor que busques mejor, lo probe y funciona perfectamente.
  14. Abri el archivo: "zombies/zombies_server.lua" y busca por: createPed, luego agrega esta linea debajo: triggerEvent("onZombieCreated",zomb) Luego podes hacer asi: addEvent ( "onZombieCreated", true ) addEventHandler ( "onZombieCreated", root, function ( ) giveWeapon ( source, math.random(4, 9 ), 1, true ) end )
  15. @Cadu12: As far as I know "sourcep" is a player userdata, if you put it as "sourcep" it'll be a string.
  16. El script no tiene ningun error, hiciste algo mal.
  17. Pone ese script en "nick.zip / nick.lua".
  18. addEventHandler ( "onPlayerChat", root, function ( msg, msgType ) local accountName = getAccountName ( getPlayerAccount ( source ) ) local r, g, b = getPlayerNametagColor ( source ) if ( msgType == 0 ) then outputChatBox( accountName ..": #FFFFFF".. msg, root, r, g, b, true ) elseif ( msgType == 1 ) then outputChatBox( "* ".. accountName .." ".. msg, root, 255, 0, 255, true ) elseif ( msgType == 2 and getPlayerTeam ( source ) ) then for index, player in ipairs ( getPlayersInTeam ( getPlayerTeam ( source ) ) ) do outputChatBox( "(TEAM) ".. accountName ..": #FFFFFF".. msg, player, r, g, b, true ) end end cancelEvent ( ) end )
  19. local eventStarted = false local playersJoinedEvent = { } local weaponEvent, weaponAmmo, eventEnded local adminPositionX, adminPositionY, adminPositionZ local playersData = { } function convertPlayerWeaponsToTable(player) local weapons = { } for slot = 0, 12 do local weapon = getPedWeapon( player, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo( player, slot ) if ( ammo > 0 ) then weapons[weapon] = ammo end end end return weapons end function playerJoinsEvent ( thePlayer, command ) if ( eventStarted == true and not playersJoinedEvent[thePlayer] and command == "joinevent" ) then local pX, pY, pZ = getElementPosition ( thePlayer ) local playerSkin = getElementModel ( thePlayer ) playersData[thePlayer] = { position = { pX, pY, pZ }, skin = playerSkin, weapons = convertPlayerWeaponsToTable( thePlayer ) } if spawnPlayer( thePlayer, adminPositionX, adminPositionY, adminPositionZ, 0, tonumber( skinID ) ) then playerJoinedEvent = true giveWeapon ( thePlayer, weaponEvent, tonumber( weaponAmmo ) ) outputChatBox( "You successfully joined the event", thePlayer ) playersJoinedEvent[thePlayer] = true end elseif ( eventStarted == false and not playersJoinedEvent[thePlayer] and command == "joinevent" ) then outputChatBox( "#FF8000 |Event| : There is no event currently ongoing.", thePlayer, 42, 100, 100, true ) elseif ( eventStarted == true and playerJoinedEvent == true and command == "joinevent" ) then outputChatBox( "#FF8000 |Event| : You are already in the event", thePlayer, 42, 100, 100, true ) end if ( eventEnded == false and not playersJoinedEvent[thePlayer] and command == "endevent" ) then loadOriginalData ( thePlayer ) eventEnded = true end if ( command == "quitevent" and eventStarted == true and playersJoinedEvent[thePlayer] )then loadOriginalData ( thePlayer ) outputChatBox( "#008000|Event| : You successfully quit the event.", thePlayer, 42, 100, 100, true ) end end addCommandHandler("joinevent",playerJoinsEvent) addCommandHandler("quitevent",playerJoinsEvent) function loadOriginalData ( thePlayer ) local savedData = playersData[thePlayer] if ( savedData and type ( savedData ) == "table" ) then local x, y, z = unpack ( savedData.position ) playersJoinedEvent[thePlayer] = nil local spawned = spawnPlayer( thePlayer, x, y, z, 0, savedData.skin) if (spawned ) then takeAllWeapons ( thePlayer ) for weapon, ammo in pairs ( savedData.weapons ) do giveWeapon ( thePlayer, weapon, ammo ) end end end end function adminStartEvent(thePlayer, command, weaponId, ammoCMD) if ( eventStarted == false and command == "startevent" and weaponId ~= null ) then playersData = { } playersJoinedEvent = { } --Declaring booleans and variables weaponAmmo = ammoCMD weaponEvent = weaponId eventEnded = false eventStarted = true local weaponName = getWeaponNameFromID ( weaponEvent ) adminPositionX, adminPositionY, adminPositionZ = getElementPosition ( thePlayer ) --*********************** outputChatBox( "#FF8000 |Event| : Event started by Admin", getRootElement( ), 42, 100, 100, true ) outputChatBox( "#FF8000 |Event| : Weapon being used ".. weaponName, thePlayer,42, 100, 100, true ) end if ( eventStarted == false and command == "startevent" and weaponId == null ) then outputChatBox( "#FF0000 |Event|Syntax|: /startevent [weaponID][ammo]", thePlayer, 42, 100, 100, true ) end if ( eventStarted == true and command == "endevent" ) then eventStarted = false eventEnded = true playerJoinedEvent = false outputChatBox( "#FF8000 |Event| : Event ended by an Admin", thePlayer, 42, 100, 100, true ) elseif ( eventStarted == false and command == "endevent" ) then outputChatBox( "#FF0000 |Event| : There is no event in progress.", thePlayer, 42, 100, 100, true ) end end addCommandHandler( "startevent", adminStartEvent ) addCommandHandler( "endevent", adminStartEvent ) addEventHandler( "onPlayerSpawn", getRootElement( ), function ( ) if ( eventStarted == true and playersJoinedEvent[source] ) then loadOriginalData ( source ) end end ) Edit: Code updated.
  20. Let me understand, you want to save player position, weapons, skin when he enters the event and load them when quit/get wasted?
  21. Try this: if ( bet[sourcep][i] == source )then
  22. You can if you use getColorFromString.
×
×
  • Create New...