Custom Spawn location based on UID?

Had to totally rewrite the trigger function but seems I got it to work in the end, as it wasnt even saving properly due to syntax errors before.
Only trouble now:
it changes the value briefly inside the DB to the new one (refreshing the table at the right time will show the correct values), but you'll still end up at the old spawn position.
So the game seems to overwrite that one anyway, or the DB is too slow in adding in the value.

Ive also tried this whole trigger thingie with a custom model trigger that changes your model to another or even specific one on creating a new entry in the table. Same results there. Gets changed briefly inside the DB but you still end up with the default Survivor model on spawn.

Any advise greatly appreciated.
 
Random skins is a script you need to add to your server. And a lengthy one at that from what I have read. I am going to assume that custom spawn locations is going to be a script mod as well in order to work properly.

But you look at the instructions on how to add random skins here
 
Random skins is a script you need to add to your server. And a lengthy one at that from what I have read. I am going to assume that custom spawn locations is going to be a script mod as well in order to work properly.

But you look at the instructions on how to add random skins here

Does it work without rmod?
 
The link I put in the original post for random skins is to the site for the guys that created rmod. That script was designed by them as well. So, yes it does work with rmod.


They are also almost finished developing rmod2 as well, if you want to check that out.
 
Shoot sorry bout that. It can work without rmod but you would have to mod your dayz_code.pbo then distribute it to anyone that wants to play on your server. So if you wanted to implement it I would recommend utilizing rmod.
 
Could this be done another way? Without using DB triggers?
Surely it's possible to code something in the server pbo to teleport players after they've spawned?
 
Could this be done another way? Without using DB triggers?
Surely it's possible to code something in the server pbo to teleport players after they've spawned?
This DB trigger should work if we can get the syntax errors sorted.
Anyone had any joy?
 
the syntax on the OP was wrong
Code:
CREATE TRIGGER `custom_spawn`
   BEFORE INSERT ON `survivor`
   FOR EACH ROW
BEGIN
DECLARE x INT;
DECLARE y varchar(50);
SET x = (SELECT `unique_id` FROM `cust_spawn` WHERE `unique_id`=NEW.unique_id);
SET y = (SELECT `worldspace` FROM `cust_spawn` WHERE `unique_id`=NEW.unique_id);
IF NEW.unique_id = x THEN
SET NEW.worldspace=y;
END IF;
END;$$

You need to set the delimiter to $$ (if you use phpmyadmin like me then there is a wee box bellow the SQL window)
 
going to share what i learned. (i run on dayz.st, like most do)
short tutorial:

1)go into your database, click the SQL tab on top and put in:

Code:
CREATE TABLE `cust_spawn` (
`unique_id` INT(10) NULL DEFAULT NULL,
`worldspace` VARCHAR(50) NULL DEFAULT NULL
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

2)then send an email to your host (heres a cut and paste of mine to dayz.st):

Subject: Adding Trigger to DB

I run two servers, and need to add a trigger to the survivor table in my DB. But this requires SUPER ADMIN privileges.

My servers are:
173.193.205.66:3425 (username:xxxxxxxxxxx)
208.43.9.86:3000 (username:xxxxxxxxxx)

Ive already made the cust_spawn table on both servers, now i just need the triggers in the survivor table, heres the trigger:

Code:
CREATE TRIGGER `custom_spawn`
BEFORE INSERT ON `survivor`
FOR EACH ROW
BEGIN
DECLARE x INT;
DECLARE y varchar(50);
SET x = (SELECT `unique_id` FROM `cust_spawn` WHERE `unique_id`=NEW.unique_id);
SET y = (SELECT `worldspace` FROM `cust_spawn` WHERE `unique_id`=NEW.unique_id);
IF NEW.unique_id = x THEN
SET NEW.worldspace=y;
END IF;
END;$$
and obviously the delimiter is set to $$.

Thank you for your time, and assistance,
 
Back
Top