Give certain players custom models?
Moderator: Core Staff
-
- CJ Wannabe
- Posts: 10
- Joined: October 10th, 2012, 8:39 pm
Give certain players custom models?
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?
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Give certain players custom models?
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 with I think.
Code: Select all
player setModel("model_name");
-
-
- CJ Wannabe
- Posts: 10
- Joined: October 10th, 2012, 8:39 pm
Re: Give certain players custom models?
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");
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Give certain players custom models?
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);
    }
}
-
-
- CJ Wannabe
- Posts: 10
- Joined: October 10th, 2012, 8:39 pm
Re: Give certain players custom models?
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);     } }
Can you add me on xfire? I may need a little more help my xfire is, dynamicivjoel
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Give certain players custom models?
Apparently I'm already friends with you- I will be happy to help when I'm available, but atm I tend to be pretty busy with university work.
-
Who is online
Users browsing this forum: No registered users and 10 guests