[Release] Custom Spawn Points Based on UID

Opticz

Well-Known Member
Help and discussion for custom spawn points based on UID begins here...
just gave it a try. didnt work unfortunatly. I created the table with the
Code:
CREATE TABLE `cust_spawn` (
`unique_id` INT(10) NULL DEFAULT NULL,
`worldspace` VARCHAR(50) NULL DEFAULT NULL
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

inserter my uid # (not the GUID)

then inserted rog as my worldspace.

then ran the sql query in phpmyadmin cuz navicat didnt like some permissions or somthing.

it ran without a hitch but when i logged in i was still where i was at before, then i killed myself to test and i was at the shore again.

dont know if i went wrong somewhere.

thanks for the help.
How easily could we tie this to a specific object from base building would you say?

Something along the lines of a custom building I'd add with very difficult to get materials (Find and craft) - At which point the person can deploy it and have it attached to their UID permanently.


When trying to create the trigger nothing seems to happen, "loading" for a split second, then no error/complete message. Using phpMyadmin

After pasting the trigger code ( the second peice of code ) did you make sure you added $$ to the delimiter text box before pressing ok?
 
After pasting the trigger code ( the second peice of code ) did you make sure you added $$ to the delimiter text box before pressing ok?

yes i did. i noticed a delimiter box and put those 2 characters in there. I was kind of confused as to if i was supposed to delete the first line from that code or not. "delimiter = $$" line. i didnt delete it.

also how is this supposed to work. EVERY time they respawn from a death or every time they relog they relocate there?
 
Ahh my bad guys, I copied the wrong peice of trigger code when copying it over from the OT. The actual working trigger is below:
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;$$
With this one you don't have to enter your database name just remember to add the $$ in the delimiter box before clicking ok.
 
hey i tried to add the "create trigger" sql code to phpmyadmin and i get this msg:"You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" using day.st. any idea what im doing wrong?
 
Your not doing anything wrong, but ST users do not get full admin rights over the database, email them asking for them to add the trigger.
 
i am unable to get the trigger to work using HeidiSQL i get this error

SQL Error (1303): Can't create a TRIGGER from within another stored routine

i have created the cust_spawn table but i am unable to run the trigger

thanks
 
Back
Top