[Release] Custom spawn location based on UID (No Database Triggers)

Yup, it still works. All you have to do is change one thing in the init.sqf code. The new login record variable is PVDZ_plr_LoginRecord instead of dayzLoginRecord. So it should look like this:
Code:
p2_newspawn = compile preprocessFileLineNumbers "fixes\newspawn.sqf";
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2) then
{
    player spawn p2_newspawn;
};

Awesome thanks
 
Yup, it still works. All you have to do is change one thing in the init.sqf code. The new login record variable is PVDZ_plr_LoginRecord instead of dayzLoginRecord. So it should look like this:
Code:
p2_newspawn = compile preprocessFileLineNumbers "fixes\newspawn.sqf";
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2) then
{
    player spawn p2_newspawn;
};

In the actual code itself it says //## Custom Spawn Location 1 Leading me to suspect that I could add another player setPosATL [185,7243,1.5];
}; Line and have it select randomly between both suggestions? Is that assumption correct or am I simply daydreaming?
 
Alright, so I have done something wrong or something I have added in is messing with it. Isn't working for me, and my .rpt is showing this everytime I try to get it to work .
Code:
"TELEPORT REVERT for player UID#123644358 from 1317 to [13480.4,5229.34,0.00173831], [2090.08,11855.3,0.00154114] meters, now at 13180"

EDIT: Resolved, had to remove the antihack.sqf exec line in the init.sqf
 
In the actual code itself it says //## Custom Spawn Location 1 Leading me to suspect that I could add another player setPosATL [185,7243,1.5];
}; Line and have it select randomly between both suggestions? Is that assumption correct or am I simply daydreaming?


Doesn't quite work like that, you could create a variable with a random number, then use an if statement for each possible spawn location.

E.g. for a 50% chance between 2 locations
(Example code, may not work, just concept, expect errors)

_var = random 1;
if (_var > 0.5) then {
//set position
} else {
//set position
};
 
Doesn't quite work like that, you could create a variable with a random number, then use an if statement for each possible spawn location.

E.g. for a 50% chance between 2 locations
(Example code, may not work, just concept, expect errors)

_var = random 1;
if (_var > 0.5) then {
//set position
} else {
//set position
};

Interesting. May toy with this at a later date when time permits. Thanks :p
 
Doesn't quite work like that, you could create a variable with a random number, then use an if statement for each possible spawn location.

E.g. for a 50% chance between 2 locations
(Example code, may not work, just concept, expect errors)

_var = random 1;
if (_var > 0.5) then {
//set position
} else {
//set position
};

Testing your code modification exactly. This is how i've got it set up http://pastebin.com/GdjVSguS going to mess around with it

Edit: Test 1, no dice. Took a look at some other scripts for inspiration, modified some things, testing again.
Edit: Test 2, no dice. Redoing
Edit: Test 3, no dice. For once the .rpt is pointing to something in newspawn.sqf so I think I am getting closer
 
Testing your code modification exactly. This is how i've got it set up http://pastebin.com/GdjVSguS going to mess around with it

Edit: Test 1, no dice. Took a look at some other scripts for inspiration, modified some things, testing again.
Edit: Test 2, no dice. Redoing
Edit: Test 3, no dice. For once the .rpt is pointing to something in newspawn.sqf so I think I am getting closer

I've got it working.
 
This is the method I am using for random custom spawn selection for everyone on the server except for a select group. It can be easily modified for random spawns only for certain individuals or whatever you want. Borrowed random selection from pixel's teleport script. Feel free to use my points if you want:

Code:
if (!isDedicated) then {
        sleep 1;
        PlayerHumanity = (player getVariable"humanity");
        telelocation = round (random 20.3);
        if ((getPlayerUID player) in ["124567","234234324"]) exitWith {
            player setPosATL [2337.67,15352.3,0.002];
            };
        if (PlayerHumanity > -999999999) exitWith {
        switch (telelocation) do
    {
    case 0:
        {
        player setPosATL [6686.8,2290.11,0.001]; //cherno church
        };
    case 1:
        {
        player setPosATL [1047.04,2268.01,0.001]; //kamenka road
        };
    case 2:
        {
        player setPosATL [3608.21,2151.49,0.001]; //komarovo docks
        };
    case 3:
        {
        player setPosATL [7235.6,2233.5,0.001]; //cherno docks
        };
    case 4:
        {
        player setPosATL [7952.16,3204.92,0.002]; //prigor
        };
    case 5:
        {
        player setPosATL [9479.41,1960.8,0.001]; //elektro gas station
        };
    case 6:
        {
        player setPosATL [10497.3,2016.5,0.001]; //elektro2
        };
    case 7:
        {
        player setPosATL [12070.5,3591.06,0.001]; //kamyshovo
        };
    case 8:
        {
        player setPosATL [4388.23,2263.44,0.001]; //Balota docks
        };
    case 8:
        {
        player setPosATL [3625.72,8976.06,0.001]; //Vybor gas station
        };
    case 10:
        {
        player setPosATL [9711.25,8962.2,0.001]; //Gorka
        };
    case 11:
        {
        player setPosATL [11936.1,8870.28,0.001]; //Berezino
        };
    case 12:
        {
        player setPosATL [5300.83,8547.84,0.002]; //Kabanino
        };
    case 13:
        {
        player setPosATL [4582.06,6457.02,0.001]; //Pogorevka
        };       
    case 14:
        {
        player setPosATL [10845.3,2701.37,0.009]; //elektro3
        };
    case 15:
        {
        player setPosATL [1244.61,2614.59,0.001]; //kamenka2
        };
    case 16:
        {
        player setPosATL [13387.5,6617.4,0.001]; //solnichniy gas station
        };
    case 17:
        {
        player setPosATL [5939.45,10195.3,0.001]; //Grishino
        };
    case 18:
        {
        player setPosATL [11052.5,12361.2,0.002]; //Krasnostav
        };
    case 19:
        {
        player setPosATL [5683.43,3004.63,0.001]; //North Balota Power Station
        };
    case 20:
        {
        player setPosATL [9153.26,3900.56,0.001]; //Pusta
        };
    };
       
};
};

That looks pretty damn amazing ebay :) Would I be able to set humanity
Code:
  PlayerHumanity = (player getVariable"humanity");
        telelocation = round (random 20.3);
        if ((getPlayerUID player) in ["124567","234234324"]) exitWith {
            player setPosATL [2337.67,15352.3,0.002];
            };
        if (PlayerHumanity > -999999999) exitWith {
to say spawn heroes in certain areas and bandits in certain areas ?
 
For random spawns for bandits and heroes you could do like this:
Code:
if (!isDedicated) then {
        sleep 1;
        PlayerHumanity = (player getVariable"humanity");
        telelocation = round (random 2.3);
        if (PlayerHumanity > 4999) exitWith {
            switch (telelocation) do
            {
            case 0:
                {
                player setPosATL [6686.8,2290.11,0.001]; //hero spawn1
                };
            case 1:
                {
                player setPosATL [1047.04,2268.01,0.001]; //hero spawn2
                };
            };
        };
        if (PlayerHumanity < 0) exitWith {
            switch (telelocation) do
            {
            case 0:
                {
                player setPosATL [12070.5,3591.06,0.001]; //bandit spawn1
                };
            case 1:
                {
                player setPosATL [4388.23,2263.44,0.001]; //bandit spawn2
                };
            };
        };
    };

If you only wanted one spawn for each (like a bandit and hero base) then you don't need the random selection. You could just substitute humanity for UID in the OP script like this:
Code:
if (!isDedicated) then {
        sleep 1;
        PlayerHumanity = (player getVariable"humanity");
        if (PlayerHumanity > 4999) exitWith {
            player setPosATL [2337.67,15352.3,0.002]; //hero base
            };
        if (PlayerHumanity < 0) exitWith {
            player setPosATL [6686.8,2290.11,0.001]; //bandit base
            };
        };

Awesome. Thanks
 
Anyone have this working on 1.7.7.1? I've never tried it before but I'm pretty sure I have everything correct per Player2's instructions.

Code:
dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];

I had this above my custom buildings and noticed my buildings didn't work.... it's now at the very bottom of mission init
Code:
//##UID Based Custom Spawn Locations##
p2_newspawn = compile preprocessFileLineNumbers "scripts\customspawn.sqf";
waitUntil {!isNil ("dayzLoginRecord")};
if (dayzPlayerLogin2 select 2) then
{
    player spawn p2_newspawn;
};


UID is a copy paste so I know it's right (edited for obvious reasons) and my location is the same as a custom
Code:
if (!isDedicated) then {
sleep 1;
//Player UID's
if ((getPlayerUID player) in ["123456789"]) exitWith {
//## Custom Spawn Location 1 - Format: [X,Y,Z] (Z = Height AtTerrainLevel)
player setPosATL [14238,14144,0.002];
};,
};
 
Hey guys, for some reason I still can't get this to work even with the updated code above :(

I'm running DayZCC 1.7.7.1 with the following code (copied from my files as I write this post):

Step 1: Server PBO
compile > server_playersetup
Code:
dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];
_clientID = owner _playerObj;
_clientID publicVariableClient "dayzPlayerLogin2";


Step 2: Mission PBO
init.sqf paste this:
Code:
//##UID Based Custom Spawn Locations##
p2_newspawn = compile preprocessFileLineNumbers "fixes\newspawn.sqf";
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2) then
{
    player spawn p2_newspawn;
};


Step 3: Create a "fixes" folder and inside create a file called "newspawn.sqf" > paste this:
Code:
if (!isDedicated) then {
        sleep 1;
                        //Player UID's
        if ((getPlayerUID player) in ["95243846","58434118","118450566"]) exitWith {
        //## Custom Spawn Location 1 - Format: [X,Y,Z] (Z = Height AtTerrainLevel)
            player setPosATL [185,7243,1.5];
        };
   
                        //Player UID's
        if ((getPlayerUID player) in ["81239110"]) exitWith {
        //## Custom Spawn Location 2 - Format: [X,Y,Z] (Z = Height AtTerrainLevel)
            player setPosATL [195,7213,1.5];
        };
};


and here's my folder setup to make sure the paths are correct :)

Untitled.png



Sorry for the long post but I want to provide as much information as possible. Any help would be greatly appreciated.


Thank you!
 
Meet me now on the cc forum i can help

Gesendet von meinem GT-I9100 mit Tapatalk 4 Beta
 
Hey guys, for some reason I still can't get this to work even with the updated code above :(

I'm running DayZCC 1.7.7.1 with the following code (copied from my files as I write this post):

Step 1: Server PBO
compile > server_playersetup
Code:
dayzPlayerLogin2 = [_worldspace,_state,_randomSpot];
_clientID = owner _playerObj;
_clientID publicVariableClient "dayzPlayerLogin2";


Step 2: Mission PBO
init.sqf paste this:
Code:
//##UID Based Custom Spawn Locations##
p2_newspawn = compile preprocessFileLineNumbers "fixes\newspawn.sqf";
waitUntil {!isNil ("PVDZ_plr_LoginRecord")};
if (dayzPlayerLogin2 select 2) then
{
    player spawn p2_newspawn;
};


Step 3: Create a "fixes" folder and inside create a file called "newspawn.sqf" > paste this:
Code:
if (!isDedicated) then {
        sleep 1;
                        //Player UID's
        if ((getPlayerUID player) in ["95243846","58434118","118450566"]) exitWith {
        //## Custom Spawn Location 1 - Format: [X,Y,Z] (Z = Height AtTerrainLevel)
            player setPosATL [185,7243,1.5];
        };
 
                        //Player UID's
        if ((getPlayerUID player) in ["81239110"]) exitWith {
        //## Custom Spawn Location 2 - Format: [X,Y,Z] (Z = Height AtTerrainLevel)
            player setPosATL [195,7213,1.5];
        };
};


and here's my folder setup to make sure the paths are correct :)

Untitled.png



Sorry for the long post but I want to provide as much information as possible. Any help would be greatly appreciated.


Thank you!

You do have to change the default worldspaces...they are not legit worldspaces and won't work...
 
You do have to change the default worldspaces...they are not legit worldspaces and won't work...
I just put the back in there for examples sake. S0rry should have mentioned!


Here's the worldsaces I tried. I also took some worldspaces from previous posts too:

[6686.8,2290.11,0.001] // cherno church - borrowed from ebay above :)
[0,[1100,2560,0]] // using http://snuletek.org/arma2coordcalc/


Thanks :)
 
Back
Top