Jump to content

On Spawn Skin .xml where?


Xabache

Recommended Posts

Pardon my lack of specifics, i do speak of stock MTA 1.4 with GTA 1.0. I have modified skins.xml in freeroam to not allow various skins to be chosen through the F1 GUI, but on spawn, when they first join the room or after death my list is not referenced and all skins show up. I want to use my short list as the on spawn list to limit some of these skins. I do not know where this on spawn list is kept in MTA or referenced from GTA but replaceable by MTA?

Link to comment

Which gamemode? Because in RACE it's different as well............ That's why I said which resource.

If you mean the PLAY gamemode, then you can clearly see this in 'broph.lua':

repeat until setElementModel(player,math.random(312)) 

This is the code where it takes a random skin.

If you mean the skins list in the PLAY gamemode by browsing F1, then you could see in the PLAY gamemode in 'meta.xml':

<include resource="freeroam" /> 
    <include resource="spawnmanager" /> 

So then if you check both resources, you will find in the FREEROAM resource the 'skins.xml' file.

Link to comment

Yes! This is what I could not find, and I must say i was looking right at it.

So this spawns skins 1-312 "randomly". What I would like to do then is use this random number after it passes through a while loop checking it for its own limitations

If I could write this in mIRC with a little obvious lua snuck in I would say

  
while (!%rand) { 
  var %try = math.random(312) 
  if (!$istok(242 311 45 142,%try,32)) { var %rand = %try } 
} 
  

where it would check its random number is not the skin numbers i wish to exempt from random spawn: 242 311 45 142, but as soon as it is say 56 or 63 it would let it pass.

So what might i need to know to do this here...

function spawn(player) 
    if not isElement(player) then return end 
    if get("spawnreset") == "onSpawn" then 
        spawnpoint = getRandomSpawnPoint() 
    end 
    exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) 
    repeat until setElementModel(player,math.random(312)) 
    fadeCamera(player, true) 
    setCameraTarget(player, player) 
    showChat(player, true) 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...