Give certain players custom models?
Posted: October 11th, 2012, 12:17 am
I want to make it in my map, so that if this certain person joins their character is a custom model I have imported for my map. is this possible?
CoDJumper.com - For all your CoDJumping needs!
https://www.codjumper.com/forums/
Code: Select all
player setModel("model_name");
Sorry, where would I add the GUID and the code? (I'm a beginner scripter)F |Madness| U wrote:Yes it is possible, if you just run a check on each player when they connect or spawn to see if they have a matching xuid, you can change their model withI think.Code: Select all
player setModel("model_name");
Code: Select all
init()
{
    level thread onPlayerConnect();
}
Â
onPlayerConnect()
{
    for(;;)
    {
        level waittill( "connected", player );
        player thread xuid_check();
        player thread onPlayerSpawned();
    }
}
Â
xuid_check()
{
    if(self getxuid() == "xuid here" || self getxuid() == "another xuid here")//<-- different people having same model
    {
        self.custommodel = "custom model 1 here";
    }
    else if(self getxuid() == "player requiring different model xuid")
    {
        self.custommodel = "custom model 2";
    }
    else
}
Â
onPlayerSpawned()
{
    self endon("disconnect");
Â
    for(;;)
    {
        self waittill("spawned_player");
        self setModel(self.custommodel);
    }
}
F |Madness| U wrote:You would add code similar to this, in the maps.gsc file.
I am not entirely sure if self setModel() works instantly, or if it has to be done before they spawn (or spawn and then die).Code: Select all
init() {     level thread onPlayerConnect(); }  onPlayerConnect() {     for(;;)     {         level waittill( "connected", player );         player thread xuid_check();         player thread onPlayerSpawned();     } }  xuid_check() {     if(self getxuid() == "xuid here" || self getxuid() == "another xuid here")//<-- different people having same model     {         self.custommodel = "custom model 1 here";     }     else if(self getxuid() == "player requiring different model xuid")     {         self.custommodel = "custom model 2";     }     else }  onPlayerSpawned() {     self endon("disconnect");      for(;;)     {         self waittill("spawned_player");         self setModel(self.custommodel);     } }