Try
CREATE TRIGGER tg_ai_tablea
AFTER INSERT ON tablea
FOR EACH ROW
INSERT INTO tableb (userid, value)
VALUES (NEW.userid, CASE NEW.type WHEN 'admin' THEN 1 WHEN 'user' THEN 2 END);
Here is SQLFiddle demo
You can also consider instead of storing value
just evaluating it on the fly
SELECT b.userid,
CASE a.type WHEN 'admin' THEN 1 WHEN 'user' THEN 2 END value
-- , other columns from tableb
FROM tableb b JOIN tablea a
ON b.userid = a.user.id;