NEED HELP WITH TRIGGER (IF YOU ARE DECENT WITH SQL PLEASEEEE HELP!)

ok so after switching to a host that lets me have liberal access privileges in the data base, ive been working on some stuff. I just getting snagged on something.. ill use post as an example from a post:
Custom Spawn location based on UID?

the trigger is:
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;$$

ok so i got it working, only thing is:
if you log out and back in, it will spawn you at the custom spawn spot. i can see this being taken advantage of.. ie in cherno on the run, battle log knowing damn well when you come back youll be at the base.

so i wanna add 2 checks to this, the one thats already there, and one that checks the survivor table to see if player is_dead.

so i tried something like:
PHP:
CREATE TRIGGER `custom_spawn`
  BEFORE INSERT ON `survivor`
  FOR EACH ROW
BEGIN
DECLARE x tinyint;
DECLARE y INT;
DECLARE z varchar(50);
SET x = (SELECT 'is_dead' FROM 'survivor' WHERE `is_dead`=NEW.is_dead);
SET y = (SELECT `unique_id` FROM `cust_spawn` WHERE `unique_id`=NEW.unique_id);
SET z = (SELECT `worldspace` FROM `cust_spawn` WHERE `unique_id`=NEW.unique_id);
IF NEW.is_dead = 1 AND IF NEW.unique_id = y
SET NEW.worldspace=z;
END IF;
END;

but somethings wrong with it.. anyone clarify the error?

ive tried:
DECLARE x tinyint(30);
IF NEW.is_dead = 1 AND NEW.unique_id = y

lost
 
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
 
cause:


typ6x.jpg
 
Yeh see we looked at the trigger version, and while it wud be easier to do it via the database, its only slightly easier lol, and personally ive found the custom loadouts done via the database to be a bit buggy at times. So we figured out how to call the newspawn and create it in the pbo :p see the tut p2 put up here
 
i did
but i want to figure this out for current ideas​
if i can figure out how to do if x=true and y=true then do z
 
rofl, Consider yourself lucky you have the freedom to say whatever you want without consequences on the internet. I assure your face would look different if you were to dare run that mouth off like that to anyone (myself included) IRL. I will not further this conversation with you any longer, because that's what got you banned in the first place.
 
What seeker did may have been wrong but he couldn't advertise Blurs anti hack I mean hangenders anti hack because that would break the rules of "No Commercial Services". Any who seeker if you happen to get a hold of a copy like I have, I suggest you keep it to your self. The idea of paying for it is to stop hackers from reading the code and exploiting it.
 
rofl, Consider yourself lucky you have the freedom to say whatever you want without consequences on the internet. I assure your face would look different if you were to dare run that mouth off like that to anyone (myself included) IRL. I will not further this conversation with you any longer, because that's what got you banned in the first place.
and you dont know what my face looks like. any change would be an improvement, im hideous.. LOOK AWAY! lets not start blowing up this thread, drawing undue attention to ourselves.. if you ever find your self in so-cal. look me up, maybe we could go to starbucks and be buddies!
I suggest you keep it to your self. The idea of paying for it is to stop hackers from reading the code and exploiting it.
ya i bought one already to support the cause! unlike some of you who downloaded what i posted. that was just rude. hangender worked very hard on Frankensteining that code (and that aint sarcasm)
He's a dog :)
MOON MOON! reverse posting is kinda cool :)
Didn't we BAN this guy?
And its kinda cool im still remembered after alllll this time.. specially considering the thread was up for a few hours only.. Were you guys talking about me while i was gone? can i get the transcripts? ive never been remembered for anything before.. kinda gives me a warm fuzzy feeling.. is this what it feels like too have friends? aint never really had one of those.. well i had a pet frog once.. but he was gone in the morning... they always leave... now im sad..
 
good job on taking the thread and totally side swiping it with a useless argument. demit delete your non helping posts. this is a forum to learn, not to bicker and fight.
 
good job on taking the thread and totally side swiping it with a useless argument. demit delete your non helping posts. this is a forum to learn, not to bicker and fight.
still havent figured it out.. looked for DROP TRIGGER x IF . or TRIGGER 'trigger_trigger' IF .. nothing
 
still havent figured it out.. looked for DROP TRIGGER x IF . or TRIGGER 'trigger_trigger' IF .. nothing


you dont need to search the database to figure out if they spawned in or not. have it trigger inside your init.sqf

you will want to do this i think. this is how i get my skins menu to only show once per life.

Code:
if (!isDedicated) then {
 
waitUntil {!isNil ("dayz_Totalzedscheck") and  !(player getVariable ["humanity",0] > 5000 and typeOf player == "Survivor2_DZ") and !(player getVariable ["humanity",0] < -2000 and (typeOf player == "Survivor2_DZ" or typeOf player == "SurvivorW2_DZ") ) and !(player getVariable ["humanity",0] > 0 and (typeOf player == "Bandit1_DZ" or typeOf player == "BanditW1_DZ") ) };
if (dayzPlayerLogin2 select 2) then
{
    sleep 4;
    [] execVM "Scripts\INSERTYOURSCRIPTCALLHERE.sqf";
  };
};

this then will execute for everyone and only on new spawn. :D
 
This is a forum as ALKINDA said, seeker has already contacted Pwnz0r about signing up again. STFU and leave it alone, unless you want Pwnz0r to get involved. What is done, is done. Don't bring back the past.
 
This is a forum as ALKINDA said, seeker has already contacted Pwnz0r about signing up again. STFU and leave it alone, unless you want Pwnz0r to get involved. What is done, is done. Don't bring back the past.


I can bring up what I want it's a public forum I've never seen an apology from him, indeed his new account name is designed to "boast" about his actions in his original dumb thread. He registered the new account immediately after being banned. The child acted like a full blown retard and was justifiably banned for it.
 
I can bring up what I want it's a public forum I've never seen an apology from him, indeed his new account name is designed to "boast" about his actions in his original dumb thread. The guy acted like a full blown retard and was justifiably banned for it.

I don't doubt that his new account name is designed to boast, although in my opinion it is rather hilarious. If seeker was to apologize would you just stfu and leave this be, so then he can get his answer???
 
Back
Top