Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER ;;
- CREATE DEFINER=`dayz`@`%` PROCEDURE `proc_loginSurvivor`(IN `p_uniqueId` varchar(128), IN `p_playerName` varchar(128))
- begin
- DECLARE clanid INT;
- DECLARE clan_model VARCHAR(32);
- DECLARE clan_inventory VARCHAR(2048) DEFAULT '[]';
- DECLARE clan_backpack VARCHAR(2048) DEFAULT '[]';
- -- SET clanid = (SELECT FLOOR(1+ (RAND() * 25)));
- IF p_playerName LIKE 'Team 1%' THEN
- SET clanid = 1;
- END IF;
- IF p_playerName LIKE 'Team 2%' THEN
- SET clanid = 2;
- END IF;
- IF p_playerName LIKE 'Team 3%' THEN
- SET clanid = 3;
- END IF;
- IF p_playerName LIKE 'Team 4%' THEN
- SET clanid = 4;
- END IF;
- IF p_playerName LIKE 'Team Staff%' THEN
- SET clanid = 5;
- END IF;
- -- SET clanid = (SELECT clan_id FROM profile WHERE unique_id = p_uniqueId);
- -- SELECT CONCAT('clandid: ', clanid, ' pos: ', (SELECT spawn_point FROM clans WHERE clan_id = clanid));
- -- SELECT model, inventory, backpack INTO clan_model, clan_inventory, clan_backpack FROM clans WHERE clan_id = clanid;
- SELECT inventory, backpack, model INTO clan_inventory, clan_backpack, clan_model FROM clans WHERE clan_id = clanid;
- update profile set name = p_playerName where unique_id = p_uniqueId;
- update profile set clan_id = clanid where unique_id = p_uniqueId;
- update survivor
- set state = '["","aidlpercmstpsnonwnondnon_player_idlesteady04",36]'
- where
- unique_id = p_uniqueId and is_dead = 0; -- and state rlike '.*_(driver|pilot)';
- update survivor
- set model = clan_model
- where
- unique_id = p_uniqueId and is_dead = 0; --
- select
- id, clan_inventory, clan_backpack, floor(time_to_sec(timediff(now(), start_time)) / 60), clan_model, last_ate, last_drank
- from survivor
- where
- survivor.unique_id = p_uniqueId
- and is_dead = 0; --
- end;;
- DELIMITER ;
Add Comment
Please, Sign In to add comment